diff --git a/service/apigateway/types/enums.go b/service/apigateway/types/enums.go index f5598189733..784f47d3fa0 100644 --- a/service/apigateway/types/enums.go +++ b/service/apigateway/types/enums.go @@ -206,6 +206,13 @@ func (DomainNameStatus) Values() []DomainNameStatus { type EndpointType string +// Enum values for EndpointType +const ( + EndpointTypeRegional EndpointType = "REGIONAL" + EndpointTypeEdge EndpointType = "EDGE" + EndpointTypePrivate EndpointType = "PRIVATE" +) + // Values returns all known values for EndpointType. Note that this can be expanded // in the future, and so it is only as up to date as the client. The ordering of // this slice is not guaranteed to be stable across updates. @@ -315,6 +322,16 @@ func (LocationStatusType) Values() []LocationStatusType { type Op string +// Enum values for Op +const ( + OpAdd Op = "add" + OpRemove Op = "remove" + OpReplace Op = "replace" + OpMove Op = "move" + OpCopy Op = "copy" + OpTest Op = "test" +) + // Values returns all known values for Op. 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. @@ -369,6 +386,12 @@ func (QuotaPeriodType) Values() []QuotaPeriodType { type SecurityPolicy string +// Enum values for SecurityPolicy +const ( + SecurityPolicyTls10 SecurityPolicy = "TLS_1_0" + SecurityPolicyTls12 SecurityPolicy = "TLS_1_2" +) + // Values returns all known values for SecurityPolicy. 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. diff --git a/service/applicationinsights/types/enums.go b/service/applicationinsights/types/enums.go index 64ed3ed9987..da8527dfc43 100644 --- a/service/applicationinsights/types/enums.go +++ b/service/applicationinsights/types/enums.go @@ -4,6 +4,14 @@ package types type CloudWatchEventSource string +// Enum values for CloudWatchEventSource +const ( + CloudWatchEventSourceEc2 CloudWatchEventSource = "EC2" + CloudWatchEventSourceCodeDeploy CloudWatchEventSource = "CODE_DEPLOY" + CloudWatchEventSourceHealth CloudWatchEventSource = "HEALTH" + CloudWatchEventSourceRds CloudWatchEventSource = "RDS" +) + // Values returns all known values for CloudWatchEventSource. 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. @@ -18,6 +26,14 @@ func (CloudWatchEventSource) Values() []CloudWatchEventSource { type ConfigurationEventResourceType string +// Enum values for ConfigurationEventResourceType +const ( + ConfigurationEventResourceTypeCloudwatchAlarm ConfigurationEventResourceType = "CLOUDWATCH_ALARM" + ConfigurationEventResourceTypeCloudwatchLog ConfigurationEventResourceType = "CLOUDWATCH_LOG" + ConfigurationEventResourceTypeCloudformation ConfigurationEventResourceType = "CLOUDFORMATION" + ConfigurationEventResourceTypeSsmAssociation ConfigurationEventResourceType = "SSM_ASSOCIATION" +) + // Values returns all known values for ConfigurationEventResourceType. 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 @@ -33,6 +49,13 @@ func (ConfigurationEventResourceType) Values() []ConfigurationEventResourceType type ConfigurationEventStatus string +// Enum values for ConfigurationEventStatus +const ( + ConfigurationEventStatusInfo ConfigurationEventStatus = "INFO" + ConfigurationEventStatusWarn ConfigurationEventStatus = "WARN" + ConfigurationEventStatusError ConfigurationEventStatus = "ERROR" +) + // Values returns all known values for ConfigurationEventStatus. 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. @@ -46,6 +69,11 @@ func (ConfigurationEventStatus) Values() []ConfigurationEventStatus { type FeedbackKey string +// Enum values for FeedbackKey +const ( + FeedbackKeyInsightsFeedback FeedbackKey = "INSIGHTS_FEEDBACK" +) + // Values returns all known values for FeedbackKey. 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. @@ -57,6 +85,13 @@ func (FeedbackKey) Values() []FeedbackKey { type FeedbackValue string +// Enum values for FeedbackValue +const ( + FeedbackValueNotSpecified FeedbackValue = "NOT_SPECIFIED" + FeedbackValueUseful FeedbackValue = "USEFUL" + FeedbackValueNotUseful FeedbackValue = "NOT_USEFUL" +) + // Values returns all known values for FeedbackValue. 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. @@ -70,6 +105,13 @@ func (FeedbackValue) Values() []FeedbackValue { type LogFilter string +// Enum values for LogFilter +const ( + LogFilterError LogFilter = "ERROR" + LogFilterWarn LogFilter = "WARN" + LogFilterInfo LogFilter = "INFO" +) + // Values returns all known values for LogFilter. 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. @@ -83,6 +125,12 @@ func (LogFilter) Values() []LogFilter { type OsType string +// Enum values for OsType +const ( + OsTypeWindows OsType = "WINDOWS" + OsTypeLinux OsType = "LINUX" +) + // Values returns all known values for OsType. 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. @@ -95,6 +143,13 @@ func (OsType) Values() []OsType { type SeverityLevel string +// Enum values for SeverityLevel +const ( + SeverityLevelLow SeverityLevel = "Low" + SeverityLevelMedium SeverityLevel = "Medium" + SeverityLevelHigh SeverityLevel = "High" +) + // Values returns all known values for SeverityLevel. 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. @@ -108,6 +163,13 @@ func (SeverityLevel) Values() []SeverityLevel { type Status string +// Enum values for Status +const ( + StatusIgnore Status = "IGNORE" + StatusResolved Status = "RESOLVED" + StatusPending Status = "PENDING" +) + // Values returns all known values for Status. 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. @@ -121,6 +183,22 @@ func (Status) Values() []Status { type Tier string +// Enum values for Tier +const ( + TierCustom Tier = "CUSTOM" + TierDefault Tier = "DEFAULT" + TierDotNetCore Tier = "DOT_NET_CORE" + TierDotNetWorker Tier = "DOT_NET_WORKER" + TierDotNetWebTier Tier = "DOT_NET_WEB_TIER" + TierDotNetWeb Tier = "DOT_NET_WEB" + TierSqlServer Tier = "SQL_SERVER" + TierSqlServerAlwaysonAvailabilityGroup Tier = "SQL_SERVER_ALWAYSON_AVAILABILITY_GROUP" + TierMysql Tier = "MYSQL" + TierPostgresql Tier = "POSTGRESQL" + TierJavaJmx Tier = "JAVA_JMX" + TierOracle Tier = "ORACLE" +) + // Values returns all known values for Tier. 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. diff --git a/service/appstream/types/enums.go b/service/appstream/types/enums.go index 30ddd94b7d0..0a561ab6d97 100644 --- a/service/appstream/types/enums.go +++ b/service/appstream/types/enums.go @@ -327,6 +327,13 @@ func (Permission) Values() []Permission { type PlatformType string +// Enum values for PlatformType +const ( + PlatformTypeWindows PlatformType = "WINDOWS" + PlatformTypeWindowsServer2016 PlatformType = "WINDOWS_SERVER_2016" + PlatformTypeWindowsServer2019 PlatformType = "WINDOWS_SERVER_2019" +) + // Values returns all known values for PlatformType. 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. diff --git a/service/batch/api_op_CancelJob.go b/service/batch/api_op_CancelJob.go index ad36cf70fd3..f2403b11434 100644 --- a/service/batch/api_op_CancelJob.go +++ b/service/batch/api_op_CancelJob.go @@ -29,6 +29,7 @@ func (c *Client) CancelJob(ctx context.Context, params *CancelJobInput, optFns . return out, nil } +// Contains the parameters for CancelJob. type CancelJobInput struct { // The AWS Batch job ID of the job to cancel. diff --git a/service/batch/api_op_CreateComputeEnvironment.go b/service/batch/api_op_CreateComputeEnvironment.go index f0795f846e6..3f5c81db7f9 100644 --- a/service/batch/api_op_CreateComputeEnvironment.go +++ b/service/batch/api_op_CreateComputeEnvironment.go @@ -22,7 +22,7 @@ import ( // to use EC2 On-Demand Instances and EC2 Spot Instances, or to use Fargate and // Fargate Spot capacity in your managed compute environment. You can optionally // set a maximum price so that Spot Instances only launch when the Spot Instance -// price is below a specified percentage of the On-Demand price. Multi-node +// price is less than a specified percentage of the On-Demand price. Multi-node // parallel jobs are not supported on Spot Instances. In an unmanaged compute // environment, you can manage your own EC2 compute resources and have a lot of // flexibility with how you configure your compute resources. For example, you can @@ -32,7 +32,7 @@ import ( // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/container_instance_AMIs.html) // in the Amazon Elastic Container Service Developer Guide. After you have created // your unmanaged compute environment, you can use the DescribeComputeEnvironments -// operation to find the Amazon ECS cluster that is associated with it. Then, +// operation to find the Amazon ECS cluster that's associated with it. Then, // manually launch your container instances into that Amazon ECS cluster. For more // information, see Launching an Amazon ECS container instance // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/launch_container_instance.html) @@ -69,6 +69,7 @@ func (c *Client) CreateComputeEnvironment(ctx context.Context, params *CreateCom return out, nil } +// Contains the parameters for CreateComputeEnvironment. type CreateComputeEnvironmentInput struct { // The name for your compute environment. Up to 128 letters (uppercase and @@ -78,14 +79,16 @@ type CreateComputeEnvironmentInput struct { ComputeEnvironmentName *string // The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to - // make calls to other AWS services on your behalf. If your specified role has a - // path other than /, then you must either specify the full role ARN (this is - // recommended) or prefix the role name with the path. Depending on how you created - // your AWS Batch service role, its ARN may contain the service-role path prefix. - // When you only specify the name of the service role, AWS Batch assumes that your - // ARN doesn't use the service-role path prefix. Because of this, we recommend that - // you specify the full ARN of your service role when you create compute - // environments. + // make calls to other AWS services on your behalf. For more information, see AWS + // Batch service IAM role + // (https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html) in + // the AWS Batch User Guide. If your specified role has a path other than /, then + // you must either specify the full role ARN (this is recommended) or prefix the + // role name with the path. Depending on how you created your AWS Batch service + // role, its ARN might contain the service-role path prefix. When you only specify + // the name of the service role, AWS Batch assumes that your ARN doesn't use the + // service-role path prefix. Because of this, we recommend that you specify the + // full ARN of your service role when you create compute environments. // // This member is required. ServiceRole *string @@ -107,7 +110,14 @@ type CreateComputeEnvironmentInput struct { // The state of the compute environment. If the state is ENABLED, then the compute // environment accepts jobs from a queue and can scale out automatically based on - // queues. + // queues. If the state is ENABLED, then the AWS Batch scheduler can attempt to + // place jobs from an associated job queue on the compute resources within the + // environment. If the compute environment is managed, then it can scale its + // instances out or in automatically, based on the job queue demand. If the state + // is DISABLED, then the AWS Batch scheduler doesn't attempt to place jobs within + // the environment. Jobs in a STARTING or RUNNING state continue to progress + // normally. Managed compute environments in the DISABLED state don't scale out. + // However, they scale in to minvCpus value after instances become idle. State types.CEState // The tags that you apply to the compute environment to help you categorize and @@ -127,7 +137,8 @@ type CreateComputeEnvironmentOutput struct { // The Amazon Resource Name (ARN) of the compute environment. ComputeEnvironmentArn *string - // The name of the compute environment. + // The name of the compute environment. Up to 128 letters (uppercase and + // lowercase), numbers, hyphens, and underscores are allowed. ComputeEnvironmentName *string // Metadata pertaining to the operation's result. diff --git a/service/batch/api_op_CreateJobQueue.go b/service/batch/api_op_CreateJobQueue.go index f77522a9f63..b59bc95a43c 100644 --- a/service/batch/api_op_CreateJobQueue.go +++ b/service/batch/api_op_CreateJobQueue.go @@ -33,6 +33,7 @@ func (c *Client) CreateJobQueue(ctx context.Context, params *CreateJobQueueInput return out, nil } +// Contains the parameters for CreateJobQueue. type CreateJobQueueInput struct { // The set of compute environments mapped to a job queue and their order relative @@ -41,12 +42,15 @@ type CreateJobQueueInput struct { // state before you can associate them with a job queue. You can associate up to // three compute environments with a job queue. All of the compute environments // must be either EC2 (EC2 or SPOT) or Fargate (FARGATE or FARGATE_SPOT); EC2 and - // Fargate compute environments can't be mixed. + // Fargate compute environments can't be mixed. All compute environments that are + // associated with a job queue must share the same architecture. AWS Batch doesn't + // support mixing compute environment architecture types in a single job queue. // // This member is required. ComputeEnvironmentOrder []types.ComputeEnvironmentOrder - // The name of the job queue. + // The name of the job queue. Up to 128 letters (uppercase and lowercase), numbers, + // and underscores are allowed. // // This member is required. JobQueueName *string @@ -55,7 +59,9 @@ type CreateJobQueueInput struct { // integer value for the priority parameter) are evaluated first when associated // with the same compute environment. Priority is determined in descending order. // For example, a job queue with a priority value of 10 is given scheduling - // preference over a job queue with a priority value of 1. + // preference over a job queue with a priority value of 1. All of the compute + // environments must be either EC2 (EC2 or SPOT) or Fargate (FARGATE or + // FARGATE_SPOT); EC2 and Fargate compute environments cannot be mixed. // // This member is required. Priority int32 @@ -67,9 +73,9 @@ type CreateJobQueueInput struct { // The tags that you apply to the job queue to help you categorize and organize // your resources. Each tag consists of a key and an optional value. For more - // information, see Tagging AWS Resources - // (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in AWS General - // Reference. + // information, see Tagging your AWS Batch resources + // (https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html) in AWS + // Batch User Guide. Tags map[string]string } diff --git a/service/batch/api_op_DeleteComputeEnvironment.go b/service/batch/api_op_DeleteComputeEnvironment.go index 345a5afe4b3..223a9cfb46a 100644 --- a/service/batch/api_op_DeleteComputeEnvironment.go +++ b/service/batch/api_op_DeleteComputeEnvironment.go @@ -32,6 +32,7 @@ func (c *Client) DeleteComputeEnvironment(ctx context.Context, params *DeleteCom return out, nil } +// Contains the parameters for DeleteComputeEnvironment. type DeleteComputeEnvironmentInput struct { // The name or Amazon Resource Name (ARN) of the compute environment to delete. diff --git a/service/batch/api_op_DeleteJobQueue.go b/service/batch/api_op_DeleteJobQueue.go index 52134fdc2a8..57bb0ba5d55 100644 --- a/service/batch/api_op_DeleteJobQueue.go +++ b/service/batch/api_op_DeleteJobQueue.go @@ -11,9 +11,10 @@ import ( ) // Deletes the specified job queue. You must first disable submissions for a queue -// with the UpdateJobQueue operation. All jobs in the queue are terminated when you -// delete a job queue. It's not necessary to disassociate compute environments from -// a queue before submitting a DeleteJobQueue request. +// with the UpdateJobQueue operation. All jobs in the queue are eventually +// terminated when you delete a job queue. The jobs are terminated at a rate of +// about 16 jobs each second. It's not necessary to disassociate compute +// environments from a queue before submitting a DeleteJobQueue request. func (c *Client) DeleteJobQueue(ctx context.Context, params *DeleteJobQueueInput, optFns ...func(*Options)) (*DeleteJobQueueOutput, error) { if params == nil { params = &DeleteJobQueueInput{} @@ -29,6 +30,7 @@ func (c *Client) DeleteJobQueue(ctx context.Context, params *DeleteJobQueueInput return out, nil } +// Contains the parameters for DeleteJobQueue. type DeleteJobQueueInput struct { // The short name or full Amazon Resource Name (ARN) of the queue to delete. diff --git a/service/batch/api_op_DescribeComputeEnvironments.go b/service/batch/api_op_DescribeComputeEnvironments.go index f6755522a4f..ad3a5463035 100644 --- a/service/batch/api_op_DescribeComputeEnvironments.go +++ b/service/batch/api_op_DescribeComputeEnvironments.go @@ -31,6 +31,7 @@ func (c *Client) DescribeComputeEnvironments(ctx context.Context, params *Descri return out, nil } +// Contains the parameters for DescribeComputeEnvironments. type DescribeComputeEnvironmentsInput struct { // A list of up to 100 compute environment names or full Amazon Resource Name (ARN) @@ -52,7 +53,7 @@ type DescribeComputeEnvironmentsInput struct { // exceeded the value of that parameter. Pagination continues from the end of the // previous results that returned the nextToken value. This value is null when // there are no more results to return. This token should be treated as an opaque - // identifier that is only used to retrieve the next items in a list and not for + // identifier that's only used to retrieve the next items in a list and not for // other programmatic purposes. NextToken *string } diff --git a/service/batch/api_op_DescribeJobDefinitions.go b/service/batch/api_op_DescribeJobDefinitions.go index dfdfa963ac4..3eaab43b226 100644 --- a/service/batch/api_op_DescribeJobDefinitions.go +++ b/service/batch/api_op_DescribeJobDefinitions.go @@ -29,6 +29,7 @@ func (c *Client) DescribeJobDefinitions(ctx context.Context, params *DescribeJob return out, nil } +// Contains the parameters for DescribeJobDefinitions. type DescribeJobDefinitionsInput struct { // The name of the job definition to describe. @@ -51,9 +52,8 @@ type DescribeJobDefinitionsInput struct { // request where maxResults was used and the results exceeded the value of that // parameter. Pagination continues from the end of the previous results that // returned the nextToken value. This value is null when there are no more results - // to return. 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. + // to return. This token should be treated as an opaque identifier that's only used + // to retrieve the next items in a list and not for other programmatic purposes. NextToken *string // The status used to filter job definitions. diff --git a/service/batch/api_op_DescribeJobQueues.go b/service/batch/api_op_DescribeJobQueues.go index 3c25cb321dd..b20243a67fc 100644 --- a/service/batch/api_op_DescribeJobQueues.go +++ b/service/batch/api_op_DescribeJobQueues.go @@ -28,6 +28,7 @@ func (c *Client) DescribeJobQueues(ctx context.Context, params *DescribeJobQueue return out, nil } +// Contains the parameters for DescribeJobQueues. type DescribeJobQueuesInput struct { // A list of up to 100 queue names or full queue Amazon Resource Name (ARN) @@ -47,7 +48,7 @@ type DescribeJobQueuesInput struct { // where maxResults was used and the results exceeded the value of that parameter. // Pagination continues from the end of the previous results that returned the // nextToken value. This value is null when there are no more results to return. - // This token should be treated as an opaque identifier that is only used to + // This token should be treated as an opaque identifier that's only used to // retrieve the next items in a list and not for other programmatic purposes. NextToken *string } diff --git a/service/batch/api_op_DescribeJobs.go b/service/batch/api_op_DescribeJobs.go index 25e69d95140..2f69fadd2f1 100644 --- a/service/batch/api_op_DescribeJobs.go +++ b/service/batch/api_op_DescribeJobs.go @@ -27,6 +27,7 @@ func (c *Client) DescribeJobs(ctx context.Context, params *DescribeJobsInput, op return out, nil } +// Contains the parameters for DescribeJobs. type DescribeJobsInput struct { // A list of up to 100 job IDs. diff --git a/service/batch/api_op_ListJobs.go b/service/batch/api_op_ListJobs.go index c8faccb938e..a642bccb9da 100644 --- a/service/batch/api_op_ListJobs.go +++ b/service/batch/api_op_ListJobs.go @@ -41,6 +41,7 @@ func (c *Client) ListJobs(ctx context.Context, params *ListJobsInput, optFns ... return out, nil } +// Contains the parameters for ListJobs. type ListJobsInput struct { // The job ID for an array job. Specifying an array job ID with this parameter @@ -72,7 +73,7 @@ type ListJobsInput struct { // maxResults was used and the results exceeded the value of that parameter. // Pagination continues from the end of the previous results that returned the // nextToken value. This value is null when there are no more results to return. - // This token should be treated as an opaque identifier that is only used to + // This token should be treated as an opaque identifier that's only used to // retrieve the next items in a list and not for other programmatic purposes. NextToken *string } diff --git a/service/batch/api_op_RegisterJobDefinition.go b/service/batch/api_op_RegisterJobDefinition.go index 18b60dc41a6..09661e49c8a 100644 --- a/service/batch/api_op_RegisterJobDefinition.go +++ b/service/batch/api_op_RegisterJobDefinition.go @@ -27,6 +27,7 @@ func (c *Client) RegisterJobDefinition(ctx context.Context, params *RegisterJobD return out, nil } +// Contains the parameters for RegisterJobDefinition. type RegisterJobDefinitionInput struct { // The name of the job definition to register. Up to 128 letters (uppercase and @@ -80,7 +81,7 @@ type RegisterJobDefinitionInput struct { PropagateTags bool // The retry strategy to use for failed jobs that are submitted with this job - // definition. Any retry strategy that is specified during a SubmitJob operation + // definition. Any retry strategy that's specified during a SubmitJob operation // overrides the retry strategy defined here. If a job is terminated due to a // timeout, it isn't retried. RetryStrategy *types.RetryStrategy @@ -95,7 +96,7 @@ type RegisterJobDefinitionInput struct { // The timeout configuration for jobs that are submitted with this job definition, // after which AWS Batch terminates your jobs if they have not finished. If a job // is terminated due to a timeout, it isn't retried. The minimum value for the - // timeout is 60 seconds. Any timeout configuration that is specified during a + // timeout is 60 seconds. Any timeout configuration that's specified during a // SubmitJob operation overrides the timeout configuration defined here. For more // information, see Job Timeouts // (https://docs.aws.amazon.com/batch/latest/userguide/job_timeouts.html) in the diff --git a/service/batch/api_op_SubmitJob.go b/service/batch/api_op_SubmitJob.go index 9acbed69e10..8102adc3f04 100644 --- a/service/batch/api_op_SubmitJob.go +++ b/service/batch/api_op_SubmitJob.go @@ -30,6 +30,7 @@ func (c *Client) SubmitJob(ctx context.Context, params *SubmitJobInput, optFns . return out, nil } +// Contains the parameters for SubmitJob. type SubmitJobInput struct { // The job definition used by this job. This value can be one of name, @@ -61,7 +62,7 @@ type SubmitJobInput struct { // A list of container overrides in JSON format that specify the name of a // container in the specified job definition and the overrides it should receive. - // You can override the default command for a container (that is specified in the + // You can override the default command for a container (that's specified in the // job definition or the Docker image) with a command override. You can also // override existing environment variables (that are specified in the job // definition or Docker image) on a container or add new environment variables to diff --git a/service/batch/api_op_TerminateJob.go b/service/batch/api_op_TerminateJob.go index f3781f112d6..abfcb0db2cb 100644 --- a/service/batch/api_op_TerminateJob.go +++ b/service/batch/api_op_TerminateJob.go @@ -28,6 +28,7 @@ func (c *Client) TerminateJob(ctx context.Context, params *TerminateJobInput, op return out, nil } +// Contains the parameters for TerminateJob. type TerminateJobInput struct { // The AWS Batch job ID of the job to terminate. diff --git a/service/batch/api_op_UpdateComputeEnvironment.go b/service/batch/api_op_UpdateComputeEnvironment.go index 37760bd466c..7fa180b2025 100644 --- a/service/batch/api_op_UpdateComputeEnvironment.go +++ b/service/batch/api_op_UpdateComputeEnvironment.go @@ -27,6 +27,7 @@ func (c *Client) UpdateComputeEnvironment(ctx context.Context, params *UpdateCom return out, nil } +// Contains the parameters for UpdateComputeEnvironment. type UpdateComputeEnvironmentInput struct { // The name or full Amazon Resource Name (ARN) of the compute environment to @@ -36,23 +37,36 @@ type UpdateComputeEnvironmentInput struct { ComputeEnvironment *string // Details of the compute resources managed by the compute environment. Required - // for a managed compute environment. + // for a managed compute environment. For more information, see Compute + // Environments + // (https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html) + // in the AWS Batch User Guide. ComputeResources *types.ComputeResourceUpdate // The full Amazon Resource Name (ARN) of the IAM role that allows AWS Batch to - // make calls to other AWS services on your behalf. If your specified role has a - // path other than /, then you must either specify the full role ARN (this is - // recommended) or prefix the role name with the path. Depending on how you created - // your AWS Batch service role, its ARN might contain the service-role path prefix. - // When you only specify the name of the service role, AWS Batch assumes that your - // ARN does not use the service-role path prefix. Because of this, we recommend - // that you specify the full ARN of your service role when you create compute - // environments. + // make calls to other AWS services on your behalf. For more information, see AWS + // Batch service IAM role + // (https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html) in + // the AWS Batch User Guide. If your specified role has a path other than /, then + // you must either specify the full role ARN (this is recommended) or prefix the + // role name with the path. Depending on how you created your AWS Batch service + // role, its ARN might contain the service-role path prefix. When you only specify + // the name of the service role, AWS Batch assumes that your ARN does not use the + // service-role path prefix. Because of this, we recommend that you specify the + // full ARN of your service role when you create compute environments. ServiceRole *string // The state of the compute environment. Compute environments in the ENABLED state // can accept jobs from a queue and scale in or out automatically based on the - // workload demand of its associated queues. + // workload demand of its associated queues. If the state is ENABLED, then the AWS + // Batch scheduler can attempt to place jobs from an associated job queue on the + // compute resources within the environment. If the compute environment is managed, + // then it can scale its instances out or in automatically, based on the job queue + // demand. If the state is DISABLED, then the AWS Batch scheduler doesn't attempt + // to place jobs within the environment. Jobs in a STARTING or RUNNING state + // continue to progress normally. Managed compute environments in the DISABLED + // state don't scale out. However, they scale in to minvCpus value after instances + // become idle. State types.CEState } @@ -61,7 +75,8 @@ type UpdateComputeEnvironmentOutput struct { // The Amazon Resource Name (ARN) of the compute environment. ComputeEnvironmentArn *string - // The name of the compute environment. + // The name of the compute environment. Up to 128 letters (uppercase and + // lowercase), numbers, hyphens, and underscores are allowed. ComputeEnvironmentName *string // Metadata pertaining to the operation's result. diff --git a/service/batch/api_op_UpdateJobQueue.go b/service/batch/api_op_UpdateJobQueue.go index 813e0633c34..0ace26d11f3 100644 --- a/service/batch/api_op_UpdateJobQueue.go +++ b/service/batch/api_op_UpdateJobQueue.go @@ -27,6 +27,7 @@ func (c *Client) UpdateJobQueue(ctx context.Context, params *UpdateJobQueueInput return out, nil } +// Contains the parameters for UpdateJobQueue. type UpdateJobQueueInput struct { // The name or the Amazon Resource Name (ARN) of the job queue. @@ -36,16 +37,22 @@ type UpdateJobQueueInput struct { // Details the set of compute environments mapped to a job queue and their order // relative to each other. This is one of the parameters used by the job scheduler - // to determine which compute environment should run a given job. All of the - // compute environments must be either EC2 (EC2 or SPOT) or Fargate (FARGATE or - // FARGATE_SPOT); EC2 and Fargate compute environments can't be mixed. + // to determine which compute environment should run a given job. Compute + // environments must be in the VALID state before you can associate them with a job + // queue. All of the compute environments must be either EC2 (EC2 or SPOT) or + // Fargate (FARGATE or FARGATE_SPOT); EC2 and Fargate compute environments can't be + // mixed. All compute environments that are associated with a job queue must share + // the same architecture. AWS Batch doesn't support mixing compute environment + // architecture types in a single job queue. ComputeEnvironmentOrder []types.ComputeEnvironmentOrder // The priority of the job queue. Job queues with a higher priority (or a higher // integer value for the priority parameter) are evaluated first when associated // with the same compute environment. Priority is determined in descending order, // for example, a job queue with a priority value of 10 is given scheduling - // preference over a job queue with a priority value of 1. + // preference over a job queue with a priority value of 1. All of the compute + // environments must be either EC2 (EC2 or SPOT) or Fargate (FARGATE or + // FARGATE_SPOT); EC2 and Fargate compute environments cannot be mixed. Priority int32 // Describes the queue's ability to accept new jobs. If the job queue state is diff --git a/service/batch/types/errors.go b/service/batch/types/errors.go index 0ab2deb98a1..bb58f6c4b6f 100644 --- a/service/batch/types/errors.go +++ b/service/batch/types/errors.go @@ -9,7 +9,7 @@ import ( // These errors are usually caused by a client action, such as using an action or // resource on behalf of a user that doesn't have permissions to use the action or -// resource, or specifying an identifier that isn't valid. +// resource, or specifying an identifier that's not valid. type ClientException struct { Message *string } diff --git a/service/batch/types/types.go b/service/batch/types/types.go index 16a0607cac7..5e8323b495b 100644 --- a/service/batch/types/types.go +++ b/service/batch/types/types.go @@ -12,7 +12,7 @@ type ArrayProperties struct { // An object representing the array properties of a job. type ArrayPropertiesDetail struct { - // The job index within the array that is associated with this job. This parameter + // The job index within the array that's associated with this job. This parameter // is returned for array job children. Index int32 @@ -27,7 +27,7 @@ type ArrayPropertiesDetail struct { // An object representing the array properties of a job. type ArrayPropertiesSummary struct { - // The job index within the array that is associated with this job. This parameter + // The job index within the array that's associated with this job. This parameter // is returned for children of array jobs. Index int32 @@ -35,7 +35,7 @@ type ArrayPropertiesSummary struct { Size int32 } -// An object representing the details of a container that is part of a job attempt. +// An object representing the details of a container that's part of a job attempt. type AttemptContainerDetail struct { // The Amazon Resource Name (ARN) of the Amazon ECS container instance that hosts @@ -57,8 +57,8 @@ type AttemptContainerDetail struct { // about a running or stopped container. Reason *string - // The Amazon Resource Name (ARN) of the Amazon ECS task that is associated with - // the job attempt. Each container attempt receives a task ARN when they reach the + // The Amazon Resource Name (ARN) of the Amazon ECS task that's associated with the + // job attempt. Each container attempt receives a task ARN when they reach the // STARTING status. TaskArn *string } @@ -91,7 +91,8 @@ type ComputeEnvironmentDetail struct { // This member is required. ComputeEnvironmentArn *string - // The name of the compute environment. + // The name of the compute environment. Up to 128 letters (uppercase and + // lowercase), numbers, hyphens, and underscores are allowed. // // This member is required. ComputeEnvironmentName *string @@ -102,11 +103,17 @@ type ComputeEnvironmentDetail struct { // This member is required. EcsClusterArn *string - // The compute resources defined for the compute environment. + // The compute resources defined for the compute environment. For more information, + // see Compute Environments + // (https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html) + // in the AWS Batch User Guide. ComputeResources *ComputeResource // The service role associated with the compute environment that allows AWS Batch - // to make calls to AWS API operations on your behalf. + // to make calls to AWS API operations on your behalf. For more information, see + // AWS Batch service IAM role + // (https://docs.aws.amazon.com/batch/latest/userguide/service_IAM_role.html) in + // the AWS Batch User Guide. ServiceRole *string // The state of the compute environment. The valid values are ENABLED or DISABLED. @@ -116,7 +123,7 @@ type ComputeEnvironmentDetail struct { // automatically, based on the job queue demand. If the state is DISABLED, then the // AWS Batch scheduler doesn't attempt to place jobs within the environment. Jobs // in a STARTING or RUNNING state continue to progress normally. Managed compute - // environments in the DISABLED state do not scale out. However, they scale in to + // environments in the DISABLED state don't scale out. However, they scale in to // minvCpus value after instances become idle. State CEState @@ -130,8 +137,8 @@ type ComputeEnvironmentDetail struct { // The tags applied to the compute environment. Tags map[string]string - // The type of compute environment: EC2, SPOT, FARGATE, or FARGATE_SPOT. For more - // information, see Compute Environments + // The type of the compute environment: MANAGED or UNMANAGED. For more information, + // see Compute Environments // (https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html) // in the AWS Batch User Guide. Type CEType @@ -140,7 +147,13 @@ type ComputeEnvironmentDetail struct { // The order in which compute environments are tried for job placement within a // queue. Compute environments are tried in ascending order. For example, if two // compute environments are associated with a job queue, the compute environment -// with a lower order integer value is tried for job placement first. +// with a lower order integer value is tried for job placement first. Compute +// environments must be in the VALID state before you can associate them with a job +// queue. All of the compute environments must be either EC2 (EC2 or SPOT) or +// Fargate (FARGATE or FARGATE_SPOT); EC2 and Fargate compute environments can't be +// mixed. All compute environments that are associated with a job queue must share +// the same architecture. AWS Batch doesn't support mixing compute environment +// architecture types in a single job queue. type ComputeEnvironmentOrder struct { // The Amazon Resource Name (ARN) of the compute environment. @@ -157,15 +170,18 @@ type ComputeEnvironmentOrder struct { Order int32 } -// An object representing an AWS Batch compute resource. +// An object representing an AWS Batch compute resource. For more information, see +// Compute Environments +// (https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html) +// in the AWS Batch User Guide. type ComputeResource struct { - // The maximum number of Amazon EC2 vCPUs that an environment can reach. With both - // BEST_FIT_PROGRESSIVE and SPOT_CAPACITY_OPTIMIZED allocation strategies, AWS - // Batch may need to go above maxvCpus to meet your capacity requirements. In this - // event, AWS Batch will never go above maxvCpus by more than a single instance - // (e.g., no more than a single instance from among those specified in your compute - // environment). + // The maximum number of Amazon EC2 vCPUs that a compute environment can reach. + // With both BEST_FIT_PROGRESSIVE and SPOT_CAPACITY_OPTIMIZED allocation + // strategies, AWS Batch might need to go above maxvCpus to meet your capacity + // requirements. In this event, AWS Batch will never go above maxvCpus by more than + // a single instance (e.g., no more than a single instance from among those + // specified in your compute environment). // // This member is required. MaxvCpus int32 @@ -183,7 +199,11 @@ type ComputeResource struct { // The type of compute environment: EC2, SPOT, FARGATE, or FARGATE_SPOT. For more // information, see Compute Environments // (https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html) - // in the AWS Batch User Guide. + // in the AWS Batch User Guide. If you choose SPOT, you must also specify an Amazon + // EC2 Spot Fleet role with the spotIamFleetRole parameter. For more information, + // see Amazon EC2 Spot Fleet role + // (https://docs.aws.amazon.com/batch/latest/userguide/spot_fleet_IAM_role.html) in + // the AWS Batch User Guide. // // This member is required. Type CRType @@ -221,12 +241,12 @@ type ComputeResource struct { // The maximum percentage that a Spot Instance price can be when compared with the // On-Demand price for that instance type before instances are launched. For - // example, if your maximum percentage is 20%, then the Spot price must be below - // 20% of the current On-Demand price for that Amazon EC2 instance. You always pay - // the lowest (market) price and never more than your maximum percentage. If you - // leave this field empty, the default value is 100% of the On-Demand price. This - // parameter isn't applicable to jobs running on Fargate resources, and shouldn't - // be specified. + // example, if your maximum percentage is 20%, then the Spot price must be less + // than 20% of the current On-Demand price for that Amazon EC2 instance. You always + // pay the lowest (market) price and never more than your maximum percentage. If + // you leave this field empty, the default value is 100% of the On-Demand price. + // This parameter isn't applicable to jobs running on Fargate resources, and + // shouldn't be specified. BidPercentage int32 // The desired number of Amazon EC2 vCPUS in the compute environment. AWS Batch @@ -235,13 +255,13 @@ type ComputeResource struct { // and shouldn't be specified. DesiredvCpus int32 - // Provides information used to select Amazon Machine Images (AMIs) for instances - // in the compute environment. If Ec2Configuration isn't specified, the default is - // ECS_AL1. This parameter isn't applicable to jobs running on Fargate resources, - // and shouldn't be specified. + // Provides information used to select Amazon Machine Images (AMIs) for EC2 + // instances in the compute environment. If Ec2Configuration isn't specified, the + // default is ECS_AL1. This parameter isn't applicable to jobs running on Fargate + // resources, and shouldn't be specified. Ec2Configuration []Ec2Configuration - // The Amazon EC2 key pair that is used for instances launched in the compute + // The Amazon EC2 key pair that's used for instances launched in the compute // environment. You can use this key pair to log in to your instances with SSH. // This parameter isn't applicable to jobs running on Fargate resources, and // shouldn't be specified. @@ -274,15 +294,18 @@ type ComputeResource struct { // Fargate resources, and shouldn't be specified. InstanceRole *string - // The instances types that may be launched. You can specify instance families to + // The instances types that can be launched. You can specify instance families to // launch any instance type within those families (for example, c5 or p3), or you // can specify specific sizes within a family (such as c5.8xlarge). You can also - // choose optimal to select instance types (from the C, M, and R instance families) - // on the fly that match the demand of your job queues. This parameter isn't - // applicable to jobs running on Fargate resources, and shouldn't be specified. - // When you create a compute environment, the instance types that you select for - // the compute environment must share the same architecture. For example, you can't - // mix x86 and ARM instances in the same compute environment. + // choose optimal to select instance types (from the C4, M4, and R4 instance + // families) on the fly that match the demand of your job queues. This parameter + // isn't applicable to jobs running on Fargate resources, and shouldn't be + // specified. When you create a compute environment, the instance types that you + // select for the compute environment must share the same architecture. For + // example, you can't mix x86 and ARM instances in the same compute environment. + // Currently, optimal uses instance types from the C4, M4, and R4 instance + // families. In Regions that don't have instance types from those instance + // families, instance types from the C5, M5. and R5 instance families are used. InstanceTypes []string // The launch template to use for your compute resources. Any other compute @@ -338,18 +361,21 @@ type ComputeResource struct { // Key-value pair tags to be applied to EC2 resources that are launched in the // compute environment. For AWS Batch, these take the form of "String1": "String2", - // where String1 is the tag key and String2 is the tag value—for example, { "Name": + // where String1 is the tag key and String2 is the tag value−for example, { "Name": // "AWS Batch Instance - C4OnDemand" }. This is helpful for recognizing your AWS - // Batch instances in the Amazon EC2 console. These tags can not be updated or + // Batch instances in the Amazon EC2 console. These tags can't be updated or // removed after the compute environment has been created; any changes require // creating a new compute environment and removing the old compute environment. // These tags are not seen when using the AWS Batch ListTagsForResource API - // operation. + // operation. This parameter isn't applicable to jobs running on Fargate resources, + // and shouldn't be specified. Tags map[string]string } // An object representing the attributes of a compute environment that can be -// updated. +// updated. For more information, see Compute Environments +// (https://docs.aws.amazon.com/batch/latest/userguide/compute_environments.html) +// in the AWS Batch User Guide. type ComputeResourceUpdate struct { // The desired number of Amazon EC2 vCPUS in the compute environment. This @@ -357,19 +383,24 @@ type ComputeResourceUpdate struct { // be specified. DesiredvCpus int32 - // The maximum number of Amazon EC2 vCPUs that an environment can reach. + // The maximum number of Amazon EC2 vCPUs that an environment can reach. With both + // BEST_FIT_PROGRESSIVE and SPOT_CAPACITY_OPTIMIZED allocation strategies, AWS + // Batch might need to go above maxvCpus to meet your capacity requirements. In + // this event, AWS Batch will never go above maxvCpus by more than a single + // instance (e.g., no more than a single instance from among those specified in + // your compute environment). MaxvCpus int32 // The minimum number of Amazon EC2 vCPUs that an environment should maintain. This - // parameter isnt applicable to jobs running on Fargate resources, and shouldn't be - // specified. + // parameter isn't applicable to jobs running on Fargate resources, and shouldn't + // be specified. MinvCpus int32 // The Amazon EC2 security groups associated with instances launched in the compute // environment. This parameter is required for Fargate compute resources, where it // can contain up to 5 security groups. This can't be specified for EC2 compute // resources. Providing an empty list is handled as if this parameter wasn't - // specified and no changeis made. + // specified and no change is made. SecurityGroupIds []string // The VPC subnets that the compute resources are launched into. This parameter is @@ -382,10 +413,10 @@ type ComputeResourceUpdate struct { Subnets []string } -// An object representing the details of a container that is part of a job. +// An object representing the details of a container that's part of a job. type ContainerDetail struct { - // The command that is passed to the container. + // The command that's passed to the container. Command []string // The Amazon Resource Name (ARN) of the container instance that the container is @@ -440,7 +471,7 @@ type ContainerDetail struct { // (https://docs.docker.com/engine/admin/logging/overview/) in the Docker // documentation. AWS Batch currently supports a subset of the logging drivers // available to the Docker daemon (shown in the LogConfiguration data type). - // Additional log drivers may be available in future releases of the Amazon ECS + // Additional log drivers might be available in future releases of the Amazon ECS // container agent. This parameter requires version 1.18 of the Docker Remote API // or greater on your container instance. To check the Docker Remote API version on // your container instance, log into your container instance and run the following @@ -502,9 +533,9 @@ type ContainerDetail struct { // in the AWS Batch User Guide. Secrets []Secret - // The Amazon Resource Name (ARN) of the Amazon ECS task that is associated with - // the container job. Each container attempt receives a task ARN when they reach - // the STARTING status. + // The Amazon Resource Name (ARN) of the Amazon ECS task that's associated with the + // container job. Each container attempt receives a task ARN when they reach the + // STARTING status. TaskArn *string // A list of ulimit values to set in the container. This parameter maps to Ulimits @@ -592,11 +623,11 @@ type ContainerOverrides struct { Vcpus int32 } -// Container properties are used in job definitions to describe the container that -// is launched as part of a job. +// Container properties are used in job definitions to describe the container +// that's launched as part of a job. type ContainerProperties struct { - // The command that is passed to the container. This parameter maps to Cmd in the + // The command that's passed to the container. This parameter maps to Cmd in the // Create a container // (https://docs.docker.com/engine/api/v1.23/#create-a-container) section of the // Docker Remote API (https://docs.docker.com/engine/api/v1.23/) and the COMMAND @@ -843,7 +874,7 @@ type Ec2Configuration struct { // for all GPU instance families (for example P4 and G4) and can be used for all // non-AWS Graviton-based instance types. ECS_AL1 Amazon Linux // (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ecs-optimized_AMI.html#alami)−Default - // for all non-GPU, non-AWS-Graviton instance families. Amazon Linux is reaching + // for all non-GPU, non-AWS Graviton instance families. Amazon Linux is reaching // the end-of-life of standard support. For more information, see Amazon Linux AMI // (http://aws.amazon.com/amazon-linux-ami/). // @@ -906,7 +937,7 @@ type FargatePlatformConfiguration struct { // the containers associated with it stop running. type Host struct { - // The path on the host container instance that is presented to the container. If + // The path on the host container instance that's presented to the container. If // this parameter is empty, then the Docker daemon has assigned a host path for // you. If this parameter contains a file location, then the data volume persists // at the specified location on the host container instance until you delete it @@ -1002,7 +1033,7 @@ type JobDependency struct { // An object representing an AWS Batch job. type JobDetail struct { - // The job definition that is used by this job. + // The job definition that's used by this job. // // This member is required. JobDefinition *string @@ -1029,7 +1060,7 @@ type JobDetail struct { // This member is required. StartedAt int64 - // The current status for the job. If your jobs do not progress to STARTING, see + // The current status for the job. If your jobs don't progress to STARTING, see // Jobs Stuck in RUNNABLE Status // (https://docs.aws.amazon.com/batch/latest/userguide/troubleshooting.html#job_stuck_in_runnable) // in the troubleshooting section of the AWS Batch User Guide. @@ -1059,8 +1090,8 @@ type JobDetail struct { // The Amazon Resource Name (ARN) of the job. JobArn *string - // An object representing the details of a node that is associated with a - // multi-node parallel job. + // An object representing the details of a node that's associated with a multi-node + // parallel job. NodeDetails *NodeDetails // An object representing the node properties of a multi-node parallel job. This @@ -1123,7 +1154,13 @@ type JobQueueDetail struct { // This member is required. JobQueueName *string - // The priority of the job queue. + // The priority of the job queue. Job queues with a higher priority (or a higher + // integer value for the priority parameter) are evaluated first when associated + // with the same compute environment. Priority is determined in descending order, + // for example, a job queue with a priority value of 10 is given scheduling + // preference over a job queue with a priority value of 1. All of the compute + // environments must be either EC2 (EC2 or SPOT) or Fargate (FARGATE or + // FARGATE_SPOT); EC2 and Fargate compute environments cannot be mixed. // // This member is required. Priority int32 @@ -1142,7 +1179,10 @@ type JobQueueDetail struct { // status of the job queue. StatusReason *string - // The tags applied to the job queue. + // The tags applied to the job queue. For more information, see Tagging your AWS + // Batch resources + // (https://docs.aws.amazon.com/batch/latest/userguide/using-tags.html) in AWS + // Batch User Guide. Tags map[string]string } @@ -1162,7 +1202,7 @@ type JobSummary struct { // The array properties of the job, if it is an array job. ArrayProperties *ArrayPropertiesSummary - // An object representing the details of the container that is associated with the + // An object representing the details of the container that's associated with the // job. Container *ContainerSummary @@ -1283,10 +1323,32 @@ type LinuxParameters struct { // swappiness value of 100 causes pages to be swapped very aggressively. Accepted // values are whole numbers between 0 and 100. If the swappiness parameter isn't // specified, a default value of 60 is used. If a value isn't specified for maxSwap - // then this parameter is ignored. This parameter maps to the --memory-swappiness - // option to docker run (https://docs.docker.com/engine/reference/run/). This - // parameter isn't applicable to jobs running on Fargate resources and shouldn't be - // provided. + // then this parameter is ignored. If maxSwap is set to 0, the container doesn't + // use swap. This parameter maps to the --memory-swappiness option to docker run + // (https://docs.docker.com/engine/reference/run/). Consider the following when you + // use a per-container swap configuration. + // + // * Swap space must be enabled and + // allocated on the container instance for the containers to use. The Amazon ECS + // optimized AMIs don't have swap enabled by default. You must enable swap on the + // instance to use this feature. For more information, see Instance Store Swap + // Volumes + // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-store-swap-volumes.html) + // in the Amazon EC2 User Guide for Linux Instances or How do I allocate memory to + // work as swap space in an Amazon EC2 instance by using a swap file? + // (http://aws.amazon.com/premiumsupport/knowledge-center/ec2-memory-swap-file/) + // + // * + // The swap space parameters are only supported for job definitions using EC2 + // resources. + // + // * If the maxSwap and swappiness parameters are omitted from a job + // definition, each container will have a default swappiness value of 60 and the + // total swap usage will be limited to two times the memory reservation of the + // container. + // + // This parameter isn't applicable to jobs running on Fargate resources + // and shouldn't be provided. Swappiness int32 // The container path, mount options, and size (in MiB) of the tmpfs mount. This @@ -1327,9 +1389,9 @@ type LogConfiguration struct { // documentation. syslog Specifies the syslog logging driver. For more information, // including usage and options, see Syslog logging driver // (https://docs.docker.com/config/containers/logging/syslog/) in the Docker - // documentation. If you have a custom driver that isn't listed earlier that you + // documentation. If you have a custom driver that'sn't listed earlier that you // want to work with the Amazon ECS container agent, you can fork the Amazon ECS - // container agent project that is available on GitHub + // container agent project that's available on GitHub // (https://github.com/aws/amazon-ecs-agent) and customize it to work with that // driver. We encourage you to submit pull requests for changes that you want to // have included. However, Amazon Web Services doesn't currently support running @@ -1355,7 +1417,7 @@ type LogConfiguration struct { SecretOptions []Secret } -// Details on a Docker volume mount point that is used in a job's container +// Details on a Docker volume mount point that's used in a job's container // properties. This parameter maps to Volumes in the Create a container // (https://docs.docker.com/engine/reference/api/docker_remote_api_v1.19/#create-a-container) // section of the Docker Remote API and the --volume option to docker run. @@ -1413,7 +1475,7 @@ type NodeDetails struct { NodeIndex int32 } -// Object representing any node overrides to a job definition that is used in a +// Object representing any node overrides to a job definition that's used in a // SubmitJob API operation. This isn't applicable to jobs running on Fargate // resources and shouldn't be provided; use containerOverrides instead. type NodeOverrides struct { @@ -1458,7 +1520,7 @@ type NodeProperties struct { NumNodes int32 } -// An object representing the properties of a node that is associated with a +// An object representing the properties of a node that's associated with a // multi-node parallel job. type NodePropertiesSummary struct { @@ -1475,7 +1537,7 @@ type NodePropertiesSummary struct { NumNodes int32 } -// Object representing any node overrides to a job definition that is used in a +// Object representing any node overrides to a job definition that's used in a // SubmitJob API operation. type NodePropertyOverride struct { @@ -1500,7 +1562,7 @@ type NodeRangeProperty struct { // index values of 0 through 3. If the starting range value is omitted (:n), then 0 // is used to start the range. If the ending range value is omitted (n:), then the // highest possible node index is used to end the range. Your accumulative node - // ranges must account for all nodes (0:n). You may nest node ranges, for example + // ranges must account for all nodes (0:n). You can nest node ranges, for example // 0:10 and 4:5, in which case the 4:5 range properties override the 0:10 // properties. // @@ -1539,34 +1601,35 @@ type ResourceRequirement struct { // Create a container // (https://docs.docker.com/engine/api/v1.23/#create-a-container) section of the // Docker Remote API (https://docs.docker.com/engine/api/v1.23/) and the --memory - // option to docker run (https://docs.docker.com/engine/reference/run/). You must - // specify at least 4 MiB of memory for a job. If you're trying to maximize your - // resource utilization by providing your jobs as much memory as possible for a - // particular instance type, see Memory Management + // option to docker run (https://docs.docker.com/engine/reference/run/). If you're + // trying to maximize your resource utilization by providing your jobs as much + // memory as possible for a particular instance type, see Memory Management // (https://docs.aws.amazon.com/batch/latest/userguide/memory-management.html) in // the AWS Batch User Guide. For jobs running on Fargate resources, then value is - // the hard limit (in GiB), represented in decimal form, and must match one of the - // supported values (0.5 and whole numbers between 1 and 30, inclusive) and the - // VCPU values must be one of the values supported for that memory value. value = - // 0.5 VCPU = 0.25 value = 1 VCPU = 0.25 or 0.5 value = 2 VCPU = 0.25, 0.5, or 1 - // value = 3 VCPU = 0.5, or 1 value = 4 VCPU = 0.5, 1, or 2 value = 5, 6, or 7 VCPU - // = 1 or 2 value = 8 VCPU = 1, 2, or 4 value = 9, 10, 11, 12, 13, 14, 15, or 16 - // VCPU = 2 or 4 value = 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, or 30 - // VCPU = 4 type="VCPU" The number of vCPUs reserved for the container. This + // the hard limit (in MiB), and must match one of the supported values and the VCPU + // values must be one of the values supported for that memory value. value = 512 + // VCPU = 0.25 value = 1024 VCPU = 0.25 or 0.5 value = 2048 VCPU = 0.25, 0.5, or 1 + // value = 3072 VCPU = 0.5, or 1 value = 4096 VCPU = 0.5, 1, or 2 value = 5120, + // 6144, or 7168 VCPU = 1 or 2 value = 8192 VCPU = 1, 2, or 4 value = 9216, 10240, + // 11264, 12288, 13312, 14336, 15360, or 16384 VCPU = 2 or 4 value = 17408, 18432, + // 19456, 20480, 21504, 22528, 23552, 24576, 25600, 26624, 27648, 28672, 29696, or + // 30720 VCPU = 4 type="VCPU" The number of vCPUs reserved for the container. This // parameter maps to CpuShares in the Create a container // (https://docs.docker.com/engine/api/v1.23/#create-a-container) section of the // Docker Remote API (https://docs.docker.com/engine/api/v1.23/) and the // --cpu-shares option to docker run // (https://docs.docker.com/engine/reference/run/). Each vCPU is equivalent to - // 1,024 CPU shares. You must specify at least one vCPU. This is required but can - // be specified in several places; it must be specified for each node at least - // once. For jobs running on Fargate resources, then value must match one of the - // supported values and the MEMORY values must be one of the values supported for - // that VCPU value. The supported values are 0.25, 0.5, 1, 2, and 4 value = 0.25 - // MEMORY = 0.5, 1, or 2 value = 0.5 MEMORY = 1, 2, 3, or 4 value = 1 MEMORY = 2, - // 3, 4, 5, 6, 7, or 8 value = 2 MEMORY = 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - // or 16 value = 4 MEMORY = 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - // 22, 23, 24, 25, 26, 27, 28, 29, or 30 + // 1,024 CPU shares. For EC2 resources, you must specify at least one vCPU. This is + // required but can be specified in several places; it must be specified for each + // node at least once. For jobs running on Fargate resources, then value must match + // one of the supported values and the MEMORY values must be one of the values + // supported for that VCPU value. The supported values are 0.25, 0.5, 1, 2, and 4 + // value = 0.25 MEMORY = 512, 1024, or 2048 value = 0.5 MEMORY = 1024, 2048, 3072, + // or 4096 value = 1 MEMORY = 2048, 3072, 4096, 5120, 6144, 7168, or 8192 value = 2 + // MEMORY = 4096, 5120, 6144, 7168, 8192, 9216, 10240, 11264, 12288, 13312, 14336, + // 15360, or 16384 value = 4 MEMORY = 8192, 9216, 10240, 11264, 12288, 13312, + // 14336, 15360, 16384, 17408, 18432, 19456, 20480, 21504, 22528, 23552, 24576, + // 25600, 26624, 27648, 28672, 29696, or 30720 // // This member is required. Value *string @@ -1578,7 +1641,7 @@ type ResourceRequirement struct { // Batch User Guide. type RetryStrategy struct { - // The number of times to move a job to the RUNNABLE status. You may specify + // The number of times to move a job to the RUNNABLE status. You can specify // between 1 and 10 attempts. If the value of attempts is greater than one, the job // is retried on failure the same number of attempts as the value. Attempts int32 diff --git a/service/cloudformation/types/enums.go b/service/cloudformation/types/enums.go index f855b3e9fb8..a54f47b9959 100644 --- a/service/cloudformation/types/enums.go +++ b/service/cloudformation/types/enums.go @@ -4,6 +4,13 @@ package types type AccountGateStatus string +// Enum values for AccountGateStatus +const ( + AccountGateStatusSucceeded AccountGateStatus = "SUCCEEDED" + AccountGateStatusFailed AccountGateStatus = "FAILED" + AccountGateStatusSkipped AccountGateStatus = "SKIPPED" +) + // Values returns all known values for AccountGateStatus. 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. @@ -151,6 +158,12 @@ func (ChangeType) Values() []ChangeType { type DeprecatedStatus string +// Enum values for DeprecatedStatus +const ( + DeprecatedStatusLive DeprecatedStatus = "LIVE" + DeprecatedStatusDeprecated DeprecatedStatus = "DEPRECATED" +) + // Values returns all known values for DeprecatedStatus. 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. @@ -311,6 +324,12 @@ func (OperationStatus) Values() []OperationStatus { type PermissionModels string +// Enum values for PermissionModels +const ( + PermissionModelsServiceManaged PermissionModels = "SERVICE_MANAGED" + PermissionModelsSelfManaged PermissionModels = "SELF_MANAGED" +) + // Values returns all known values for PermissionModels. 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. @@ -323,6 +342,13 @@ func (PermissionModels) Values() []PermissionModels { type ProvisioningType string +// Enum values for ProvisioningType +const ( + ProvisioningTypeNonProvisionable ProvisioningType = "NON_PROVISIONABLE" + ProvisioningTypeImmutable ProvisioningType = "IMMUTABLE" + ProvisioningTypeFullyMutable ProvisioningType = "FULLY_MUTABLE" +) + // Values returns all known values for ProvisioningType. 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. @@ -336,6 +362,13 @@ func (ProvisioningType) Values() []ProvisioningType { type RegistrationStatus string +// Enum values for RegistrationStatus +const ( + RegistrationStatusComplete RegistrationStatus = "COMPLETE" + RegistrationStatusInProgress RegistrationStatus = "IN_PROGRESS" + RegistrationStatusFailed RegistrationStatus = "FAILED" +) + // Values returns all known values for RegistrationStatus. Note that this can be // expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. @@ -349,6 +382,12 @@ func (RegistrationStatus) Values() []RegistrationStatus { type RegistryType string +// Enum values for RegistryType +const ( + RegistryTypeResource RegistryType = "RESOURCE" + RegistryTypeModule RegistryType = "MODULE" +) + // Values returns all known values for RegistryType. 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. @@ -533,6 +572,16 @@ func (StackDriftStatus) Values() []StackDriftStatus { type StackInstanceDetailedStatus string +// Enum values for StackInstanceDetailedStatus +const ( + StackInstanceDetailedStatusPending StackInstanceDetailedStatus = "PENDING" + StackInstanceDetailedStatusRunning StackInstanceDetailedStatus = "RUNNING" + StackInstanceDetailedStatusSucceeded StackInstanceDetailedStatus = "SUCCEEDED" + StackInstanceDetailedStatusFailed StackInstanceDetailedStatus = "FAILED" + StackInstanceDetailedStatusCancelled StackInstanceDetailedStatus = "CANCELLED" + StackInstanceDetailedStatusInoperable StackInstanceDetailedStatus = "INOPERABLE" +) + // Values returns all known values for StackInstanceDetailedStatus. 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. @@ -549,6 +598,11 @@ func (StackInstanceDetailedStatus) Values() []StackInstanceDetailedStatus { type StackInstanceFilterName string +// Enum values for StackInstanceFilterName +const ( + StackInstanceFilterNameDetailedStatus StackInstanceFilterName = "DETAILED_STATUS" +) + // Values returns all known values for StackInstanceFilterName. 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. @@ -560,6 +614,13 @@ func (StackInstanceFilterName) Values() []StackInstanceFilterName { type StackInstanceStatus string +// Enum values for StackInstanceStatus +const ( + StackInstanceStatusCurrent StackInstanceStatus = "CURRENT" + StackInstanceStatusOutdated StackInstanceStatus = "OUTDATED" + StackInstanceStatusInoperable StackInstanceStatus = "INOPERABLE" +) + // Values returns all known values for StackInstanceStatus. 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. @@ -639,6 +700,14 @@ func (StackSetDriftStatus) Values() []StackSetDriftStatus { type StackSetOperationAction string +// Enum values for StackSetOperationAction +const ( + StackSetOperationActionCreate StackSetOperationAction = "CREATE" + StackSetOperationActionUpdate StackSetOperationAction = "UPDATE" + StackSetOperationActionDelete StackSetOperationAction = "DELETE" + StackSetOperationActionDetectDrift StackSetOperationAction = "DETECT_DRIFT" +) + // Values returns all known values for StackSetOperationAction. 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. @@ -653,6 +722,15 @@ func (StackSetOperationAction) Values() []StackSetOperationAction { type StackSetOperationResultStatus string +// Enum values for StackSetOperationResultStatus +const ( + StackSetOperationResultStatusPending StackSetOperationResultStatus = "PENDING" + StackSetOperationResultStatusRunning StackSetOperationResultStatus = "RUNNING" + StackSetOperationResultStatusSucceeded StackSetOperationResultStatus = "SUCCEEDED" + StackSetOperationResultStatusFailed StackSetOperationResultStatus = "FAILED" + StackSetOperationResultStatusCancelled StackSetOperationResultStatus = "CANCELLED" +) + // Values returns all known values for StackSetOperationResultStatus. 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 @@ -669,6 +747,16 @@ func (StackSetOperationResultStatus) Values() []StackSetOperationResultStatus { type StackSetOperationStatus string +// Enum values for StackSetOperationStatus +const ( + StackSetOperationStatusRunning StackSetOperationStatus = "RUNNING" + StackSetOperationStatusSucceeded StackSetOperationStatus = "SUCCEEDED" + StackSetOperationStatusFailed StackSetOperationStatus = "FAILED" + StackSetOperationStatusStopping StackSetOperationStatus = "STOPPING" + StackSetOperationStatusStopped StackSetOperationStatus = "STOPPED" + StackSetOperationStatusQueued StackSetOperationStatus = "QUEUED" +) + // Values returns all known values for StackSetOperationStatus. 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. @@ -685,6 +773,12 @@ func (StackSetOperationStatus) Values() []StackSetOperationStatus { type StackSetStatus string +// Enum values for StackSetStatus +const ( + StackSetStatusActive StackSetStatus = "ACTIVE" + StackSetStatusDeleted StackSetStatus = "DELETED" +) + // Values returns all known values for StackSetStatus. 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. @@ -773,6 +867,12 @@ func (TemplateStage) Values() []TemplateStage { type Visibility string +// Enum values for Visibility +const ( + VisibilityPublic Visibility = "PUBLIC" + VisibilityPrivate Visibility = "PRIVATE" +) + // Values returns all known values for Visibility. 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. diff --git a/service/cloudfront/types/enums.go b/service/cloudfront/types/enums.go index 9c31dad3a1c..95137e7a8a8 100644 --- a/service/cloudfront/types/enums.go +++ b/service/cloudfront/types/enums.go @@ -4,6 +4,14 @@ package types type CachePolicyCookieBehavior string +// Enum values for CachePolicyCookieBehavior +const ( + CachePolicyCookieBehaviorNone CachePolicyCookieBehavior = "none" + CachePolicyCookieBehaviorWhitelist CachePolicyCookieBehavior = "whitelist" + CachePolicyCookieBehaviorAllexcept CachePolicyCookieBehavior = "allExcept" + CachePolicyCookieBehaviorAll CachePolicyCookieBehavior = "all" +) + // Values returns all known values for CachePolicyCookieBehavior. 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. @@ -18,6 +26,12 @@ func (CachePolicyCookieBehavior) Values() []CachePolicyCookieBehavior { type CachePolicyHeaderBehavior string +// Enum values for CachePolicyHeaderBehavior +const ( + CachePolicyHeaderBehaviorNone CachePolicyHeaderBehavior = "none" + CachePolicyHeaderBehaviorWhitelist CachePolicyHeaderBehavior = "whitelist" +) + // Values returns all known values for CachePolicyHeaderBehavior. 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. @@ -30,6 +44,14 @@ func (CachePolicyHeaderBehavior) Values() []CachePolicyHeaderBehavior { type CachePolicyQueryStringBehavior string +// Enum values for CachePolicyQueryStringBehavior +const ( + CachePolicyQueryStringBehaviorNone CachePolicyQueryStringBehavior = "none" + CachePolicyQueryStringBehaviorWhitelist CachePolicyQueryStringBehavior = "whitelist" + CachePolicyQueryStringBehaviorAllexcept CachePolicyQueryStringBehavior = "allExcept" + CachePolicyQueryStringBehaviorAll CachePolicyQueryStringBehavior = "all" +) + // Values returns all known values for CachePolicyQueryStringBehavior. 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 @@ -45,6 +67,12 @@ func (CachePolicyQueryStringBehavior) Values() []CachePolicyQueryStringBehavior type CachePolicyType string +// Enum values for CachePolicyType +const ( + CachePolicyTypeManaged CachePolicyType = "managed" + CachePolicyTypeCustom CachePolicyType = "custom" +) + // Values returns all known values for CachePolicyType. 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. @@ -57,6 +85,13 @@ func (CachePolicyType) Values() []CachePolicyType { type CertificateSource string +// Enum values for CertificateSource +const ( + CertificateSourceCloudfront CertificateSource = "cloudfront" + CertificateSourceIam CertificateSource = "iam" + CertificateSourceAcm CertificateSource = "acm" +) + // Values returns all known values for CertificateSource. 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. @@ -70,6 +105,14 @@ func (CertificateSource) Values() []CertificateSource { type EventType string +// Enum values for EventType +const ( + EventTypeViewerRequest EventType = "viewer-request" + EventTypeViewerResponse EventType = "viewer-response" + EventTypeOriginRequest EventType = "origin-request" + EventTypeOriginResponse EventType = "origin-response" +) + // Values returns all known values for EventType. Note that this can be expanded in // the future, and so it is only as up to date as the client. The ordering of this // slice is not guaranteed to be stable across updates. @@ -84,6 +127,11 @@ func (EventType) Values() []EventType { type Format string +// Enum values for Format +const ( + FormatUrlencoded Format = "URLEncoded" +) + // Values returns all known values for Format. 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. @@ -95,6 +143,13 @@ func (Format) Values() []Format { type GeoRestrictionType string +// Enum values for GeoRestrictionType +const ( + GeoRestrictionTypeBlacklist GeoRestrictionType = "blacklist" + GeoRestrictionTypeWhitelist GeoRestrictionType = "whitelist" + GeoRestrictionTypeNone GeoRestrictionType = "none" +) + // Values returns all known values for GeoRestrictionType. 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. @@ -108,6 +163,12 @@ func (GeoRestrictionType) Values() []GeoRestrictionType { type HttpVersion string +// Enum values for HttpVersion +const ( + HttpVersionHttp11 HttpVersion = "http1.1" + HttpVersionHttp2 HttpVersion = "http2" +) + // Values returns all known values for HttpVersion. 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. @@ -120,6 +181,13 @@ func (HttpVersion) Values() []HttpVersion { type ICPRecordalStatus string +// Enum values for ICPRecordalStatus +const ( + ICPRecordalStatusApproved ICPRecordalStatus = "APPROVED" + ICPRecordalStatusSuspended ICPRecordalStatus = "SUSPENDED" + ICPRecordalStatusPending ICPRecordalStatus = "PENDING" +) + // Values returns all known values for ICPRecordalStatus. 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. @@ -133,6 +201,13 @@ func (ICPRecordalStatus) Values() []ICPRecordalStatus { type ItemSelection string +// Enum values for ItemSelection +const ( + ItemSelectionNone ItemSelection = "none" + ItemSelectionWhitelist ItemSelection = "whitelist" + ItemSelectionAll ItemSelection = "all" +) + // Values returns all known values for ItemSelection. 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. @@ -146,6 +221,17 @@ func (ItemSelection) Values() []ItemSelection { type Method string +// Enum values for Method +const ( + MethodGet Method = "GET" + MethodHead Method = "HEAD" + MethodPost Method = "POST" + MethodPut Method = "PUT" + MethodPatch Method = "PATCH" + MethodOptions Method = "OPTIONS" + MethodDelete Method = "DELETE" +) + // Values returns all known values for Method. 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. @@ -163,6 +249,16 @@ func (Method) Values() []Method { type MinimumProtocolVersion string +// Enum values for MinimumProtocolVersion +const ( + MinimumProtocolVersionSslv3 MinimumProtocolVersion = "SSLv3" + MinimumProtocolVersionTlsv1 MinimumProtocolVersion = "TLSv1" + MinimumProtocolVersionTlsv12016 MinimumProtocolVersion = "TLSv1_2016" + MinimumProtocolVersionTlsv112016 MinimumProtocolVersion = "TLSv1.1_2016" + MinimumProtocolVersionTlsv122018 MinimumProtocolVersion = "TLSv1.2_2018" + MinimumProtocolVersionTlsv122019 MinimumProtocolVersion = "TLSv1.2_2019" +) + // Values returns all known values for MinimumProtocolVersion. 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. @@ -179,6 +275,13 @@ func (MinimumProtocolVersion) Values() []MinimumProtocolVersion { type OriginProtocolPolicy string +// Enum values for OriginProtocolPolicy +const ( + OriginProtocolPolicyHttpOnly OriginProtocolPolicy = "http-only" + OriginProtocolPolicyMatchViewer OriginProtocolPolicy = "match-viewer" + OriginProtocolPolicyHttpsOnly OriginProtocolPolicy = "https-only" +) + // Values returns all known values for OriginProtocolPolicy. 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. @@ -192,6 +295,13 @@ func (OriginProtocolPolicy) Values() []OriginProtocolPolicy { type OriginRequestPolicyCookieBehavior string +// Enum values for OriginRequestPolicyCookieBehavior +const ( + OriginRequestPolicyCookieBehaviorNone OriginRequestPolicyCookieBehavior = "none" + OriginRequestPolicyCookieBehaviorWhitelist OriginRequestPolicyCookieBehavior = "whitelist" + OriginRequestPolicyCookieBehaviorAll OriginRequestPolicyCookieBehavior = "all" +) + // Values returns all known values for OriginRequestPolicyCookieBehavior. 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 @@ -206,6 +316,14 @@ func (OriginRequestPolicyCookieBehavior) Values() []OriginRequestPolicyCookieBeh type OriginRequestPolicyHeaderBehavior string +// Enum values for OriginRequestPolicyHeaderBehavior +const ( + OriginRequestPolicyHeaderBehaviorNone OriginRequestPolicyHeaderBehavior = "none" + OriginRequestPolicyHeaderBehaviorWhitelist OriginRequestPolicyHeaderBehavior = "whitelist" + OriginRequestPolicyHeaderBehaviorAllviewer OriginRequestPolicyHeaderBehavior = "allViewer" + OriginRequestPolicyHeaderBehaviorAllviewerandwhitelistcloudfront OriginRequestPolicyHeaderBehavior = "allViewerAndWhitelistCloudFront" +) + // Values returns all known values for OriginRequestPolicyHeaderBehavior. 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 @@ -221,6 +339,13 @@ func (OriginRequestPolicyHeaderBehavior) Values() []OriginRequestPolicyHeaderBeh type OriginRequestPolicyQueryStringBehavior string +// Enum values for OriginRequestPolicyQueryStringBehavior +const ( + OriginRequestPolicyQueryStringBehaviorNone OriginRequestPolicyQueryStringBehavior = "none" + OriginRequestPolicyQueryStringBehaviorWhitelist OriginRequestPolicyQueryStringBehavior = "whitelist" + OriginRequestPolicyQueryStringBehaviorAll OriginRequestPolicyQueryStringBehavior = "all" +) + // Values returns all known values for OriginRequestPolicyQueryStringBehavior. 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 @@ -235,6 +360,12 @@ func (OriginRequestPolicyQueryStringBehavior) Values() []OriginRequestPolicyQuer type OriginRequestPolicyType string +// Enum values for OriginRequestPolicyType +const ( + OriginRequestPolicyTypeManaged OriginRequestPolicyType = "managed" + OriginRequestPolicyTypeCustom OriginRequestPolicyType = "custom" +) + // Values returns all known values for OriginRequestPolicyType. 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. @@ -247,6 +378,13 @@ func (OriginRequestPolicyType) Values() []OriginRequestPolicyType { type PriceClass string +// Enum values for PriceClass +const ( + PriceClassPriceclass100 PriceClass = "PriceClass_100" + PriceClassPriceclass200 PriceClass = "PriceClass_200" + PriceClassPriceclassAll PriceClass = "PriceClass_All" +) + // Values returns all known values for PriceClass. 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. @@ -279,6 +417,14 @@ func (RealtimeMetricsSubscriptionStatus) Values() []RealtimeMetricsSubscriptionS type SslProtocol string +// Enum values for SslProtocol +const ( + SslProtocolSslv3 SslProtocol = "SSLv3" + SslProtocolTlsv1 SslProtocol = "TLSv1" + SslProtocolTlsv11 SslProtocol = "TLSv1.1" + SslProtocolTlsv12 SslProtocol = "TLSv1.2" +) + // Values returns all known values for SslProtocol. 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. @@ -293,6 +439,13 @@ func (SslProtocol) Values() []SslProtocol { type SSLSupportMethod string +// Enum values for SSLSupportMethod +const ( + SSLSupportMethodSniOnly SSLSupportMethod = "sni-only" + SSLSupportMethodVip SSLSupportMethod = "vip" + SSLSupportMethodStaticIp SSLSupportMethod = "static-ip" +) + // Values returns all known values for SSLSupportMethod. 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. @@ -306,6 +459,13 @@ func (SSLSupportMethod) Values() []SSLSupportMethod { type ViewerProtocolPolicy string +// Enum values for ViewerProtocolPolicy +const ( + ViewerProtocolPolicyAllowAll ViewerProtocolPolicy = "allow-all" + ViewerProtocolPolicyHttpsOnly ViewerProtocolPolicy = "https-only" + ViewerProtocolPolicyRedirectToHttps ViewerProtocolPolicy = "redirect-to-https" +) + // Values returns all known values for ViewerProtocolPolicy. 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. diff --git a/service/cloudsearch/types/enums.go b/service/cloudsearch/types/enums.go index 02da7d9c9d9..d2129aace04 100644 --- a/service/cloudsearch/types/enums.go +++ b/service/cloudsearch/types/enums.go @@ -4,6 +4,14 @@ package types type AlgorithmicStemming string +// Enum values for AlgorithmicStemming +const ( + AlgorithmicStemmingNone AlgorithmicStemming = "none" + AlgorithmicStemmingMinimal AlgorithmicStemming = "minimal" + AlgorithmicStemmingLight AlgorithmicStemming = "light" + AlgorithmicStemmingFull AlgorithmicStemming = "full" +) + // Values returns all known values for AlgorithmicStemming. 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. @@ -18,6 +26,45 @@ func (AlgorithmicStemming) Values() []AlgorithmicStemming { type AnalysisSchemeLanguage string +// Enum values for AnalysisSchemeLanguage +const ( + AnalysisSchemeLanguageAr AnalysisSchemeLanguage = "ar" + AnalysisSchemeLanguageBg AnalysisSchemeLanguage = "bg" + AnalysisSchemeLanguageCa AnalysisSchemeLanguage = "ca" + AnalysisSchemeLanguageCs AnalysisSchemeLanguage = "cs" + AnalysisSchemeLanguageDa AnalysisSchemeLanguage = "da" + AnalysisSchemeLanguageDe AnalysisSchemeLanguage = "de" + AnalysisSchemeLanguageEl AnalysisSchemeLanguage = "el" + AnalysisSchemeLanguageEn AnalysisSchemeLanguage = "en" + AnalysisSchemeLanguageEs AnalysisSchemeLanguage = "es" + AnalysisSchemeLanguageEu AnalysisSchemeLanguage = "eu" + AnalysisSchemeLanguageFa AnalysisSchemeLanguage = "fa" + AnalysisSchemeLanguageFi AnalysisSchemeLanguage = "fi" + AnalysisSchemeLanguageFr AnalysisSchemeLanguage = "fr" + AnalysisSchemeLanguageGa AnalysisSchemeLanguage = "ga" + AnalysisSchemeLanguageGl AnalysisSchemeLanguage = "gl" + AnalysisSchemeLanguageHe AnalysisSchemeLanguage = "he" + AnalysisSchemeLanguageHi AnalysisSchemeLanguage = "hi" + AnalysisSchemeLanguageHu AnalysisSchemeLanguage = "hu" + AnalysisSchemeLanguageHy AnalysisSchemeLanguage = "hy" + AnalysisSchemeLanguageId AnalysisSchemeLanguage = "id" + AnalysisSchemeLanguageIt AnalysisSchemeLanguage = "it" + AnalysisSchemeLanguageJa AnalysisSchemeLanguage = "ja" + AnalysisSchemeLanguageKo AnalysisSchemeLanguage = "ko" + AnalysisSchemeLanguageLv AnalysisSchemeLanguage = "lv" + AnalysisSchemeLanguageMul AnalysisSchemeLanguage = "mul" + AnalysisSchemeLanguageNl AnalysisSchemeLanguage = "nl" + AnalysisSchemeLanguageNo AnalysisSchemeLanguage = "no" + AnalysisSchemeLanguagePt AnalysisSchemeLanguage = "pt" + AnalysisSchemeLanguageRo AnalysisSchemeLanguage = "ro" + AnalysisSchemeLanguageRu AnalysisSchemeLanguage = "ru" + AnalysisSchemeLanguageSv AnalysisSchemeLanguage = "sv" + AnalysisSchemeLanguageTh AnalysisSchemeLanguage = "th" + AnalysisSchemeLanguageTr AnalysisSchemeLanguage = "tr" + AnalysisSchemeLanguageZhHans AnalysisSchemeLanguage = "zh-Hans" + AnalysisSchemeLanguageZhHant AnalysisSchemeLanguage = "zh-Hant" +) + // Values returns all known values for AnalysisSchemeLanguage. 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. @@ -63,6 +110,21 @@ func (AnalysisSchemeLanguage) Values() []AnalysisSchemeLanguage { type IndexFieldType string +// Enum values for IndexFieldType +const ( + IndexFieldTypeInt IndexFieldType = "int" + IndexFieldTypeDouble IndexFieldType = "double" + IndexFieldTypeLiteral IndexFieldType = "literal" + IndexFieldTypeText IndexFieldType = "text" + IndexFieldTypeDate IndexFieldType = "date" + IndexFieldTypeLatlon IndexFieldType = "latlon" + IndexFieldTypeIntArray IndexFieldType = "int-array" + IndexFieldTypeDoubleArray IndexFieldType = "double-array" + IndexFieldTypeLiteralArray IndexFieldType = "literal-array" + IndexFieldTypeTextArray IndexFieldType = "text-array" + IndexFieldTypeDateArray IndexFieldType = "date-array" +) + // Values returns all known values for IndexFieldType. 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. @@ -84,6 +146,14 @@ func (IndexFieldType) Values() []IndexFieldType { type OptionState string +// Enum values for OptionState +const ( + OptionStateRequiresindexdocuments OptionState = "RequiresIndexDocuments" + OptionStateProcessing OptionState = "Processing" + OptionStateActive OptionState = "Active" + OptionStateFailedtovalidate OptionState = "FailedToValidate" +) + // Values returns all known values for OptionState. 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. @@ -98,6 +168,18 @@ func (OptionState) Values() []OptionState { type PartitionInstanceType string +// Enum values for PartitionInstanceType +const ( + PartitionInstanceTypeSearchM1Small PartitionInstanceType = "search.m1.small" + PartitionInstanceTypeSearchM1Large PartitionInstanceType = "search.m1.large" + PartitionInstanceTypeSearchM2Xlarge PartitionInstanceType = "search.m2.xlarge" + PartitionInstanceTypeSearchM22xlarge PartitionInstanceType = "search.m2.2xlarge" + PartitionInstanceTypeSearchM3Medium PartitionInstanceType = "search.m3.medium" + PartitionInstanceTypeSearchM3Large PartitionInstanceType = "search.m3.large" + PartitionInstanceTypeSearchM3Xlarge PartitionInstanceType = "search.m3.xlarge" + PartitionInstanceTypeSearchM32xlarge PartitionInstanceType = "search.m3.2xlarge" +) + // Values returns all known values for PartitionInstanceType. 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. @@ -116,6 +198,13 @@ func (PartitionInstanceType) Values() []PartitionInstanceType { type SuggesterFuzzyMatching string +// Enum values for SuggesterFuzzyMatching +const ( + SuggesterFuzzyMatchingNone SuggesterFuzzyMatching = "none" + SuggesterFuzzyMatchingLow SuggesterFuzzyMatching = "low" + SuggesterFuzzyMatchingHigh SuggesterFuzzyMatching = "high" +) + // Values returns all known values for SuggesterFuzzyMatching. 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. diff --git a/service/cloudsearchdomain/types/enums.go b/service/cloudsearchdomain/types/enums.go index e3e9421b377..efdcbb66e75 100644 --- a/service/cloudsearchdomain/types/enums.go +++ b/service/cloudsearchdomain/types/enums.go @@ -4,6 +4,12 @@ package types type ContentType string +// Enum values for ContentType +const ( + ContentTypeApplicationJson ContentType = "application/json" + ContentTypeApplicationXml ContentType = "application/xml" +) + // Values returns all known values for ContentType. 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. @@ -16,6 +22,14 @@ func (ContentType) Values() []ContentType { type QueryParser string +// Enum values for QueryParser +const ( + QueryParserSimple QueryParser = "simple" + QueryParserStructured QueryParser = "structured" + QueryParserLucene QueryParser = "lucene" + QueryParserDismax QueryParser = "dismax" +) + // Values returns all known values for QueryParser. 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. diff --git a/service/cloudwatch/types/enums.go b/service/cloudwatch/types/enums.go index dd380f6f503..5a0fc1c6999 100644 --- a/service/cloudwatch/types/enums.go +++ b/service/cloudwatch/types/enums.go @@ -4,6 +4,12 @@ package types type AlarmType string +// Enum values for AlarmType +const ( + AlarmTypeCompositealarm AlarmType = "CompositeAlarm" + AlarmTypeMetricalarm AlarmType = "MetricAlarm" +) + // Values returns all known values for AlarmType. 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. @@ -16,6 +22,13 @@ func (AlarmType) Values() []AlarmType { type AnomalyDetectorStateValue string +// Enum values for AnomalyDetectorStateValue +const ( + AnomalyDetectorStateValuePendingTraining AnomalyDetectorStateValue = "PENDING_TRAINING" + AnomalyDetectorStateValueTrainedInsufficientData AnomalyDetectorStateValue = "TRAINED_INSUFFICIENT_DATA" + AnomalyDetectorStateValueTrained AnomalyDetectorStateValue = "TRAINED" +) + // Values returns all known values for AnomalyDetectorStateValue. 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. @@ -29,6 +42,17 @@ func (AnomalyDetectorStateValue) Values() []AnomalyDetectorStateValue { type ComparisonOperator string +// Enum values for ComparisonOperator +const ( + ComparisonOperatorGreaterthanorequaltothreshold ComparisonOperator = "GreaterThanOrEqualToThreshold" + ComparisonOperatorGreaterthanthreshold ComparisonOperator = "GreaterThanThreshold" + ComparisonOperatorLessthanthreshold ComparisonOperator = "LessThanThreshold" + ComparisonOperatorLessthanorequaltothreshold ComparisonOperator = "LessThanOrEqualToThreshold" + ComparisonOperatorLessthanlowerorgreaterthanupperthreshold ComparisonOperator = "LessThanLowerOrGreaterThanUpperThreshold" + ComparisonOperatorLessthanlowerthreshold ComparisonOperator = "LessThanLowerThreshold" + ComparisonOperatorGreaterthanupperthreshold ComparisonOperator = "GreaterThanUpperThreshold" +) + // Values returns all known values for ComparisonOperator. 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. @@ -46,6 +70,13 @@ func (ComparisonOperator) Values() []ComparisonOperator { type HistoryItemType string +// Enum values for HistoryItemType +const ( + HistoryItemTypeConfigurationupdate HistoryItemType = "ConfigurationUpdate" + HistoryItemTypeStateupdate HistoryItemType = "StateUpdate" + HistoryItemTypeAction HistoryItemType = "Action" +) + // Values returns all known values for HistoryItemType. 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. @@ -93,6 +124,37 @@ func (ScanBy) Values() []ScanBy { type StandardUnit string +// Enum values for StandardUnit +const ( + StandardUnitSeconds StandardUnit = "Seconds" + StandardUnitMicroseconds StandardUnit = "Microseconds" + StandardUnitMilliseconds StandardUnit = "Milliseconds" + StandardUnitBytes StandardUnit = "Bytes" + StandardUnitKilobytes StandardUnit = "Kilobytes" + StandardUnitMegabytes StandardUnit = "Megabytes" + StandardUnitGigabytes StandardUnit = "Gigabytes" + StandardUnitTerabytes StandardUnit = "Terabytes" + StandardUnitBits StandardUnit = "Bits" + StandardUnitKilobits StandardUnit = "Kilobits" + StandardUnitMegabits StandardUnit = "Megabits" + StandardUnitGigabits StandardUnit = "Gigabits" + StandardUnitTerabits StandardUnit = "Terabits" + StandardUnitPercent StandardUnit = "Percent" + StandardUnitCount StandardUnit = "Count" + StandardUnitBytesSecond StandardUnit = "Bytes/Second" + StandardUnitKilobytesSecond StandardUnit = "Kilobytes/Second" + StandardUnitMegabytesSecond StandardUnit = "Megabytes/Second" + StandardUnitGigabytesSecond StandardUnit = "Gigabytes/Second" + StandardUnitTerabytesSecond StandardUnit = "Terabytes/Second" + StandardUnitBitsSecond StandardUnit = "Bits/Second" + StandardUnitKilobitsSecond StandardUnit = "Kilobits/Second" + StandardUnitMegabitsSecond StandardUnit = "Megabits/Second" + StandardUnitGigabitsSecond StandardUnit = "Gigabits/Second" + StandardUnitTerabitsSecond StandardUnit = "Terabits/Second" + StandardUnitCountSecond StandardUnit = "Count/Second" + StandardUnitNone StandardUnit = "None" +) + // Values returns all known values for StandardUnit. 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. @@ -130,6 +192,13 @@ func (StandardUnit) Values() []StandardUnit { type StateValue string +// Enum values for StateValue +const ( + StateValueOk StateValue = "OK" + StateValueAlarm StateValue = "ALARM" + StateValueInsufficientData StateValue = "INSUFFICIENT_DATA" +) + // Values returns all known values for StateValue. 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. @@ -143,6 +212,15 @@ func (StateValue) Values() []StateValue { type Statistic string +// Enum values for Statistic +const ( + StatisticSamplecount Statistic = "SampleCount" + StatisticAverage Statistic = "Average" + StatisticSum Statistic = "Sum" + StatisticMinimum Statistic = "Minimum" + StatisticMaximum Statistic = "Maximum" +) + // Values returns all known values for Statistic. 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. diff --git a/service/codedeploy/types/enums.go b/service/codedeploy/types/enums.go index c1e858ac3d1..9077774ee36 100644 --- a/service/codedeploy/types/enums.go +++ b/service/codedeploy/types/enums.go @@ -514,6 +514,12 @@ func (ListStateFilterAction) Values() []ListStateFilterAction { type MinimumHealthyHostsType string +// Enum values for MinimumHealthyHostsType +const ( + MinimumHealthyHostsTypeHostCount MinimumHealthyHostsType = "HOST_COUNT" + MinimumHealthyHostsTypeFleetPercent MinimumHealthyHostsType = "FLEET_PERCENT" +) + // Values returns all known values for MinimumHealthyHostsType. 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. diff --git a/service/cognitosync/types/enums.go b/service/cognitosync/types/enums.go index 3b1446339b1..3329e8edb4c 100644 --- a/service/cognitosync/types/enums.go +++ b/service/cognitosync/types/enums.go @@ -26,6 +26,12 @@ func (BulkPublishStatus) Values() []BulkPublishStatus { type Operation string +// Enum values for Operation +const ( + OperationReplace Operation = "replace" + OperationRemove Operation = "remove" +) + // Values returns all known values for Operation. 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. @@ -38,6 +44,14 @@ func (Operation) Values() []Operation { type Platform string +// Enum values for Platform +const ( + PlatformApns Platform = "APNS" + PlatformApnsSandbox Platform = "APNS_SANDBOX" + PlatformGcm Platform = "GCM" + PlatformAdm Platform = "ADM" +) + // Values returns all known values for Platform. 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. @@ -52,6 +66,12 @@ func (Platform) Values() []Platform { type StreamingStatus string +// Enum values for StreamingStatus +const ( + StreamingStatusEnabled StreamingStatus = "ENABLED" + StreamingStatusDisabled StreamingStatus = "DISABLED" +) + // Values returns all known values for StreamingStatus. 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. diff --git a/service/connect/api_op_AssociateApprovedOrigin.go b/service/connect/api_op_AssociateApprovedOrigin.go index 60ad431bb57..bf0145715e1 100644 --- a/service/connect/api_op_AssociateApprovedOrigin.go +++ b/service/connect/api_op_AssociateApprovedOrigin.go @@ -10,6 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This API is in preview release for Amazon Connect and is subject to change. // Associates an approved origin to an Amazon Connect instance. func (c *Client) AssociateApprovedOrigin(ctx context.Context, params *AssociateApprovedOriginInput, optFns ...func(*Options)) (*AssociateApprovedOriginOutput, error) { if params == nil { diff --git a/service/connect/api_op_AssociateInstanceStorageConfig.go b/service/connect/api_op_AssociateInstanceStorageConfig.go index abf60f266ca..bcd78baaba2 100644 --- a/service/connect/api_op_AssociateInstanceStorageConfig.go +++ b/service/connect/api_op_AssociateInstanceStorageConfig.go @@ -11,6 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This API is in preview release for Amazon Connect and is subject to change. // Associates a storage resource type for the first time. You can only associate // one type of storage configuration in a single call. This means, for example, // that you can't define an instance with multiple S3 buckets for storing chat diff --git a/service/connect/api_op_AssociateLambdaFunction.go b/service/connect/api_op_AssociateLambdaFunction.go index 1af21a6075d..47fe96d79d4 100644 --- a/service/connect/api_op_AssociateLambdaFunction.go +++ b/service/connect/api_op_AssociateLambdaFunction.go @@ -10,6 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This API is in preview release for Amazon Connect and is subject to change. // Allows the specified Amazon Connect instance to access the specified Lambda // function. func (c *Client) AssociateLambdaFunction(ctx context.Context, params *AssociateLambdaFunctionInput, optFns ...func(*Options)) (*AssociateLambdaFunctionOutput, error) { diff --git a/service/connect/api_op_AssociateLexBot.go b/service/connect/api_op_AssociateLexBot.go index 6cc80388679..8530d6a28d6 100644 --- a/service/connect/api_op_AssociateLexBot.go +++ b/service/connect/api_op_AssociateLexBot.go @@ -11,6 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This API is in preview release for Amazon Connect and is subject to change. // Allows the specified Amazon Connect instance to access the specified Amazon Lex // bot. func (c *Client) AssociateLexBot(ctx context.Context, params *AssociateLexBotInput, optFns ...func(*Options)) (*AssociateLexBotOutput, error) { diff --git a/service/connect/api_op_AssociateSecurityKey.go b/service/connect/api_op_AssociateSecurityKey.go index 8013dd9c946..d2497039517 100644 --- a/service/connect/api_op_AssociateSecurityKey.go +++ b/service/connect/api_op_AssociateSecurityKey.go @@ -10,6 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This API is in preview release for Amazon Connect and is subject to change. // Associates a security key to the instance. func (c *Client) AssociateSecurityKey(ctx context.Context, params *AssociateSecurityKeyInput, optFns ...func(*Options)) (*AssociateSecurityKeyOutput, error) { if params == nil { diff --git a/service/connect/api_op_CreateIntegrationAssociation.go b/service/connect/api_op_CreateIntegrationAssociation.go index 87de1125c07..69322dd7fbe 100644 --- a/service/connect/api_op_CreateIntegrationAssociation.go +++ b/service/connect/api_op_CreateIntegrationAssociation.go @@ -12,7 +12,7 @@ import ( ) // This API is in preview release for Amazon Connect and is subject to change. -// Create an AppIntegration association with anAmazon Connect instance. +// Create an AppIntegration association with an Amazon Connect instance. func (c *Client) CreateIntegrationAssociation(ctx context.Context, params *CreateIntegrationAssociationInput, optFns ...func(*Options)) (*CreateIntegrationAssociationOutput, error) { if params == nil { params = &CreateIntegrationAssociationInput{} diff --git a/service/connect/api_op_CreateQuickConnect.go b/service/connect/api_op_CreateQuickConnect.go new file mode 100644 index 00000000000..f1982ad9841 --- /dev/null +++ b/service/connect/api_op_CreateQuickConnect.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +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/connect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// This API is in preview release for Amazon Connect and is subject to change. +// Creates a quick connect for the specified Amazon Connect instance. +func (c *Client) CreateQuickConnect(ctx context.Context, params *CreateQuickConnectInput, optFns ...func(*Options)) (*CreateQuickConnectOutput, error) { + if params == nil { + params = &CreateQuickConnectInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateQuickConnect", params, optFns, addOperationCreateQuickConnectMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateQuickConnectOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateQuickConnectInput struct { + + // The identifier of the Amazon Connect instance. + // + // This member is required. + InstanceId *string + + // The name of the quick connect. + // + // This member is required. + Name *string + + // Configuration settings for the quick connect. + // + // This member is required. + QuickConnectConfig *types.QuickConnectConfig + + // The description of the quick connect. + Description *string + + // One or more tags. + Tags map[string]string +} + +type CreateQuickConnectOutput struct { + + // The Amazon Resource Name (ARN) for the quick connect. + QuickConnectARN *string + + // The identifier for the quick connect. + QuickConnectId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCreateQuickConnectMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateQuickConnect{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateQuickConnect{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateQuickConnectValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateQuickConnect(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opCreateQuickConnect(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "connect", + OperationName: "CreateQuickConnect", + } +} diff --git a/service/connect/api_op_DeleteQuickConnect.go b/service/connect/api_op_DeleteQuickConnect.go new file mode 100644 index 00000000000..11f5249d845 --- /dev/null +++ b/service/connect/api_op_DeleteQuickConnect.go @@ -0,0 +1,115 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +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" +) + +// This API is in preview release for Amazon Connect and is subject to change. +// Deletes a quick connect. +func (c *Client) DeleteQuickConnect(ctx context.Context, params *DeleteQuickConnectInput, optFns ...func(*Options)) (*DeleteQuickConnectOutput, error) { + if params == nil { + params = &DeleteQuickConnectInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteQuickConnect", params, optFns, addOperationDeleteQuickConnectMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteQuickConnectOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteQuickConnectInput struct { + + // The identifier of the Amazon Connect instance. + // + // This member is required. + InstanceId *string + + // The identifier for the quick connect. + // + // This member is required. + QuickConnectId *string +} + +type DeleteQuickConnectOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteQuickConnectMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteQuickConnect{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteQuickConnect{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteQuickConnectValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteQuickConnect(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDeleteQuickConnect(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "connect", + OperationName: "DeleteQuickConnect", + } +} diff --git a/service/connect/api_op_DescribeInstance.go b/service/connect/api_op_DescribeInstance.go index c028fae4e98..ed0f5359ece 100644 --- a/service/connect/api_op_DescribeInstance.go +++ b/service/connect/api_op_DescribeInstance.go @@ -11,6 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This API is in preview release for Amazon Connect and is subject to change. // Returns the current state of the specified instance identifier. It tracks the // instance while it is being created and returns an error status if applicable. If // an instance is not created successfully, the instance status reason field diff --git a/service/connect/api_op_DescribeInstanceAttribute.go b/service/connect/api_op_DescribeInstanceAttribute.go index c4943fa283b..3cb92a3c209 100644 --- a/service/connect/api_op_DescribeInstanceAttribute.go +++ b/service/connect/api_op_DescribeInstanceAttribute.go @@ -11,6 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This API is in preview release for Amazon Connect and is subject to change. // Describes the specified instance attribute. func (c *Client) DescribeInstanceAttribute(ctx context.Context, params *DescribeInstanceAttributeInput, optFns ...func(*Options)) (*DescribeInstanceAttributeOutput, error) { if params == nil { diff --git a/service/connect/api_op_DescribeInstanceStorageConfig.go b/service/connect/api_op_DescribeInstanceStorageConfig.go index 98e1334a9c9..ba5c68ad5ef 100644 --- a/service/connect/api_op_DescribeInstanceStorageConfig.go +++ b/service/connect/api_op_DescribeInstanceStorageConfig.go @@ -11,6 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This API is in preview release for Amazon Connect and is subject to change. // Retrieves the current storage configurations for the specified resource type, // association ID, and instance ID. func (c *Client) DescribeInstanceStorageConfig(ctx context.Context, params *DescribeInstanceStorageConfigInput, optFns ...func(*Options)) (*DescribeInstanceStorageConfigOutput, error) { diff --git a/service/connect/api_op_DescribeQuickConnect.go b/service/connect/api_op_DescribeQuickConnect.go new file mode 100644 index 00000000000..fcde74de921 --- /dev/null +++ b/service/connect/api_op_DescribeQuickConnect.go @@ -0,0 +1,120 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +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/connect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// This API is in preview release for Amazon Connect and is subject to change. +// Describes the quick connect. +func (c *Client) DescribeQuickConnect(ctx context.Context, params *DescribeQuickConnectInput, optFns ...func(*Options)) (*DescribeQuickConnectOutput, error) { + if params == nil { + params = &DescribeQuickConnectInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeQuickConnect", params, optFns, addOperationDescribeQuickConnectMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeQuickConnectOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeQuickConnectInput struct { + + // The identifier of the Amazon Connect instance. + // + // This member is required. + InstanceId *string + + // The identifier for the quick connect. + // + // This member is required. + QuickConnectId *string +} + +type DescribeQuickConnectOutput struct { + + // Information about the quick connect. + QuickConnect *types.QuickConnect + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDescribeQuickConnectMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeQuickConnect{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeQuickConnect{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeQuickConnectValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeQuickConnect(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDescribeQuickConnect(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "connect", + OperationName: "DescribeQuickConnect", + } +} diff --git a/service/connect/api_op_DisassociateApprovedOrigin.go b/service/connect/api_op_DisassociateApprovedOrigin.go index 0851a8eb93a..44c9f7b04a5 100644 --- a/service/connect/api_op_DisassociateApprovedOrigin.go +++ b/service/connect/api_op_DisassociateApprovedOrigin.go @@ -10,6 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This API is in preview release for Amazon Connect and is subject to change. // Revokes access to integrated applications from Amazon Connect. func (c *Client) DisassociateApprovedOrigin(ctx context.Context, params *DisassociateApprovedOriginInput, optFns ...func(*Options)) (*DisassociateApprovedOriginOutput, error) { if params == nil { diff --git a/service/connect/api_op_DisassociateInstanceStorageConfig.go b/service/connect/api_op_DisassociateInstanceStorageConfig.go index b72d4a02964..890b8d12fac 100644 --- a/service/connect/api_op_DisassociateInstanceStorageConfig.go +++ b/service/connect/api_op_DisassociateInstanceStorageConfig.go @@ -11,6 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This API is in preview release for Amazon Connect and is subject to change. // Removes the storage type configurations for the specified resource type and // association ID. func (c *Client) DisassociateInstanceStorageConfig(ctx context.Context, params *DisassociateInstanceStorageConfigInput, optFns ...func(*Options)) (*DisassociateInstanceStorageConfigOutput, error) { diff --git a/service/connect/api_op_DisassociateLambdaFunction.go b/service/connect/api_op_DisassociateLambdaFunction.go index c2501170b8a..a6df94e1535 100644 --- a/service/connect/api_op_DisassociateLambdaFunction.go +++ b/service/connect/api_op_DisassociateLambdaFunction.go @@ -10,6 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This API is in preview release for Amazon Connect and is subject to change. // Remove the Lambda function from the drop-down options available in the relevant // contact flow blocks. func (c *Client) DisassociateLambdaFunction(ctx context.Context, params *DisassociateLambdaFunctionInput, optFns ...func(*Options)) (*DisassociateLambdaFunctionOutput, error) { diff --git a/service/connect/api_op_DisassociateLexBot.go b/service/connect/api_op_DisassociateLexBot.go index 91647af3d86..bad6bad1307 100644 --- a/service/connect/api_op_DisassociateLexBot.go +++ b/service/connect/api_op_DisassociateLexBot.go @@ -10,6 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This API is in preview release for Amazon Connect and is subject to change. // Revokes authorization from the specified instance to access the specified Amazon // Lex bot. func (c *Client) DisassociateLexBot(ctx context.Context, params *DisassociateLexBotInput, optFns ...func(*Options)) (*DisassociateLexBotOutput, error) { diff --git a/service/connect/api_op_DisassociateSecurityKey.go b/service/connect/api_op_DisassociateSecurityKey.go index b000ddb946f..5d6f812758d 100644 --- a/service/connect/api_op_DisassociateSecurityKey.go +++ b/service/connect/api_op_DisassociateSecurityKey.go @@ -10,6 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This API is in preview release for Amazon Connect and is subject to change. // Deletes the specified security key. func (c *Client) DisassociateSecurityKey(ctx context.Context, params *DisassociateSecurityKeyInput, optFns ...func(*Options)) (*DisassociateSecurityKeyOutput, error) { if params == nil { diff --git a/service/connect/api_op_ListApprovedOrigins.go b/service/connect/api_op_ListApprovedOrigins.go index 50da3a927c4..d3dcdaa4136 100644 --- a/service/connect/api_op_ListApprovedOrigins.go +++ b/service/connect/api_op_ListApprovedOrigins.go @@ -11,6 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This API is in preview release for Amazon Connect and is subject to change. // Returns a paginated list of all approved origins associated with the instance. func (c *Client) ListApprovedOrigins(ctx context.Context, params *ListApprovedOriginsInput, optFns ...func(*Options)) (*ListApprovedOriginsOutput, error) { if params == nil { diff --git a/service/connect/api_op_ListLambdaFunctions.go b/service/connect/api_op_ListLambdaFunctions.go index 80e25ab8009..ba8f333858f 100644 --- a/service/connect/api_op_ListLambdaFunctions.go +++ b/service/connect/api_op_ListLambdaFunctions.go @@ -11,6 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This API is in preview release for Amazon Connect and is subject to change. // Returns a paginated list of all the Lambda functions that show up in the // drop-down options in the relevant contact flow blocks. func (c *Client) ListLambdaFunctions(ctx context.Context, params *ListLambdaFunctionsInput, optFns ...func(*Options)) (*ListLambdaFunctionsOutput, error) { diff --git a/service/connect/api_op_ListLexBots.go b/service/connect/api_op_ListLexBots.go index b527c18a68c..4c665743e6f 100644 --- a/service/connect/api_op_ListLexBots.go +++ b/service/connect/api_op_ListLexBots.go @@ -12,6 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This API is in preview release for Amazon Connect and is subject to change. // Returns a paginated list of all the Amazon Lex bots currently associated with // the instance. func (c *Client) ListLexBots(ctx context.Context, params *ListLexBotsInput, optFns ...func(*Options)) (*ListLexBotsOutput, error) { diff --git a/service/connect/api_op_ListQuickConnects.go b/service/connect/api_op_ListQuickConnects.go new file mode 100644 index 00000000000..d6332eb023d --- /dev/null +++ b/service/connect/api_op_ListQuickConnects.go @@ -0,0 +1,214 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +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/connect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// This API is in preview release for Amazon Connect and is subject to change. +// Provides information about the quick connects for the specified Amazon Connect +// instance. +func (c *Client) ListQuickConnects(ctx context.Context, params *ListQuickConnectsInput, optFns ...func(*Options)) (*ListQuickConnectsOutput, error) { + if params == nil { + params = &ListQuickConnectsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListQuickConnects", params, optFns, addOperationListQuickConnectsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListQuickConnectsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListQuickConnectsInput struct { + + // The identifier of the Amazon Connect instance. + // + // This member is required. + InstanceId *string + + // The maximimum number of results to return per page. + MaxResults int32 + + // The token for the next set of results. Use the value returned in the previous + // response in the next request to retrieve the next set of results. + NextToken *string + + // The type of quick connect. In the Amazon Connect console, when you create a + // quick connect, you are prompted to assign one of the following types: Agent + // (USER), External (PHONE_NUMBER), or Queue (QUEUE). + QuickConnectTypes []types.QuickConnectType +} + +type ListQuickConnectsOutput struct { + + // If there are additional results, this is the token for the next set of results. + NextToken *string + + // Information about the quick connects. + QuickConnectSummaryList []types.QuickConnectSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListQuickConnectsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListQuickConnects{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListQuickConnects{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListQuickConnectsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListQuickConnects(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListQuickConnectsAPIClient is a client that implements the ListQuickConnects +// operation. +type ListQuickConnectsAPIClient interface { + ListQuickConnects(context.Context, *ListQuickConnectsInput, ...func(*Options)) (*ListQuickConnectsOutput, error) +} + +var _ ListQuickConnectsAPIClient = (*Client)(nil) + +// ListQuickConnectsPaginatorOptions is the paginator options for ListQuickConnects +type ListQuickConnectsPaginatorOptions struct { + // The maximimum number of results to return per page. + 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 +} + +// ListQuickConnectsPaginator is a paginator for ListQuickConnects +type ListQuickConnectsPaginator struct { + options ListQuickConnectsPaginatorOptions + client ListQuickConnectsAPIClient + params *ListQuickConnectsInput + nextToken *string + firstPage bool +} + +// NewListQuickConnectsPaginator returns a new ListQuickConnectsPaginator +func NewListQuickConnectsPaginator(client ListQuickConnectsAPIClient, params *ListQuickConnectsInput, optFns ...func(*ListQuickConnectsPaginatorOptions)) *ListQuickConnectsPaginator { + options := ListQuickConnectsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListQuickConnectsInput{} + } + + return &ListQuickConnectsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListQuickConnectsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListQuickConnects page. +func (p *ListQuickConnectsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListQuickConnectsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListQuickConnects(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListQuickConnects(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "connect", + OperationName: "ListQuickConnects", + } +} diff --git a/service/connect/api_op_ListSecurityKeys.go b/service/connect/api_op_ListSecurityKeys.go index 2100c48c46b..f6948a839eb 100644 --- a/service/connect/api_op_ListSecurityKeys.go +++ b/service/connect/api_op_ListSecurityKeys.go @@ -12,6 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// This API is in preview release for Amazon Connect and is subject to change. // Returns a paginated list of all security keys associated with the instance. func (c *Client) ListSecurityKeys(ctx context.Context, params *ListSecurityKeysInput, optFns ...func(*Options)) (*ListSecurityKeysOutput, error) { if params == nil { diff --git a/service/connect/api_op_TagResource.go b/service/connect/api_op_TagResource.go index be22fd9b2c3..1bb51935a75 100644 --- a/service/connect/api_op_TagResource.go +++ b/service/connect/api_op_TagResource.go @@ -11,8 +11,8 @@ import ( ) // Adds the specified tags to the specified resource. The supported resource types -// are users, routing profiles, and contact flows. For sample policies that use -// tags, see Amazon Connect Identity-Based Policy Examples +// are users, routing profiles, quick connects, and contact flows. For sample +// policies that use tags, see Amazon Connect Identity-Based Policy Examples // (https://docs.aws.amazon.com/connect/latest/adminguide/security_iam_id-based-policy-examples.html) // in the Amazon Connect Administrator Guide. func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { diff --git a/service/connect/api_op_UpdateQuickConnectConfig.go b/service/connect/api_op_UpdateQuickConnectConfig.go new file mode 100644 index 00000000000..f69bfb465ab --- /dev/null +++ b/service/connect/api_op_UpdateQuickConnectConfig.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +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/connect/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// This API is in preview release for Amazon Connect and is subject to change. +// Updates the configuration settings for the specified quick connect. +func (c *Client) UpdateQuickConnectConfig(ctx context.Context, params *UpdateQuickConnectConfigInput, optFns ...func(*Options)) (*UpdateQuickConnectConfigOutput, error) { + if params == nil { + params = &UpdateQuickConnectConfigInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateQuickConnectConfig", params, optFns, addOperationUpdateQuickConnectConfigMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateQuickConnectConfigOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateQuickConnectConfigInput struct { + + // The identifier of the Amazon Connect instance. + // + // This member is required. + InstanceId *string + + // Information about the configuration settings for the quick connect. + // + // This member is required. + QuickConnectConfig *types.QuickConnectConfig + + // The identifier for the quick connect. + // + // This member is required. + QuickConnectId *string +} + +type UpdateQuickConnectConfigOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationUpdateQuickConnectConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateQuickConnectConfig{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateQuickConnectConfig{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateQuickConnectConfigValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateQuickConnectConfig(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opUpdateQuickConnectConfig(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "connect", + OperationName: "UpdateQuickConnectConfig", + } +} diff --git a/service/connect/api_op_UpdateQuickConnectName.go b/service/connect/api_op_UpdateQuickConnectName.go new file mode 100644 index 00000000000..b647393e372 --- /dev/null +++ b/service/connect/api_op_UpdateQuickConnectName.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connect + +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" +) + +// This API is in preview release for Amazon Connect and is subject to change. +// Updates the name and description of a quick connect. The request accepts the +// following data in JSON format. At least Name or Description must be provided. +func (c *Client) UpdateQuickConnectName(ctx context.Context, params *UpdateQuickConnectNameInput, optFns ...func(*Options)) (*UpdateQuickConnectNameOutput, error) { + if params == nil { + params = &UpdateQuickConnectNameInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateQuickConnectName", params, optFns, addOperationUpdateQuickConnectNameMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateQuickConnectNameOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateQuickConnectNameInput struct { + + // The identifier of the Amazon Connect instance. + // + // This member is required. + InstanceId *string + + // The identifier for the quick connect. + // + // This member is required. + QuickConnectId *string + + // The description of the quick connect. + Description *string + + // The name of the quick connect. + Name *string +} + +type UpdateQuickConnectNameOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationUpdateQuickConnectNameMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateQuickConnectName{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateQuickConnectName{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateQuickConnectNameValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateQuickConnectName(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opUpdateQuickConnectName(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "connect", + OperationName: "UpdateQuickConnectName", + } +} diff --git a/service/connect/deserializers.go b/service/connect/deserializers.go index 544f47151e4..02eb7897deb 100644 --- a/service/connect/deserializers.go +++ b/service/connect/deserializers.go @@ -1277,6 +1277,184 @@ func awsRestjson1_deserializeOpDocumentCreateIntegrationAssociationOutput(v **Cr return nil } +type awsRestjson1_deserializeOpCreateQuickConnect struct { +} + +func (*awsRestjson1_deserializeOpCreateQuickConnect) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateQuickConnect) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateQuickConnect(response, &metadata) + } + output := &CreateQuickConnectOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateQuickConnectOutput(&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_deserializeOpErrorCreateQuickConnect(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("DuplicateResourceException", errorCode): + return awsRestjson1_deserializeErrorDuplicateResourceException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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_deserializeOpDocumentCreateQuickConnectOutput(v **CreateQuickConnectOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateQuickConnectOutput + if *v == nil { + sv = &CreateQuickConnectOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "QuickConnectARN": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.QuickConnectARN = ptr.String(jtv) + } + + case "QuickConnectId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuickConnectId to be of type string, got %T instead", value) + } + sv.QuickConnectId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpCreateRoutingProfile struct { } @@ -2164,6 +2342,101 @@ func awsRestjson1_deserializeOpErrorDeleteIntegrationAssociation(response *smith } } +type awsRestjson1_deserializeOpDeleteQuickConnect struct { +} + +func (*awsRestjson1_deserializeOpDeleteQuickConnect) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteQuickConnect) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteQuickConnect(response, &metadata) + } + output := &DeleteQuickConnectOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteQuickConnect(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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_deserializeOpDeleteUseCase struct { } @@ -3082,14 +3355,14 @@ func awsRestjson1_deserializeOpDocumentDescribeInstanceStorageConfigOutput(v **D return nil } -type awsRestjson1_deserializeOpDescribeRoutingProfile struct { +type awsRestjson1_deserializeOpDescribeQuickConnect struct { } -func (*awsRestjson1_deserializeOpDescribeRoutingProfile) ID() string { +func (*awsRestjson1_deserializeOpDescribeQuickConnect) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeRoutingProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeQuickConnect) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3103,7 +3376,166 @@ func (m *awsRestjson1_deserializeOpDescribeRoutingProfile) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeRoutingProfile(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeQuickConnect(response, &metadata) + } + output := &DescribeQuickConnectOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentDescribeQuickConnectOutput(&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_deserializeOpErrorDescribeQuickConnect(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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_deserializeOpDocumentDescribeQuickConnectOutput(v **DescribeQuickConnectOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeQuickConnectOutput + if *v == nil { + sv = &DescribeQuickConnectOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "QuickConnect": + if err := awsRestjson1_deserializeDocumentQuickConnect(&sv.QuickConnect, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDescribeRoutingProfile struct { +} + +func (*awsRestjson1_deserializeOpDescribeRoutingProfile) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDescribeRoutingProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDescribeRoutingProfile(response, &metadata) } output := &DescribeRoutingProfileOutput{} out.Result = output @@ -6956,14 +7388,14 @@ func awsRestjson1_deserializeOpDocumentListQueuesOutput(v **ListQueuesOutput, va return nil } -type awsRestjson1_deserializeOpListRoutingProfileQueues struct { +type awsRestjson1_deserializeOpListQuickConnects struct { } -func (*awsRestjson1_deserializeOpListRoutingProfileQueues) ID() string { +func (*awsRestjson1_deserializeOpListQuickConnects) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListRoutingProfileQueues) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListQuickConnects) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6977,9 +7409,9 @@ func (m *awsRestjson1_deserializeOpListRoutingProfileQueues) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListRoutingProfileQueues(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListQuickConnects(response, &metadata) } - output := &ListRoutingProfileQueuesOutput{} + output := &ListQuickConnectsOutput{} out.Result = output var buff [1024]byte @@ -7000,7 +7432,7 @@ func (m *awsRestjson1_deserializeOpListRoutingProfileQueues) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListRoutingProfileQueuesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListQuickConnectsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7013,7 +7445,7 @@ func (m *awsRestjson1_deserializeOpListRoutingProfileQueues) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListRoutingProfileQueues(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListQuickConnects(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7079,7 +7511,7 @@ func awsRestjson1_deserializeOpErrorListRoutingProfileQueues(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentListRoutingProfileQueuesOutput(v **ListRoutingProfileQueuesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListQuickConnectsOutput(v **ListQuickConnectsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7092,9 +7524,9 @@ func awsRestjson1_deserializeOpDocumentListRoutingProfileQueuesOutput(v **ListRo return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListRoutingProfileQueuesOutput + var sv *ListQuickConnectsOutput if *v == nil { - sv = &ListRoutingProfileQueuesOutput{} + sv = &ListQuickConnectsOutput{} } else { sv = *v } @@ -7110,8 +7542,8 @@ func awsRestjson1_deserializeOpDocumentListRoutingProfileQueuesOutput(v **ListRo sv.NextToken = ptr.String(jtv) } - case "RoutingProfileQueueConfigSummaryList": - if err := awsRestjson1_deserializeDocumentRoutingProfileQueueConfigSummaryList(&sv.RoutingProfileQueueConfigSummaryList, value); err != nil { + case "QuickConnectSummaryList": + if err := awsRestjson1_deserializeDocumentQuickConnectSummaryList(&sv.QuickConnectSummaryList, value); err != nil { return err } @@ -7124,14 +7556,14 @@ func awsRestjson1_deserializeOpDocumentListRoutingProfileQueuesOutput(v **ListRo return nil } -type awsRestjson1_deserializeOpListRoutingProfiles struct { +type awsRestjson1_deserializeOpListRoutingProfileQueues struct { } -func (*awsRestjson1_deserializeOpListRoutingProfiles) ID() string { +func (*awsRestjson1_deserializeOpListRoutingProfileQueues) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListRoutingProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListRoutingProfileQueues) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7145,9 +7577,9 @@ func (m *awsRestjson1_deserializeOpListRoutingProfiles) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListRoutingProfiles(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListRoutingProfileQueues(response, &metadata) } - output := &ListRoutingProfilesOutput{} + output := &ListRoutingProfileQueuesOutput{} out.Result = output var buff [1024]byte @@ -7168,7 +7600,7 @@ func (m *awsRestjson1_deserializeOpListRoutingProfiles) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListRoutingProfilesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListRoutingProfileQueuesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7181,7 +7613,7 @@ func (m *awsRestjson1_deserializeOpListRoutingProfiles) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListRoutingProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListRoutingProfileQueues(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7247,7 +7679,7 @@ func awsRestjson1_deserializeOpErrorListRoutingProfiles(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListRoutingProfilesOutput(v **ListRoutingProfilesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListRoutingProfileQueuesOutput(v **ListRoutingProfileQueuesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7260,9 +7692,9 @@ func awsRestjson1_deserializeOpDocumentListRoutingProfilesOutput(v **ListRouting return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListRoutingProfilesOutput + var sv *ListRoutingProfileQueuesOutput if *v == nil { - sv = &ListRoutingProfilesOutput{} + sv = &ListRoutingProfileQueuesOutput{} } else { sv = *v } @@ -7278,8 +7710,8 @@ func awsRestjson1_deserializeOpDocumentListRoutingProfilesOutput(v **ListRouting sv.NextToken = ptr.String(jtv) } - case "RoutingProfileSummaryList": - if err := awsRestjson1_deserializeDocumentRoutingProfileSummaryList(&sv.RoutingProfileSummaryList, value); err != nil { + case "RoutingProfileQueueConfigSummaryList": + if err := awsRestjson1_deserializeDocumentRoutingProfileQueueConfigSummaryList(&sv.RoutingProfileQueueConfigSummaryList, value); err != nil { return err } @@ -7292,14 +7724,14 @@ func awsRestjson1_deserializeOpDocumentListRoutingProfilesOutput(v **ListRouting return nil } -type awsRestjson1_deserializeOpListSecurityKeys struct { +type awsRestjson1_deserializeOpListRoutingProfiles struct { } -func (*awsRestjson1_deserializeOpListSecurityKeys) ID() string { +func (*awsRestjson1_deserializeOpListRoutingProfiles) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListSecurityKeys) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListRoutingProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7313,9 +7745,9 @@ func (m *awsRestjson1_deserializeOpListSecurityKeys) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListSecurityKeys(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListRoutingProfiles(response, &metadata) } - output := &ListSecurityKeysOutput{} + output := &ListRoutingProfilesOutput{} out.Result = output var buff [1024]byte @@ -7336,7 +7768,7 @@ func (m *awsRestjson1_deserializeOpListSecurityKeys) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListSecurityKeysOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListRoutingProfilesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7349,7 +7781,7 @@ func (m *awsRestjson1_deserializeOpListSecurityKeys) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorListSecurityKeys(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListRoutingProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7415,7 +7847,7 @@ func awsRestjson1_deserializeOpErrorListSecurityKeys(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentListSecurityKeysOutput(v **ListSecurityKeysOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListRoutingProfilesOutput(v **ListRoutingProfilesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7428,9 +7860,9 @@ func awsRestjson1_deserializeOpDocumentListSecurityKeysOutput(v **ListSecurityKe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListSecurityKeysOutput + var sv *ListRoutingProfilesOutput if *v == nil { - sv = &ListSecurityKeysOutput{} + sv = &ListRoutingProfilesOutput{} } else { sv = *v } @@ -7446,8 +7878,8 @@ func awsRestjson1_deserializeOpDocumentListSecurityKeysOutput(v **ListSecurityKe sv.NextToken = ptr.String(jtv) } - case "SecurityKeys": - if err := awsRestjson1_deserializeDocumentSecurityKeysList(&sv.SecurityKeys, value); err != nil { + case "RoutingProfileSummaryList": + if err := awsRestjson1_deserializeDocumentRoutingProfileSummaryList(&sv.RoutingProfileSummaryList, value); err != nil { return err } @@ -7460,14 +7892,14 @@ func awsRestjson1_deserializeOpDocumentListSecurityKeysOutput(v **ListSecurityKe return nil } -type awsRestjson1_deserializeOpListSecurityProfiles struct { +type awsRestjson1_deserializeOpListSecurityKeys struct { } -func (*awsRestjson1_deserializeOpListSecurityProfiles) ID() string { +func (*awsRestjson1_deserializeOpListSecurityKeys) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListSecurityProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListSecurityKeys) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7481,9 +7913,9 @@ func (m *awsRestjson1_deserializeOpListSecurityProfiles) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListSecurityProfiles(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListSecurityKeys(response, &metadata) } - output := &ListSecurityProfilesOutput{} + output := &ListSecurityKeysOutput{} out.Result = output var buff [1024]byte @@ -7504,7 +7936,7 @@ func (m *awsRestjson1_deserializeOpListSecurityProfiles) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListSecurityKeysOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7517,7 +7949,7 @@ func (m *awsRestjson1_deserializeOpListSecurityProfiles) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListSecurityProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListSecurityKeys(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7583,7 +8015,7 @@ func awsRestjson1_deserializeOpErrorListSecurityProfiles(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(v **ListSecurityProfilesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListSecurityKeysOutput(v **ListSecurityKeysOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7596,9 +8028,9 @@ func awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(v **ListSecuri return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListSecurityProfilesOutput + var sv *ListSecurityKeysOutput if *v == nil { - sv = &ListSecurityProfilesOutput{} + sv = &ListSecurityKeysOutput{} } else { sv = *v } @@ -7614,8 +8046,8 @@ func awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(v **ListSecuri sv.NextToken = ptr.String(jtv) } - case "SecurityProfileSummaryList": - if err := awsRestjson1_deserializeDocumentSecurityProfileSummaryList(&sv.SecurityProfileSummaryList, value); err != nil { + case "SecurityKeys": + if err := awsRestjson1_deserializeDocumentSecurityKeysList(&sv.SecurityKeys, value); err != nil { return err } @@ -7628,14 +8060,14 @@ func awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(v **ListSecuri return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpListSecurityProfiles struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpListSecurityProfiles) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListSecurityProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7649,9 +8081,9 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListSecurityProfiles(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListSecurityProfilesOutput{} out.Result = output var buff [1024]byte @@ -7672,7 +8104,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7685,7 +8117,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListSecurityProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7751,7 +8183,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(v **ListSecurityProfilesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7764,16 +8196,184 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *ListSecurityProfilesOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &ListSecurityProfilesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "tags": + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "SecurityProfileSummaryList": + if err := awsRestjson1_deserializeDocumentSecurityProfileSummaryList(&sv.SecurityProfileSummaryList, 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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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 } @@ -9926,14 +10526,14 @@ func awsRestjson1_deserializeOpErrorUpdateInstanceStorageConfig(response *smithy } } -type awsRestjson1_deserializeOpUpdateRoutingProfileConcurrency struct { +type awsRestjson1_deserializeOpUpdateQuickConnectConfig struct { } -func (*awsRestjson1_deserializeOpUpdateRoutingProfileConcurrency) ID() string { +func (*awsRestjson1_deserializeOpUpdateQuickConnectConfig) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateRoutingProfileConcurrency) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateQuickConnectConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -9947,15 +10547,15 @@ func (m *awsRestjson1_deserializeOpUpdateRoutingProfileConcurrency) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateRoutingProfileConcurrency(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateQuickConnectConfig(response, &metadata) } - output := &UpdateRoutingProfileConcurrencyOutput{} + output := &UpdateQuickConnectConfigOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateRoutingProfileConcurrency(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateQuickConnectConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10021,14 +10621,14 @@ func awsRestjson1_deserializeOpErrorUpdateRoutingProfileConcurrency(response *sm } } -type awsRestjson1_deserializeOpUpdateRoutingProfileDefaultOutboundQueue struct { +type awsRestjson1_deserializeOpUpdateQuickConnectName struct { } -func (*awsRestjson1_deserializeOpUpdateRoutingProfileDefaultOutboundQueue) ID() string { +func (*awsRestjson1_deserializeOpUpdateQuickConnectName) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateRoutingProfileDefaultOutboundQueue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateQuickConnectName) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10042,15 +10642,15 @@ func (m *awsRestjson1_deserializeOpUpdateRoutingProfileDefaultOutboundQueue) Han } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateRoutingProfileDefaultOutboundQueue(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateQuickConnectName(response, &metadata) } - output := &UpdateRoutingProfileDefaultOutboundQueueOutput{} + output := &UpdateQuickConnectNameOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateRoutingProfileDefaultOutboundQueue(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateQuickConnectName(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10116,14 +10716,14 @@ func awsRestjson1_deserializeOpErrorUpdateRoutingProfileDefaultOutboundQueue(res } } -type awsRestjson1_deserializeOpUpdateRoutingProfileName struct { +type awsRestjson1_deserializeOpUpdateRoutingProfileConcurrency struct { } -func (*awsRestjson1_deserializeOpUpdateRoutingProfileName) ID() string { +func (*awsRestjson1_deserializeOpUpdateRoutingProfileConcurrency) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateRoutingProfileName) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateRoutingProfileConcurrency) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10137,15 +10737,15 @@ func (m *awsRestjson1_deserializeOpUpdateRoutingProfileName) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateRoutingProfileName(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateRoutingProfileConcurrency(response, &metadata) } - output := &UpdateRoutingProfileNameOutput{} + output := &UpdateRoutingProfileConcurrencyOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateRoutingProfileName(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateRoutingProfileConcurrency(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10186,9 +10786,6 @@ func awsRestjson1_deserializeOpErrorUpdateRoutingProfileName(response *smithyhtt } switch { - case strings.EqualFold("DuplicateResourceException", errorCode): - return awsRestjson1_deserializeErrorDuplicateResourceException(response, errorBody) - case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) @@ -10214,14 +10811,14 @@ func awsRestjson1_deserializeOpErrorUpdateRoutingProfileName(response *smithyhtt } } -type awsRestjson1_deserializeOpUpdateRoutingProfileQueues struct { +type awsRestjson1_deserializeOpUpdateRoutingProfileDefaultOutboundQueue struct { } -func (*awsRestjson1_deserializeOpUpdateRoutingProfileQueues) ID() string { +func (*awsRestjson1_deserializeOpUpdateRoutingProfileDefaultOutboundQueue) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateRoutingProfileQueues) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateRoutingProfileDefaultOutboundQueue) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10235,15 +10832,15 @@ func (m *awsRestjson1_deserializeOpUpdateRoutingProfileQueues) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateRoutingProfileQueues(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateRoutingProfileDefaultOutboundQueue(response, &metadata) } - output := &UpdateRoutingProfileQueuesOutput{} + output := &UpdateRoutingProfileDefaultOutboundQueueOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateRoutingProfileQueues(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateRoutingProfileDefaultOutboundQueue(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10309,14 +10906,14 @@ func awsRestjson1_deserializeOpErrorUpdateRoutingProfileQueues(response *smithyh } } -type awsRestjson1_deserializeOpUpdateUserHierarchy struct { +type awsRestjson1_deserializeOpUpdateRoutingProfileName struct { } -func (*awsRestjson1_deserializeOpUpdateUserHierarchy) ID() string { +func (*awsRestjson1_deserializeOpUpdateRoutingProfileName) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateUserHierarchy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateRoutingProfileName) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10330,15 +10927,15 @@ func (m *awsRestjson1_deserializeOpUpdateUserHierarchy) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateUserHierarchy(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateRoutingProfileName(response, &metadata) } - output := &UpdateUserHierarchyOutput{} + output := &UpdateRoutingProfileNameOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateUserHierarchy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateRoutingProfileName(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10379,6 +10976,9 @@ func awsRestjson1_deserializeOpErrorUpdateUserHierarchy(response *smithyhttp.Res } switch { + case strings.EqualFold("DuplicateResourceException", errorCode): + return awsRestjson1_deserializeErrorDuplicateResourceException(response, errorBody) + case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) @@ -10404,14 +11004,14 @@ func awsRestjson1_deserializeOpErrorUpdateUserHierarchy(response *smithyhttp.Res } } -type awsRestjson1_deserializeOpUpdateUserHierarchyGroupName struct { +type awsRestjson1_deserializeOpUpdateRoutingProfileQueues struct { } -func (*awsRestjson1_deserializeOpUpdateUserHierarchyGroupName) ID() string { +func (*awsRestjson1_deserializeOpUpdateRoutingProfileQueues) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateUserHierarchyGroupName) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateRoutingProfileQueues) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10425,15 +11025,15 @@ func (m *awsRestjson1_deserializeOpUpdateUserHierarchyGroupName) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateUserHierarchyGroupName(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateRoutingProfileQueues(response, &metadata) } - output := &UpdateUserHierarchyGroupNameOutput{} + output := &UpdateRoutingProfileQueuesOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateUserHierarchyGroupName(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateRoutingProfileQueues(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10474,9 +11074,6 @@ func awsRestjson1_deserializeOpErrorUpdateUserHierarchyGroupName(response *smith } switch { - case strings.EqualFold("DuplicateResourceException", errorCode): - return awsRestjson1_deserializeErrorDuplicateResourceException(response, errorBody) - case strings.EqualFold("InternalServiceException", errorCode): return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) @@ -10502,14 +11099,14 @@ func awsRestjson1_deserializeOpErrorUpdateUserHierarchyGroupName(response *smith } } -type awsRestjson1_deserializeOpUpdateUserHierarchyStructure struct { +type awsRestjson1_deserializeOpUpdateUserHierarchy struct { } -func (*awsRestjson1_deserializeOpUpdateUserHierarchyStructure) ID() string { +func (*awsRestjson1_deserializeOpUpdateUserHierarchy) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateUserHierarchyStructure) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateUserHierarchy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10523,15 +11120,15 @@ func (m *awsRestjson1_deserializeOpUpdateUserHierarchyStructure) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateUserHierarchyStructure(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateUserHierarchy(response, &metadata) } - output := &UpdateUserHierarchyStructureOutput{} + output := &UpdateUserHierarchyOutput{} out.Result = output return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateUserHierarchyStructure(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateUserHierarchy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10581,9 +11178,6 @@ func awsRestjson1_deserializeOpErrorUpdateUserHierarchyStructure(response *smith case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -10600,10 +11194,206 @@ func awsRestjson1_deserializeOpErrorUpdateUserHierarchyStructure(response *smith } } -type awsRestjson1_deserializeOpUpdateUserIdentityInfo struct { +type awsRestjson1_deserializeOpUpdateUserHierarchyGroupName struct { } -func (*awsRestjson1_deserializeOpUpdateUserIdentityInfo) ID() string { +func (*awsRestjson1_deserializeOpUpdateUserHierarchyGroupName) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateUserHierarchyGroupName) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateUserHierarchyGroupName(response, &metadata) + } + output := &UpdateUserHierarchyGroupNameOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateUserHierarchyGroupName(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("DuplicateResourceException", errorCode): + return awsRestjson1_deserializeErrorDuplicateResourceException(response, errorBody) + + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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_deserializeOpUpdateUserHierarchyStructure struct { +} + +func (*awsRestjson1_deserializeOpUpdateUserHierarchyStructure) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateUserHierarchyStructure) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateUserHierarchyStructure(response, &metadata) + } + output := &UpdateUserHierarchyStructureOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateUserHierarchyStructure(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServiceException", errorCode): + return awsRestjson1_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(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_deserializeOpUpdateUserIdentityInfo struct { +} + +func (*awsRestjson1_deserializeOpUpdateUserIdentityInfo) ID() string { return "OperationDeserializer" } @@ -14216,6 +15006,46 @@ func awsRestjson1_deserializeDocumentOutboundContactNotPermittedException(v **ty return nil } +func awsRestjson1_deserializeDocumentPhoneNumberQuickConnectConfig(v **types.PhoneNumberQuickConnectConfig, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PhoneNumberQuickConnectConfig + if *v == nil { + sv = &types.PhoneNumberQuickConnectConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PhoneNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PhoneNumber to be of type string, got %T instead", value) + } + sv.PhoneNumber = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentPhoneNumberSummary(v **types.PhoneNumberSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14492,7 +15322,7 @@ func awsRestjson1_deserializeDocumentPromptSummaryList(v *[]types.PromptSummary, return nil } -func awsRestjson1_deserializeDocumentQueueReference(v **types.QueueReference, value interface{}) error { +func awsRestjson1_deserializeDocumentQueueQuickConnectConfig(v **types.QueueQuickConnectConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14505,31 +15335,31 @@ func awsRestjson1_deserializeDocumentQueueReference(v **types.QueueReference, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.QueueReference + var sv *types.QueueQuickConnectConfig if *v == nil { - sv = &types.QueueReference{} + sv = &types.QueueQuickConnectConfig{} } else { sv = *v } for key, value := range shape { switch key { - case "Arn": + case "ContactFlowId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + return fmt.Errorf("expected ContactFlowId to be of type string, got %T instead", value) } - sv.Arn = ptr.String(jtv) + sv.ContactFlowId = ptr.String(jtv) } - case "Id": + case "QueueId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected QueueId to be of type string, got %T instead", value) } - sv.Id = ptr.String(jtv) + sv.QueueId = ptr.String(jtv) } default: @@ -14541,7 +15371,7 @@ func awsRestjson1_deserializeDocumentQueueReference(v **types.QueueReference, va return nil } -func awsRestjson1_deserializeDocumentQueueSummary(v **types.QueueSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentQueueReference(v **types.QueueReference, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14554,9 +15384,9 @@ func awsRestjson1_deserializeDocumentQueueSummary(v **types.QueueSummary, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.QueueSummary + var sv *types.QueueReference if *v == nil { - sv = &types.QueueSummary{} + sv = &types.QueueReference{} } else { sv = *v } @@ -14581,9 +15411,58 @@ func awsRestjson1_deserializeDocumentQueueSummary(v **types.QueueSummary, value sv.Id = ptr.String(jtv) } - case "Name": - if value != nil { - jtv, ok := value.(string) + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentQueueSummary(v **types.QueueSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.QueueSummary + if *v == nil { + sv = &types.QueueSummary{} + } 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 "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QueueId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) if !ok { return fmt.Errorf("expected QueueName to be of type string, got %T instead", value) } @@ -14642,6 +15521,239 @@ func awsRestjson1_deserializeDocumentQueueSummaryList(v *[]types.QueueSummary, v return nil } +func awsRestjson1_deserializeDocumentQuickConnect(v **types.QuickConnect, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.QuickConnect + if *v == nil { + sv = &types.QuickConnect{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuickConnectDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuickConnectName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "QuickConnectARN": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.QuickConnectARN = ptr.String(jtv) + } + + case "QuickConnectConfig": + if err := awsRestjson1_deserializeDocumentQuickConnectConfig(&sv.QuickConnectConfig, value); err != nil { + return err + } + + case "QuickConnectId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuickConnectId to be of type string, got %T instead", value) + } + sv.QuickConnectId = ptr.String(jtv) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentQuickConnectConfig(v **types.QuickConnectConfig, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.QuickConnectConfig + if *v == nil { + sv = &types.QuickConnectConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PhoneConfig": + if err := awsRestjson1_deserializeDocumentPhoneNumberQuickConnectConfig(&sv.PhoneConfig, value); err != nil { + return err + } + + case "QueueConfig": + if err := awsRestjson1_deserializeDocumentQueueQuickConnectConfig(&sv.QueueConfig, value); err != nil { + return err + } + + case "QuickConnectType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuickConnectType to be of type string, got %T instead", value) + } + sv.QuickConnectType = types.QuickConnectType(jtv) + } + + case "UserConfig": + if err := awsRestjson1_deserializeDocumentUserQuickConnectConfig(&sv.UserConfig, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentQuickConnectSummary(v **types.QuickConnectSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.QuickConnectSummary + if *v == nil { + sv = &types.QuickConnectSummary{} + } 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 "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuickConnectId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuickConnectName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "QuickConnectType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuickConnectType to be of type string, got %T instead", value) + } + sv.QuickConnectType = types.QuickConnectType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentQuickConnectSummaryList(v *[]types.QuickConnectSummary, 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.QuickConnectSummary + if *v == nil { + cv = []types.QuickConnectSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.QuickConnectSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentQuickConnectSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentResourceConflictException(v **types.ResourceConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15907,6 +17019,55 @@ func awsRestjson1_deserializeDocumentUserPhoneConfig(v **types.UserPhoneConfig, return nil } +func awsRestjson1_deserializeDocumentUserQuickConnectConfig(v **types.UserQuickConnectConfig, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UserQuickConnectConfig + if *v == nil { + sv = &types.UserQuickConnectConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ContactFlowId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContactFlowId to be of type string, got %T instead", value) + } + sv.ContactFlowId = ptr.String(jtv) + } + + case "UserId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UserId to be of type string, got %T instead", value) + } + sv.UserId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentUserSummary(v **types.UserSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/connect/serializers.go b/service/connect/serializers.go index 0a8520fa994..4a20efac564 100644 --- a/service/connect/serializers.go +++ b/service/connect/serializers.go @@ -863,6 +863,111 @@ func awsRestjson1_serializeOpDocumentCreateIntegrationAssociationInput(v *Create return nil } +type awsRestjson1_serializeOpCreateQuickConnect struct { +} + +func (*awsRestjson1_serializeOpCreateQuickConnect) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateQuickConnect) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateQuickConnectInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/quick-connects/{InstanceId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + request.URL.RawQuery = opQuery + } + + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateQuickConnectInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateQuickConnectInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateQuickConnectInput(v *CreateQuickConnectInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InstanceId == nil || len(*v.InstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member InstanceId must not be empty")} + } + if v.InstanceId != nil { + if err := encoder.SetURI("InstanceId").String(*v.InstanceId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateQuickConnectInput(v *CreateQuickConnectInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.QuickConnectConfig != nil { + ok := object.Key("QuickConnectConfig") + if err := awsRestjson1_serializeDocumentQuickConnectConfig(v.QuickConnectConfig, 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_serializeOpCreateRoutingProfile struct { } @@ -1435,6 +1540,78 @@ func awsRestjson1_serializeOpHttpBindingsDeleteIntegrationAssociationInput(v *De return nil } +type awsRestjson1_serializeOpDeleteQuickConnect struct { +} + +func (*awsRestjson1_serializeOpDeleteQuickConnect) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteQuickConnect) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteQuickConnectInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/quick-connects/{InstanceId}/{QuickConnectId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteQuickConnectInput(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_serializeOpHttpBindingsDeleteQuickConnectInput(v *DeleteQuickConnectInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InstanceId == nil || len(*v.InstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member InstanceId must not be empty")} + } + if v.InstanceId != nil { + if err := encoder.SetURI("InstanceId").String(*v.InstanceId); err != nil { + return err + } + } + + if v.QuickConnectId == nil || len(*v.QuickConnectId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member QuickConnectId must not be empty")} + } + if v.QuickConnectId != nil { + if err := encoder.SetURI("QuickConnectId").String(*v.QuickConnectId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDeleteUseCase struct { } @@ -1943,6 +2120,78 @@ func awsRestjson1_serializeOpHttpBindingsDescribeInstanceStorageConfigInput(v *D return nil } +type awsRestjson1_serializeOpDescribeQuickConnect struct { +} + +func (*awsRestjson1_serializeOpDescribeQuickConnect) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeQuickConnect) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeQuickConnectInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/quick-connects/{InstanceId}/{QuickConnectId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDescribeQuickConnectInput(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_serializeOpHttpBindingsDescribeQuickConnectInput(v *DescribeQuickConnectInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InstanceId == nil || len(*v.InstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member InstanceId must not be empty")} + } + if v.InstanceId != nil { + if err := encoder.SetURI("InstanceId").String(*v.InstanceId); err != nil { + return err + } + } + + if v.QuickConnectId == nil || len(*v.QuickConnectId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member QuickConnectId must not be empty")} + } + if v.QuickConnectId != nil { + if err := encoder.SetURI("QuickConnectId").String(*v.QuickConnectId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDescribeRoutingProfile struct { } @@ -3912,6 +4161,83 @@ func awsRestjson1_serializeOpHttpBindingsListQueuesInput(v *ListQueuesInput, enc return nil } +type awsRestjson1_serializeOpListQuickConnects struct { +} + +func (*awsRestjson1_serializeOpListQuickConnects) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListQuickConnects) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListQuickConnectsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/quick-connects/{InstanceId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListQuickConnectsInput(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_serializeOpHttpBindingsListQuickConnectsInput(v *ListQuickConnectsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InstanceId == nil || len(*v.InstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member InstanceId must not be empty")} + } + if v.InstanceId != nil { + if err := encoder.SetURI("InstanceId").String(*v.InstanceId); err != nil { + return err + } + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.QuickConnectTypes != nil { + for i := range v.QuickConnectTypes { + encoder.AddQuery("QuickConnectTypes").String(string(v.QuickConnectTypes[i])) + } + } + + return nil +} + type awsRestjson1_serializeOpListRoutingProfileQueues struct { } @@ -5861,6 +6187,203 @@ func awsRestjson1_serializeOpDocumentUpdateInstanceStorageConfigInput(v *UpdateI return nil } +type awsRestjson1_serializeOpUpdateQuickConnectConfig struct { +} + +func (*awsRestjson1_serializeOpUpdateQuickConnectConfig) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateQuickConnectConfig) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateQuickConnectConfigInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/quick-connects/{InstanceId}/{QuickConnectId}/config") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsUpdateQuickConnectConfigInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateQuickConnectConfigInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateQuickConnectConfigInput(v *UpdateQuickConnectConfigInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InstanceId == nil || len(*v.InstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member InstanceId must not be empty")} + } + if v.InstanceId != nil { + if err := encoder.SetURI("InstanceId").String(*v.InstanceId); err != nil { + return err + } + } + + if v.QuickConnectId == nil || len(*v.QuickConnectId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member QuickConnectId must not be empty")} + } + if v.QuickConnectId != nil { + if err := encoder.SetURI("QuickConnectId").String(*v.QuickConnectId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateQuickConnectConfigInput(v *UpdateQuickConnectConfigInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.QuickConnectConfig != nil { + ok := object.Key("QuickConnectConfig") + if err := awsRestjson1_serializeDocumentQuickConnectConfig(v.QuickConnectConfig, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateQuickConnectName struct { +} + +func (*awsRestjson1_serializeOpUpdateQuickConnectName) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateQuickConnectName) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateQuickConnectNameInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/quick-connects/{InstanceId}/{QuickConnectId}/name") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsUpdateQuickConnectNameInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateQuickConnectNameInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateQuickConnectNameInput(v *UpdateQuickConnectNameInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.InstanceId == nil || len(*v.InstanceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member InstanceId must not be empty")} + } + if v.InstanceId != nil { + if err := encoder.SetURI("InstanceId").String(*v.InstanceId); err != nil { + return err + } + } + + if v.QuickConnectId == nil || len(*v.QuickConnectId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member QuickConnectId must not be empty")} + } + if v.QuickConnectId != nil { + if err := encoder.SetURI("QuickConnectId").String(*v.QuickConnectId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateQuickConnectNameInput(v *UpdateQuickConnectNameInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + return nil +} + type awsRestjson1_serializeOpUpdateRoutingProfileConcurrency struct { } @@ -7294,6 +7817,35 @@ func awsRestjson1_serializeDocumentParticipantDetails(v *types.ParticipantDetail return nil } +func awsRestjson1_serializeDocumentPhoneNumberQuickConnectConfig(v *types.PhoneNumberQuickConnectConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PhoneNumber != nil { + ok := object.Key("PhoneNumber") + ok.String(*v.PhoneNumber) + } + + return nil +} + +func awsRestjson1_serializeDocumentQueueQuickConnectConfig(v *types.QueueQuickConnectConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ContactFlowId != nil { + ok := object.Key("ContactFlowId") + ok.String(*v.ContactFlowId) + } + + if v.QueueId != nil { + ok := object.Key("QueueId") + ok.String(*v.QueueId) + } + + return nil +} + func awsRestjson1_serializeDocumentQueues(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -7305,6 +7857,39 @@ func awsRestjson1_serializeDocumentQueues(v []string, value smithyjson.Value) er return nil } +func awsRestjson1_serializeDocumentQuickConnectConfig(v *types.QuickConnectConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PhoneConfig != nil { + ok := object.Key("PhoneConfig") + if err := awsRestjson1_serializeDocumentPhoneNumberQuickConnectConfig(v.PhoneConfig, ok); err != nil { + return err + } + } + + if v.QueueConfig != nil { + ok := object.Key("QueueConfig") + if err := awsRestjson1_serializeDocumentQueueQuickConnectConfig(v.QueueConfig, ok); err != nil { + return err + } + } + + if len(v.QuickConnectType) > 0 { + ok := object.Key("QuickConnectType") + ok.String(string(v.QuickConnectType)) + } + + if v.UserConfig != nil { + ok := object.Key("UserConfig") + if err := awsRestjson1_serializeDocumentUserQuickConnectConfig(v.UserConfig, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentReference(v *types.Reference, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7501,6 +8086,23 @@ func awsRestjson1_serializeDocumentUserPhoneConfig(v *types.UserPhoneConfig, val return nil } +func awsRestjson1_serializeDocumentUserQuickConnectConfig(v *types.UserQuickConnectConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ContactFlowId != nil { + ok := object.Key("ContactFlowId") + ok.String(*v.ContactFlowId) + } + + if v.UserId != nil { + ok := object.Key("UserId") + ok.String(*v.UserId) + } + + return nil +} + func awsRestjson1_serializeDocumentVoiceRecordingConfiguration(v *types.VoiceRecordingConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/connect/types/enums.go b/service/connect/types/enums.go index 198916c4afb..c463b33a71d 100644 --- a/service/connect/types/enums.go +++ b/service/connect/types/enums.go @@ -860,6 +860,26 @@ func (QueueType) Values() []QueueType { } } +type QuickConnectType string + +// Enum values for QuickConnectType +const ( + QuickConnectTypeUser QuickConnectType = "USER" + QuickConnectTypeQueue QuickConnectType = "QUEUE" + QuickConnectTypePhoneNumber QuickConnectType = "PHONE_NUMBER" +) + +// Values returns all known values for QuickConnectType. 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 (QuickConnectType) Values() []QuickConnectType { + return []QuickConnectType{ + "USER", + "QUEUE", + "PHONE_NUMBER", + } +} + type ReferenceType string // Enum values for ReferenceType diff --git a/service/connect/types/types.go b/service/connect/types/types.go index 70d76047e08..d9256db0781 100644 --- a/service/connect/types/types.go +++ b/service/connect/types/types.go @@ -522,6 +522,15 @@ type ParticipantDetails struct { DisplayName *string } +// Contains information about a phone number for a quick connect. +type PhoneNumberQuickConnectConfig struct { + + // The phone number in E.164 format. + // + // This member is required. + PhoneNumber *string +} + // Contains summary information about a phone number for a contact center. type PhoneNumberSummary struct { @@ -561,6 +570,21 @@ type PromptSummary struct { Name *string } +// Contains information about a queue for a quick connect. The contact flow must be +// of type Transfer to Queue. +type QueueQuickConnectConfig struct { + + // The identifier of the contact flow. + // + // This member is required. + ContactFlowId *string + + // The identifier of the queue. + // + // This member is required. + QueueId *string +} + // Contains information about a queue resource for which metrics are returned. type QueueReference struct { @@ -587,6 +611,67 @@ type QueueSummary struct { QueueType QueueType } +// Contains information about a quick connect. +type QuickConnect struct { + + // The description. + Description *string + + // The name of the quick connect. + Name *string + + // The Amazon Resource Name (ARN) of the quick connect. + QuickConnectARN *string + + // Contains information about the quick connect. + QuickConnectConfig *QuickConnectConfig + + // The identifier for the quick connect. + QuickConnectId *string + + // One or more tags. + Tags map[string]string +} + +// Contains configuration settings for a quick connect. +type QuickConnectConfig struct { + + // The type of quick connect. In the Amazon Connect console, when you create a + // quick connect, you are prompted to assign one of the following types: Agent + // (USER), External (PHONE_NUMBER), or Queue (QUEUE). + // + // This member is required. + QuickConnectType QuickConnectType + + // The phone configuration. This is required only if QuickConnectType is + // PHONE_NUMBER. + PhoneConfig *PhoneNumberQuickConnectConfig + + // The queue configuration. This is required only if QuickConnectType is QUEUE. + QueueConfig *QueueQuickConnectConfig + + // The user configuration. This is required only if QuickConnectType is USER. + UserConfig *UserQuickConnectConfig +} + +// Contains summary information about a quick connect. +type QuickConnectSummary struct { + + // The Amazon Resource Name (ARN). + Arn *string + + // The identifier for the quick connect. + Id *string + + // The name. + Name *string + + // The type of quick connect. In the Amazon Connect console, when you create a + // quick connect, you are prompted to assign one of the following types: Agent + // (USER), External (PHONE_NUMBER), or Queue (QUEUE). + QuickConnectType QuickConnectType +} + // A link that an agent selects to complete a given task. You can have up to 4,096 // UTF-8 bytes across all references for a contact. type Reference struct { @@ -862,6 +947,21 @@ type UserPhoneConfig struct { DeskPhoneNumber *string } +// Contains information about the quick connect configuration settings for a user. +// The contact flow must be of type Transfer to Agent. +type UserQuickConnectConfig struct { + + // The identifier of the contact flow. + // + // This member is required. + ContactFlowId *string + + // The identifier of the user. + // + // This member is required. + UserId *string +} + // Contains summary information about a user. type UserSummary struct { diff --git a/service/connect/validators.go b/service/connect/validators.go index 38fda2760d8..b747726cdfd 100644 --- a/service/connect/validators.go +++ b/service/connect/validators.go @@ -190,6 +190,26 @@ func (m *validateOpCreateIntegrationAssociation) HandleInitialize(ctx context.Co return next.HandleInitialize(ctx, in) } +type validateOpCreateQuickConnect struct { +} + +func (*validateOpCreateQuickConnect) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateQuickConnect) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateQuickConnectInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateQuickConnectInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateRoutingProfile struct { } @@ -310,6 +330,26 @@ func (m *validateOpDeleteIntegrationAssociation) HandleInitialize(ctx context.Co return next.HandleInitialize(ctx, in) } +type validateOpDeleteQuickConnect struct { +} + +func (*validateOpDeleteQuickConnect) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteQuickConnect) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteQuickConnectInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteQuickConnectInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteUseCase struct { } @@ -450,6 +490,26 @@ func (m *validateOpDescribeInstanceStorageConfig) HandleInitialize(ctx context.C return next.HandleInitialize(ctx, in) } +type validateOpDescribeQuickConnect struct { +} + +func (*validateOpDescribeQuickConnect) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeQuickConnect) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeQuickConnectInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeQuickConnectInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeRoutingProfile struct { } @@ -950,6 +1010,26 @@ func (m *validateOpListQueues) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpListQuickConnects struct { +} + +func (*validateOpListQuickConnects) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListQuickConnects) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListQuickConnectsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListQuickConnectsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListRoutingProfileQueues struct { } @@ -1410,6 +1490,46 @@ func (m *validateOpUpdateInstanceStorageConfig) HandleInitialize(ctx context.Con return next.HandleInitialize(ctx, in) } +type validateOpUpdateQuickConnectConfig struct { +} + +func (*validateOpUpdateQuickConnectConfig) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateQuickConnectConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateQuickConnectConfigInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateQuickConnectConfigInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateQuickConnectName struct { +} + +func (*validateOpUpdateQuickConnectName) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateQuickConnectName) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateQuickConnectNameInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateQuickConnectNameInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateRoutingProfileConcurrency struct { } @@ -1666,6 +1786,10 @@ func addOpCreateIntegrationAssociationValidationMiddleware(stack *middleware.Sta return stack.Initialize.Add(&validateOpCreateIntegrationAssociation{}, middleware.After) } +func addOpCreateQuickConnectValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateQuickConnect{}, middleware.After) +} + func addOpCreateRoutingProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateRoutingProfile{}, middleware.After) } @@ -1690,6 +1814,10 @@ func addOpDeleteIntegrationAssociationValidationMiddleware(stack *middleware.Sta return stack.Initialize.Add(&validateOpDeleteIntegrationAssociation{}, middleware.After) } +func addOpDeleteQuickConnectValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteQuickConnect{}, middleware.After) +} + func addOpDeleteUseCaseValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteUseCase{}, middleware.After) } @@ -1718,6 +1846,10 @@ func addOpDescribeInstanceStorageConfigValidationMiddleware(stack *middleware.St return stack.Initialize.Add(&validateOpDescribeInstanceStorageConfig{}, middleware.After) } +func addOpDescribeQuickConnectValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeQuickConnect{}, middleware.After) +} + func addOpDescribeRoutingProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeRoutingProfile{}, middleware.After) } @@ -1818,6 +1950,10 @@ func addOpListQueuesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListQueues{}, middleware.After) } +func addOpListQuickConnectsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListQuickConnects{}, middleware.After) +} + func addOpListRoutingProfileQueuesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListRoutingProfileQueues{}, middleware.After) } @@ -1910,6 +2046,14 @@ func addOpUpdateInstanceStorageConfigValidationMiddleware(stack *middleware.Stac return stack.Initialize.Add(&validateOpUpdateInstanceStorageConfig{}, middleware.After) } +func addOpUpdateQuickConnectConfigValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateQuickConnectConfig{}, middleware.After) +} + +func addOpUpdateQuickConnectNameValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateQuickConnectName{}, middleware.After) +} + func addOpUpdateRoutingProfileConcurrencyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateRoutingProfileConcurrency{}, middleware.After) } @@ -2194,6 +2338,69 @@ func validateParticipantDetails(v *types.ParticipantDetails) error { } } +func validatePhoneNumberQuickConnectConfig(v *types.PhoneNumberQuickConnectConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PhoneNumberQuickConnectConfig"} + if v.PhoneNumber == nil { + invalidParams.Add(smithy.NewErrParamRequired("PhoneNumber")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateQueueQuickConnectConfig(v *types.QueueQuickConnectConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QueueQuickConnectConfig"} + if v.QueueId == nil { + invalidParams.Add(smithy.NewErrParamRequired("QueueId")) + } + if v.ContactFlowId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ContactFlowId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateQuickConnectConfig(v *types.QuickConnectConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "QuickConnectConfig"} + if len(v.QuickConnectType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("QuickConnectType")) + } + if v.UserConfig != nil { + if err := validateUserQuickConnectConfig(v.UserConfig); err != nil { + invalidParams.AddNested("UserConfig", err.(smithy.InvalidParamsError)) + } + } + if v.QueueConfig != nil { + if err := validateQueueQuickConnectConfig(v.QueueConfig); err != nil { + invalidParams.AddNested("QueueConfig", err.(smithy.InvalidParamsError)) + } + } + if v.PhoneConfig != nil { + if err := validatePhoneNumberQuickConnectConfig(v.PhoneConfig); err != nil { + invalidParams.AddNested("PhoneConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateReference(v *types.Reference) error { if v == nil { return nil @@ -2321,6 +2528,24 @@ func validateUserPhoneConfig(v *types.UserPhoneConfig) error { } } +func validateUserQuickConnectConfig(v *types.UserQuickConnectConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UserQuickConnectConfig"} + if v.UserId == nil { + invalidParams.Add(smithy.NewErrParamRequired("UserId")) + } + if v.ContactFlowId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ContactFlowId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpAssociateApprovedOriginInput(v *AssociateApprovedOriginInput) error { if v == nil { return nil @@ -2518,6 +2743,31 @@ func validateOpCreateIntegrationAssociationInput(v *CreateIntegrationAssociation } } +func validateOpCreateQuickConnectInput(v *CreateQuickConnectInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateQuickConnectInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.QuickConnectConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("QuickConnectConfig")) + } else if v.QuickConnectConfig != nil { + if err := validateQuickConnectConfig(v.QuickConnectConfig); err != nil { + invalidParams.AddNested("QuickConnectConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateRoutingProfileInput(v *CreateRoutingProfileInput) error { if v == nil { return nil @@ -2657,6 +2907,24 @@ func validateOpDeleteIntegrationAssociationInput(v *DeleteIntegrationAssociation } } +func validateOpDeleteQuickConnectInput(v *DeleteQuickConnectInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteQuickConnectInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if v.QuickConnectId == nil { + invalidParams.Add(smithy.NewErrParamRequired("QuickConnectId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteUseCaseInput(v *DeleteUseCaseInput) error { if v == nil { return nil @@ -2786,6 +3054,24 @@ func validateOpDescribeInstanceStorageConfigInput(v *DescribeInstanceStorageConf } } +func validateOpDescribeQuickConnectInput(v *DescribeQuickConnectInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeQuickConnectInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if v.QuickConnectId == nil { + invalidParams.Add(smithy.NewErrParamRequired("QuickConnectId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeRoutingProfileInput(v *DescribeRoutingProfileInput) error { if v == nil { return nil @@ -3225,6 +3511,21 @@ func validateOpListQueuesInput(v *ListQueuesInput) error { } } +func validateOpListQuickConnectsInput(v *ListQuickConnectsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListQuickConnectsInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListRoutingProfileQueuesInput(v *ListRoutingProfileQueuesInput) error { if v == nil { return nil @@ -3678,6 +3979,49 @@ func validateOpUpdateInstanceStorageConfigInput(v *UpdateInstanceStorageConfigIn } } +func validateOpUpdateQuickConnectConfigInput(v *UpdateQuickConnectConfigInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateQuickConnectConfigInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if v.QuickConnectId == nil { + invalidParams.Add(smithy.NewErrParamRequired("QuickConnectId")) + } + if v.QuickConnectConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("QuickConnectConfig")) + } else if v.QuickConnectConfig != nil { + if err := validateQuickConnectConfig(v.QuickConnectConfig); err != nil { + invalidParams.AddNested("QuickConnectConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateQuickConnectNameInput(v *UpdateQuickConnectNameInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateQuickConnectNameInput"} + if v.InstanceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InstanceId")) + } + if v.QuickConnectId == nil { + invalidParams.Add(smithy.NewErrParamRequired("QuickConnectId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateRoutingProfileConcurrencyInput(v *UpdateRoutingProfileConcurrencyInput) error { if v == nil { return nil diff --git a/service/connectparticipant/api_op_CompleteAttachmentUpload.go b/service/connectparticipant/api_op_CompleteAttachmentUpload.go new file mode 100644 index 00000000000..38c741eb7bd --- /dev/null +++ b/service/connectparticipant/api_op_CompleteAttachmentUpload.go @@ -0,0 +1,158 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectparticipant + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Allows you to confirm that the attachment has been uploaded using the pre-signed +// URL provided in StartAttachmentUpload API. +func (c *Client) CompleteAttachmentUpload(ctx context.Context, params *CompleteAttachmentUploadInput, optFns ...func(*Options)) (*CompleteAttachmentUploadOutput, error) { + if params == nil { + params = &CompleteAttachmentUploadInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CompleteAttachmentUpload", params, optFns, addOperationCompleteAttachmentUploadMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CompleteAttachmentUploadOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CompleteAttachmentUploadInput struct { + + // A list of unique identifiers for the attachments. + // + // This member is required. + AttachmentIds []string + + // A unique, case-sensitive identifier that you provide to ensure the idempotency + // of the request. + // + // This member is required. + ClientToken *string + + // The authentication token associated with the participant's connection. + // + // This member is required. + ConnectionToken *string +} + +type CompleteAttachmentUploadOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCompleteAttachmentUploadMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCompleteAttachmentUpload{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCompleteAttachmentUpload{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opCompleteAttachmentUploadMiddleware(stack, options); err != nil { + return err + } + if err = addOpCompleteAttachmentUploadValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCompleteAttachmentUpload(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpCompleteAttachmentUpload struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCompleteAttachmentUpload) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCompleteAttachmentUpload) 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.(*CompleteAttachmentUploadInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CompleteAttachmentUploadInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCompleteAttachmentUploadMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCompleteAttachmentUpload{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCompleteAttachmentUpload(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "execute-api", + OperationName: "CompleteAttachmentUpload", + } +} diff --git a/service/connectparticipant/api_op_CreateParticipantConnection.go b/service/connectparticipant/api_op_CreateParticipantConnection.go index c574d85b354..620a0831f54 100644 --- a/service/connectparticipant/api_op_CreateParticipantConnection.go +++ b/service/connectparticipant/api_op_CreateParticipantConnection.go @@ -13,14 +13,16 @@ import ( // Creates the participant's connection. Note that ParticipantToken is used for // invoking this API instead of ConnectionToken. The participant token is valid for -// the lifetime of the participant – until the they are part of a contact. The -// response URL for WEBSOCKET Type has a connect expiry timeout of 100s. Clients -// must manually connect to the returned websocket URL and subscribe to the desired +// the lifetime of the participant – until they are part of a contact. The response +// URL for WEBSOCKET Type has a connect expiry timeout of 100s. Clients must +// manually connect to the returned websocket URL and subscribe to the desired // topic. For chat, you need to publish the following on the established websocket // connection: {"topic":"aws/subscribe","content":{"topics":["aws/chat"]}} Upon // websocket URL expiry, as specified in the response ConnectionExpiry parameter, // clients need to call this API again to obtain a new websocket URL and perform -// the same steps as before. +// the same steps as before. The Amazon Connect Participant Service APIs do not use +// Signature Version 4 authentication +// (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). func (c *Client) CreateParticipantConnection(ctx context.Context, params *CreateParticipantConnectionInput, optFns ...func(*Options)) (*CreateParticipantConnectionOutput, error) { if params == nil { params = &CreateParticipantConnectionInput{} @@ -38,8 +40,9 @@ func (c *Client) CreateParticipantConnection(ctx context.Context, params *Create type CreateParticipantConnectionInput struct { - // Participant Token as obtained from StartChatContact - // (https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContactResponse.html) + // This is a header parameter. The Participant Token as obtained from + // StartChatContact + // (https://docs.aws.amazon.com/connect/latest/APIReference/API_StartChatContact.html) // API response. // // This member is required. diff --git a/service/connectparticipant/api_op_DisconnectParticipant.go b/service/connectparticipant/api_op_DisconnectParticipant.go index bd30f1b5694..0e03fa1ce3e 100644 --- a/service/connectparticipant/api_op_DisconnectParticipant.go +++ b/service/connectparticipant/api_op_DisconnectParticipant.go @@ -12,7 +12,9 @@ import ( ) // Disconnects a participant. Note that ConnectionToken is used for invoking this -// API instead of ParticipantToken. +// API instead of ParticipantToken. The Amazon Connect Participant Service APIs do +// not use Signature Version 4 authentication +// (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). func (c *Client) DisconnectParticipant(ctx context.Context, params *DisconnectParticipantInput, optFns ...func(*Options)) (*DisconnectParticipantOutput, error) { if params == nil { params = &DisconnectParticipantInput{} diff --git a/service/connectparticipant/api_op_GetAttachment.go b/service/connectparticipant/api_op_GetAttachment.go new file mode 100644 index 00000000000..40ea420e50e --- /dev/null +++ b/service/connectparticipant/api_op_GetAttachment.go @@ -0,0 +1,124 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectparticipant + +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" +) + +// Provides a pre-signed URL for download of a completed attachment. This is an +// asynchronous API for use with active contacts. +func (c *Client) GetAttachment(ctx context.Context, params *GetAttachmentInput, optFns ...func(*Options)) (*GetAttachmentOutput, error) { + if params == nil { + params = &GetAttachmentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAttachment", params, optFns, addOperationGetAttachmentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAttachmentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetAttachmentInput struct { + + // A unique identifier for the attachment. + // + // This member is required. + AttachmentId *string + + // The authentication token associated with the participant's connection. + // + // This member is required. + ConnectionToken *string +} + +type GetAttachmentOutput struct { + + // The pre-signed URL using which file would be downloaded from Amazon S3 by the + // API caller. + Url *string + + // The expiration time of the URL in ISO timestamp. It's specified in ISO 8601 + // format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z. + UrlExpiry *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetAttachmentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetAttachment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetAttachment{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetAttachmentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAttachment(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetAttachment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "execute-api", + OperationName: "GetAttachment", + } +} diff --git a/service/connectparticipant/api_op_GetTranscript.go b/service/connectparticipant/api_op_GetTranscript.go index 26bcd12aa63..35c431097e2 100644 --- a/service/connectparticipant/api_op_GetTranscript.go +++ b/service/connectparticipant/api_op_GetTranscript.go @@ -12,8 +12,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves a transcript of the session. Note that ConnectionToken is used for -// invoking this API instead of ParticipantToken. +// Retrieves a transcript of the session, including details about any attachments. +// Note that ConnectionToken is used for invoking this API instead of +// ParticipantToken. The Amazon Connect Participant Service APIs do not use +// Signature Version 4 authentication +// (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). func (c *Client) GetTranscript(ctx context.Context, params *GetTranscriptInput, optFns ...func(*Options)) (*GetTranscriptOutput, error) { if params == nil { params = &GetTranscriptInput{} diff --git a/service/connectparticipant/api_op_SendEvent.go b/service/connectparticipant/api_op_SendEvent.go index 988e38ce0e0..fe943104b21 100644 --- a/service/connectparticipant/api_op_SendEvent.go +++ b/service/connectparticipant/api_op_SendEvent.go @@ -12,7 +12,9 @@ import ( ) // Sends an event. Note that ConnectionToken is used for invoking this API instead -// of ParticipantToken. +// of ParticipantToken. The Amazon Connect Participant Service APIs do not use +// Signature Version 4 authentication +// (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). func (c *Client) SendEvent(ctx context.Context, params *SendEventInput, optFns ...func(*Options)) (*SendEventOutput, error) { if params == nil { params = &SendEventInput{} diff --git a/service/connectparticipant/api_op_SendMessage.go b/service/connectparticipant/api_op_SendMessage.go index 871d17b539b..8c25d54eaec 100644 --- a/service/connectparticipant/api_op_SendMessage.go +++ b/service/connectparticipant/api_op_SendMessage.go @@ -12,7 +12,9 @@ import ( ) // Sends a message. Note that ConnectionToken is used for invoking this API instead -// of ParticipantToken. +// of ParticipantToken. The Amazon Connect Participant Service APIs do not use +// Signature Version 4 authentication +// (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). func (c *Client) SendMessage(ctx context.Context, params *SendMessageInput, optFns ...func(*Options)) (*SendMessageOutput, error) { if params == nil { params = &SendMessageInput{} diff --git a/service/connectparticipant/api_op_StartAttachmentUpload.go b/service/connectparticipant/api_op_StartAttachmentUpload.go new file mode 100644 index 00000000000..1645c32dfcf --- /dev/null +++ b/service/connectparticipant/api_op_StartAttachmentUpload.go @@ -0,0 +1,178 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package connectparticipant + +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/connectparticipant/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Provides a pre-signed Amazon S3 URL in response for uploading the file directly +// to S3. +func (c *Client) StartAttachmentUpload(ctx context.Context, params *StartAttachmentUploadInput, optFns ...func(*Options)) (*StartAttachmentUploadOutput, error) { + if params == nil { + params = &StartAttachmentUploadInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartAttachmentUpload", params, optFns, addOperationStartAttachmentUploadMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartAttachmentUploadOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartAttachmentUploadInput struct { + + // A case-sensitive name of the attachment being uploaded. + // + // This member is required. + AttachmentName *string + + // The size of the attachment in bytes. + // + // This member is required. + AttachmentSizeInBytes int64 + + // A unique case sensitive identifier to support idempotency of request. + // + // This member is required. + ClientToken *string + + // The authentication token associated with the participant's connection. + // + // This member is required. + ConnectionToken *string + + // Describes the MIME file type of the attachment. For a list of supported file + // types, see Feature specifications + // (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html#feature-limits) + // in the Amazon Connect Administrator Guide. + // + // This member is required. + ContentType *string +} + +type StartAttachmentUploadOutput struct { + + // A unique identifier for the attachment. + AttachmentId *string + + // Fields to be used while uploading the attachment. + UploadMetadata *types.UploadMetadata + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationStartAttachmentUploadMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartAttachmentUpload{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartAttachmentUpload{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opStartAttachmentUploadMiddleware(stack, options); err != nil { + return err + } + if err = addOpStartAttachmentUploadValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartAttachmentUpload(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpStartAttachmentUpload struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpStartAttachmentUpload) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpStartAttachmentUpload) 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.(*StartAttachmentUploadInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *StartAttachmentUploadInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opStartAttachmentUploadMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpStartAttachmentUpload{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opStartAttachmentUpload(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "execute-api", + OperationName: "StartAttachmentUpload", + } +} diff --git a/service/connectparticipant/deserializers.go b/service/connectparticipant/deserializers.go index b468d36c310..fe7a2b4a034 100644 --- a/service/connectparticipant/deserializers.go +++ b/service/connectparticipant/deserializers.go @@ -18,6 +18,104 @@ import ( "strings" ) +type awsRestjson1_deserializeOpCompleteAttachmentUpload struct { +} + +func (*awsRestjson1_deserializeOpCompleteAttachmentUpload) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCompleteAttachmentUpload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCompleteAttachmentUpload(response, &metadata) + } + output := &CompleteAttachmentUploadOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCompleteAttachmentUpload(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpCreateParticipantConnection struct { } @@ -271,6 +369,175 @@ func awsRestjson1_deserializeOpErrorDisconnectParticipant(response *smithyhttp.R } } +type awsRestjson1_deserializeOpGetAttachment struct { +} + +func (*awsRestjson1_deserializeOpGetAttachment) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetAttachment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetAttachment(response, &metadata) + } + output := &GetAttachmentOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetAttachmentOutput(&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_deserializeOpErrorGetAttachment(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetAttachmentOutput(v **GetAttachmentOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetAttachmentOutput + if *v == nil { + sv = &GetAttachmentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Url": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PreSignedAttachmentUrl to be of type string, got %T instead", value) + } + sv.Url = ptr.String(jtv) + } + + case "UrlExpiry": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ISO8601Datetime to be of type string, got %T instead", value) + } + sv.UrlExpiry = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpGetTranscript struct { } @@ -783,18 +1050,186 @@ func awsRestjson1_deserializeOpDocumentSendMessageOutput(v **SendMessageOutput, return nil } -func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.AccessDeniedException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) +type awsRestjson1_deserializeOpStartAttachmentUpload struct { +} - 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) +func (*awsRestjson1_deserializeOpStartAttachmentUpload) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartAttachmentUpload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorStartAttachmentUpload(response, &metadata) + } + output := &StartAttachmentUploadOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentStartAttachmentUploadOutput(&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_deserializeOpErrorStartAttachmentUpload(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentStartAttachmentUploadOutput(v **StartAttachmentUploadOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartAttachmentUploadOutput + if *v == nil { + sv = &StartAttachmentUploadOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AttachmentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ArtifactId to be of type string, got %T instead", value) + } + sv.AttachmentId = ptr.String(jtv) + } + + case "UploadMetadata": + if err := awsRestjson1_deserializeDocumentUploadMetadata(&sv.UploadMetadata, 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(), @@ -819,6 +1254,42 @@ func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Res return output } +func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InternalServerException{} var buff [1024]byte @@ -855,6 +1326,42 @@ func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.R return output } +func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceQuotaExceededException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ThrottlingException{} var buff [1024]byte @@ -967,6 +1474,147 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie return nil } +func awsRestjson1_deserializeDocumentAttachmentItem(v **types.AttachmentItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AttachmentItem + if *v == nil { + sv = &types.AttachmentItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AttachmentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ArtifactId to be of type string, got %T instead", value) + } + sv.AttachmentId = ptr.String(jtv) + } + + case "AttachmentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AttachmentName to be of type string, got %T instead", value) + } + sv.AttachmentName = ptr.String(jtv) + } + + case "ContentType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContentType to be of type string, got %T instead", value) + } + sv.ContentType = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ArtifactStatus to be of type string, got %T instead", value) + } + sv.Status = types.ArtifactStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAttachments(v *[]types.AttachmentItem, 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.AttachmentItem + if *v == nil { + cv = []types.AttachmentItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AttachmentItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentAttachmentItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Reason to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentConnectionCredentials(v **types.ConnectionCredentials, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -1087,6 +1735,11 @@ func awsRestjson1_deserializeDocumentItem(v **types.Item, value interface{}) err sv.AbsoluteTime = ptr.String(jtv) } + case "Attachments": + if err := awsRestjson1_deserializeDocumentAttachments(&sv.Attachments, value); err != nil { + return err + } + case "Content": if value != nil { jtv, ok := value.(string) @@ -1159,6 +1812,46 @@ func awsRestjson1_deserializeDocumentItem(v **types.Item, value interface{}) err return nil } +func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ServiceQuotaExceededException + if *v == nil { + sv = &types.ServiceQuotaExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = 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) @@ -1233,6 +1926,96 @@ func awsRestjson1_deserializeDocumentTranscript(v *[]types.Item, value interface return nil } +func awsRestjson1_deserializeDocumentUploadMetadata(v **types.UploadMetadata, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UploadMetadata + if *v == nil { + sv = &types.UploadMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "HeadersToInclude": + if err := awsRestjson1_deserializeDocumentUploadMetadataSignedHeaders(&sv.HeadersToInclude, value); err != nil { + return err + } + + case "Url": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UploadMetadataUrl to be of type string, got %T instead", value) + } + sv.Url = ptr.String(jtv) + } + + case "UrlExpiry": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ISO8601Datetime to be of type string, got %T instead", value) + } + sv.UrlExpiry = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUploadMetadataSignedHeaders(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 UploadMetadataSignedHeadersValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/connectparticipant/serializers.go b/service/connectparticipant/serializers.go index 17ee7b930a2..96c9806098d 100644 --- a/service/connectparticipant/serializers.go +++ b/service/connectparticipant/serializers.go @@ -14,6 +14,95 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +type awsRestjson1_serializeOpCompleteAttachmentUpload struct { +} + +func (*awsRestjson1_serializeOpCompleteAttachmentUpload) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCompleteAttachmentUpload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CompleteAttachmentUploadInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/participant/complete-attachment-upload") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsCompleteAttachmentUploadInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCompleteAttachmentUploadInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCompleteAttachmentUploadInput(v *CompleteAttachmentUploadInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ConnectionToken != nil && len(*v.ConnectionToken) > 0 { + locationName := "X-Amz-Bearer" + encoder.SetHeader(locationName).String(*v.ConnectionToken) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCompleteAttachmentUploadInput(v *CompleteAttachmentUploadInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AttachmentIds != nil { + ok := object.Key("AttachmentIds") + if err := awsRestjson1_serializeDocumentAttachmentIdList(v.AttachmentIds, ok); err != nil { + return err + } + } + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + return nil +} + type awsRestjson1_serializeOpCreateParticipantConnection struct { } @@ -180,6 +269,88 @@ func awsRestjson1_serializeOpDocumentDisconnectParticipantInput(v *DisconnectPar return nil } +type awsRestjson1_serializeOpGetAttachment struct { +} + +func (*awsRestjson1_serializeOpGetAttachment) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetAttachment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetAttachmentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/participant/attachment") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetAttachmentInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentGetAttachmentInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsGetAttachmentInput(v *GetAttachmentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ConnectionToken != nil && len(*v.ConnectionToken) > 0 { + locationName := "X-Amz-Bearer" + encoder.SetHeader(locationName).String(*v.ConnectionToken) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGetAttachmentInput(v *GetAttachmentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AttachmentId != nil { + ok := object.Key("AttachmentId") + ok.String(*v.AttachmentId) + } + + return nil +} + type awsRestjson1_serializeOpGetTranscript struct { } @@ -473,6 +644,114 @@ func awsRestjson1_serializeOpDocumentSendMessageInput(v *SendMessageInput, value return nil } +type awsRestjson1_serializeOpStartAttachmentUpload struct { +} + +func (*awsRestjson1_serializeOpStartAttachmentUpload) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartAttachmentUpload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartAttachmentUploadInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/participant/start-attachment-upload") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsStartAttachmentUploadInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentStartAttachmentUploadInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsStartAttachmentUploadInput(v *StartAttachmentUploadInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ConnectionToken != nil && len(*v.ConnectionToken) > 0 { + locationName := "X-Amz-Bearer" + encoder.SetHeader(locationName).String(*v.ConnectionToken) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartAttachmentUploadInput(v *StartAttachmentUploadInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AttachmentName != nil { + ok := object.Key("AttachmentName") + ok.String(*v.AttachmentName) + } + + if v.AttachmentSizeInBytes != 0 { + ok := object.Key("AttachmentSizeInBytes") + ok.Long(v.AttachmentSizeInBytes) + } + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.ContentType != nil { + ok := object.Key("ContentType") + ok.String(*v.ContentType) + } + + return nil +} + +func awsRestjson1_serializeDocumentAttachmentIdList(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_serializeDocumentConnectionTypeList(v []types.ConnectionType, value smithyjson.Value) error { array := value.Array() defer array.Close() diff --git a/service/connectparticipant/types/enums.go b/service/connectparticipant/types/enums.go index 429e84e173c..7dc6def6720 100644 --- a/service/connectparticipant/types/enums.go +++ b/service/connectparticipant/types/enums.go @@ -2,13 +2,40 @@ package types +type ArtifactStatus string + +// Enum values for ArtifactStatus +const ( + ArtifactStatusApproved ArtifactStatus = "APPROVED" + ArtifactStatusRejected ArtifactStatus = "REJECTED" + ArtifactStatusInProgress ArtifactStatus = "IN_PROGRESS" +) + +// Values returns all known values for ArtifactStatus. 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 (ArtifactStatus) Values() []ArtifactStatus { + return []ArtifactStatus{ + "APPROVED", + "REJECTED", + "IN_PROGRESS", + } +} + type ChatItemType string // Enum values for ChatItemType const ( - ChatItemTypeMessage ChatItemType = "MESSAGE" - ChatItemTypeEvent ChatItemType = "EVENT" - ChatItemTypeConnectionAck ChatItemType = "CONNECTION_ACK" + ChatItemTypeTyping ChatItemType = "TYPING" + ChatItemTypeParticipantJoined ChatItemType = "PARTICIPANT_JOINED" + ChatItemTypeParticipantLeft ChatItemType = "PARTICIPANT_LEFT" + ChatItemTypeChatEnded ChatItemType = "CHAT_ENDED" + ChatItemTypeTransferSucceeded ChatItemType = "TRANSFER_SUCCEEDED" + ChatItemTypeTransferFailed ChatItemType = "TRANSFER_FAILED" + ChatItemTypeMessage ChatItemType = "MESSAGE" + ChatItemTypeEvent ChatItemType = "EVENT" + ChatItemTypeAttachment ChatItemType = "ATTACHMENT" + ChatItemTypeConnectionAck ChatItemType = "CONNECTION_ACK" ) // Values returns all known values for ChatItemType. Note that this can be expanded @@ -16,8 +43,15 @@ const ( // this slice is not guaranteed to be stable across updates. func (ChatItemType) Values() []ChatItemType { return []ChatItemType{ + "TYPING", + "PARTICIPANT_JOINED", + "PARTICIPANT_LEFT", + "CHAT_ENDED", + "TRANSFER_SUCCEEDED", + "TRANSFER_FAILED", "MESSAGE", "EVENT", + "ATTACHMENT", "CONNECTION_ACK", } } diff --git a/service/connectparticipant/types/errors.go b/service/connectparticipant/types/errors.go index f7826281f4f..332ebc17a84 100644 --- a/service/connectparticipant/types/errors.go +++ b/service/connectparticipant/types/errors.go @@ -24,6 +24,23 @@ func (e *AccessDeniedException) ErrorMessage() string { func (e *AccessDeniedException) ErrorCode() string { return "AccessDeniedException" } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// An attachment with that identifier is already being uploaded. +type ConflictException struct { + Message *string +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { return "ConflictException" } +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // This exception occurs when there is an internal failure in the Amazon Connect // service. type InternalServerException struct { @@ -42,6 +59,23 @@ func (e *InternalServerException) ErrorMessage() string { func (e *InternalServerException) ErrorCode() string { return "InternalServerException" } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } +// The number of attachments per contact exceeds the quota. +type ServiceQuotaExceededException struct { + Message *string +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { return "ServiceQuotaExceededException" } +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The request was denied due to request throttling. type ThrottlingException struct { Message *string diff --git a/service/connectparticipant/types/types.go b/service/connectparticipant/types/types.go index 759caa90dfe..76df942060d 100644 --- a/service/connectparticipant/types/types.go +++ b/service/connectparticipant/types/types.go @@ -2,6 +2,26 @@ package types +// The case-insensitive input to indicate standard MIME type that describes the +// format of the file that will be uploaded. +type AttachmentItem struct { + + // A unique identifier for the attachment. + AttachmentId *string + + // A case-sensitive name of the attachment being uploaded. + AttachmentName *string + + // Describes the MIME file type of the attachment. For a list of supported file + // types, see Feature specifications + // (https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-service-limits.html#feature-limits) + // in the Amazon Connect Administrator Guide. + ContentType *string + + // Status of the attachment. + Status ArtifactStatus +} + // Connection credentials. type ConnectionCredentials struct { @@ -20,6 +40,9 @@ type Item struct { // yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z. AbsoluteTime *string + // Provides information about the attachments. + Attachments []AttachmentItem + // The content of the message or event. Content *string @@ -57,6 +80,21 @@ type StartPosition struct { MostRecent int32 } +// Fields to be used while uploading the attachment. +type UploadMetadata struct { + + // The headers to be provided while uploading the file to the URL. + HeadersToInclude map[string]string + + // The pre-signed URL using which file would be downloaded from Amazon S3 by the + // API caller. + Url *string + + // The expiration time of the URL in ISO timestamp. It's specified in ISO 8601 + // format: yyyy-MM-ddThh:mm:ss.SSSZ. For example, 2019-11-08T02:41:28.172Z. + UrlExpiry *string +} + // The websocket for the participant's connection. type Websocket struct { diff --git a/service/connectparticipant/validators.go b/service/connectparticipant/validators.go index 40476f8e656..5fdbac15be0 100644 --- a/service/connectparticipant/validators.go +++ b/service/connectparticipant/validators.go @@ -9,6 +9,26 @@ import ( "github.com/aws/smithy-go/middleware" ) +type validateOpCompleteAttachmentUpload struct { +} + +func (*validateOpCompleteAttachmentUpload) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCompleteAttachmentUpload) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CompleteAttachmentUploadInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCompleteAttachmentUploadInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateParticipantConnection struct { } @@ -49,6 +69,26 @@ func (m *validateOpDisconnectParticipant) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpGetAttachment struct { +} + +func (*validateOpGetAttachment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetAttachment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetAttachmentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetAttachmentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetTranscript struct { } @@ -109,6 +149,30 @@ func (m *validateOpSendMessage) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpStartAttachmentUpload struct { +} + +func (*validateOpStartAttachmentUpload) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartAttachmentUpload) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartAttachmentUploadInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartAttachmentUploadInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCompleteAttachmentUploadValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCompleteAttachmentUpload{}, middleware.After) +} + func addOpCreateParticipantConnectionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateParticipantConnection{}, middleware.After) } @@ -117,6 +181,10 @@ func addOpDisconnectParticipantValidationMiddleware(stack *middleware.Stack) err return stack.Initialize.Add(&validateOpDisconnectParticipant{}, middleware.After) } +func addOpGetAttachmentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetAttachment{}, middleware.After) +} + func addOpGetTranscriptValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetTranscript{}, middleware.After) } @@ -129,6 +197,31 @@ func addOpSendMessageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSendMessage{}, middleware.After) } +func addOpStartAttachmentUploadValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartAttachmentUpload{}, middleware.After) +} + +func validateOpCompleteAttachmentUploadInput(v *CompleteAttachmentUploadInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CompleteAttachmentUploadInput"} + if v.AttachmentIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("AttachmentIds")) + } + if v.ClientToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientToken")) + } + if v.ConnectionToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectionToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateParticipantConnectionInput(v *CreateParticipantConnectionInput) error { if v == nil { return nil @@ -162,6 +255,24 @@ func validateOpDisconnectParticipantInput(v *DisconnectParticipantInput) error { } } +func validateOpGetAttachmentInput(v *GetAttachmentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetAttachmentInput"} + if v.AttachmentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AttachmentId")) + } + if v.ConnectionToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectionToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetTranscriptInput(v *GetTranscriptInput) error { if v == nil { return nil @@ -215,3 +326,27 @@ func validateOpSendMessageInput(v *SendMessageInput) error { return nil } } + +func validateOpStartAttachmentUploadInput(v *StartAttachmentUploadInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartAttachmentUploadInput"} + if v.ContentType == nil { + invalidParams.Add(smithy.NewErrParamRequired("ContentType")) + } + if v.AttachmentName == nil { + invalidParams.Add(smithy.NewErrParamRequired("AttachmentName")) + } + if v.ClientToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientToken")) + } + if v.ConnectionToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectionToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/costexplorer/api_op_UpdateAnomalySubscription.go b/service/costexplorer/api_op_UpdateAnomalySubscription.go index 0bba9746efc..ef3934898e0 100644 --- a/service/costexplorer/api_op_UpdateAnomalySubscription.go +++ b/service/costexplorer/api_op_UpdateAnomalySubscription.go @@ -38,7 +38,7 @@ type UpdateAnomalySubscriptionInput struct { // notifications. Frequency types.AnomalySubscriptionFrequency - // A list of cost anomaly subscription ARNs. + // A list of cost anomaly monitor ARNs. MonitorArnList []string // The update to the subscriber list. diff --git a/service/costexplorer/deserializers.go b/service/costexplorer/deserializers.go index 30c10fa72ad..9572a83f813 100644 --- a/service/costexplorer/deserializers.go +++ b/service/costexplorer/deserializers.go @@ -4109,7 +4109,7 @@ func awsAwsjson11_deserializeDocumentAnomalySubscription(v **types.AnomalySubscr } case "MonitorArnList": - if err := awsAwsjson11_deserializeDocumentValues(&sv.MonitorArnList, value); err != nil { + if err := awsAwsjson11_deserializeDocumentMonitorArnList(&sv.MonitorArnList, value); err != nil { return err } @@ -6643,6 +6643,42 @@ func awsAwsjson11_deserializeDocumentModifyRecommendationDetail(v **types.Modify return nil } +func awsAwsjson11_deserializeDocumentMonitorArnList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentRDSInstanceDetails(v **types.RDSInstanceDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8021,6 +8057,15 @@ func awsAwsjson11_deserializeDocumentRightsizingRecommendationMetadata(v **types for key, value := range shape { switch key { + case "AdditionalMetadata": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.AdditionalMetadata = ptr.String(jtv) + } + case "GenerationTimestamp": if value != nil { jtv, ok := value.(string) diff --git a/service/costexplorer/serializers.go b/service/costexplorer/serializers.go index 428ce4f308b..ed754e29ea0 100644 --- a/service/costexplorer/serializers.go +++ b/service/costexplorer/serializers.go @@ -1434,7 +1434,7 @@ func awsAwsjson11_serializeDocumentAnomalySubscription(v *types.AnomalySubscript if v.MonitorArnList != nil { ok := object.Key("MonitorArnList") - if err := awsAwsjson11_serializeDocumentValues(v.MonitorArnList, ok); err != nil { + if err := awsAwsjson11_serializeDocumentMonitorArnList(v.MonitorArnList, ok); err != nil { return err } } @@ -1691,6 +1691,17 @@ func awsAwsjson11_serializeDocumentMetricNames(v []string, value smithyjson.Valu return nil } +func awsAwsjson11_serializeDocumentMonitorArnList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentRightsizingRecommendationConfiguration(v *types.RightsizingRecommendationConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2636,7 +2647,7 @@ func awsAwsjson11_serializeOpDocumentUpdateAnomalySubscriptionInput(v *UpdateAno if v.MonitorArnList != nil { ok := object.Key("MonitorArnList") - if err := awsAwsjson11_serializeDocumentValues(v.MonitorArnList, ok); err != nil { + if err := awsAwsjson11_serializeDocumentMonitorArnList(v.MonitorArnList, ok); err != nil { return err } } diff --git a/service/costexplorer/types/types.go b/service/costexplorer/types/types.go index 80e1d9bd976..9373cf5ffdb 100644 --- a/service/costexplorer/types/types.go +++ b/service/costexplorer/types/types.go @@ -1071,6 +1071,9 @@ type RightsizingRecommendationConfiguration struct { // Metadata for this recommendation set. type RightsizingRecommendationMetadata struct { + // Additional metadata that may be applicable to the recommendation. + AdditionalMetadata *string + // The timestamp for when AWS made this recommendation. GenerationTimestamp *string diff --git a/service/customerprofiles/LICENSE.txt b/service/customerprofiles/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/customerprofiles/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/service/customerprofiles/api_client.go b/service/customerprofiles/api_client.go new file mode 100644 index 00000000000..b505adc18fb --- /dev/null +++ b/service/customerprofiles/api_client.go @@ -0,0 +1,235 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + 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" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "time" +) + +const ServiceID = "Customer Profiles" +const ServiceAPIVersion = "2020-08-15" + +// Client provides the API client to make operations call for Amazon Connect +// Customer Profiles. +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) + + 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 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 + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. + Retryer retry.Retryer + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient +} + +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) { + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + for _, fn := range optFns { + fn(&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 +} + +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) +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + Retryer: cfg.Retryer, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + } + resolveAWSEndpointResolver(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + if o.HTTPClient != nil { + return + } + o.HTTPClient = awshttp.NewBuildableClient() +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + o.Retryer = retry.NewStandard() +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil { + return + } + o.EndpointResolver = WithEndpointResolver(cfg.EndpointResolver, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddUserAgentKey("customerprofiles")(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) +} + +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) +} diff --git a/service/customerprofiles/api_op_AddProfileKey.go b/service/customerprofiles/api_op_AddProfileKey.go new file mode 100644 index 00000000000..65d978ad568 --- /dev/null +++ b/service/customerprofiles/api_op_AddProfileKey.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Associates a new key value with a specific profile, such as a Contact Trace +// Record (CTR) ContactId. A profile object can have a single unique key and any +// number of additional keys that can be used to identify the profile that it +// belongs to. +func (c *Client) AddProfileKey(ctx context.Context, params *AddProfileKeyInput, optFns ...func(*Options)) (*AddProfileKeyOutput, error) { + if params == nil { + params = &AddProfileKeyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AddProfileKey", params, optFns, addOperationAddProfileKeyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AddProfileKeyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AddProfileKeyInput struct { + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // A searchable identifier of a customer profile. + // + // This member is required. + KeyName *string + + // The unique identifier of a customer profile. + // + // This member is required. + ProfileId *string + + // A list of key values. + // + // This member is required. + Values []string +} + +type AddProfileKeyOutput struct { + + // A searchable identifier of a customer profile. + KeyName *string + + // A list of key values. + Values []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationAddProfileKeyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpAddProfileKey{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAddProfileKey{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpAddProfileKeyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAddProfileKey(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opAddProfileKey(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "AddProfileKey", + } +} diff --git a/service/customerprofiles/api_op_CreateDomain.go b/service/customerprofiles/api_op_CreateDomain.go new file mode 100644 index 00000000000..7d18faf0615 --- /dev/null +++ b/service/customerprofiles/api_op_CreateDomain.go @@ -0,0 +1,166 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +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" +) + +// Creates a domain, which is a container for all customer data, such as customer +// profile attributes, object types, profile keys, and encryption keys. You can +// create multiple domains, and each domain can have multiple third-party +// integrations. Each Amazon Connect instance can be associated with only one +// domain. Multiple Amazon Connect instances can be associated with one domain. +func (c *Client) CreateDomain(ctx context.Context, params *CreateDomainInput, optFns ...func(*Options)) (*CreateDomainOutput, error) { + if params == nil { + params = &CreateDomainInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDomain", params, optFns, addOperationCreateDomainMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDomainOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDomainInput struct { + + // The default number of days until the data within the domain expires. + // + // This member is required. + DefaultExpirationDays *int32 + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // The URL of the SQS dead letter queue, which is used for reporting errors + // associated with ingesting data from third party applications. You must set up a + // policy on the DeadLetterQueue for the SendMessage operation to enable Amazon + // Connect Customer Profiles to send messages to the DeadLetterQueue. + DeadLetterQueueUrl *string + + // The default encryption key, which is an AWS managed key, is used when no + // specific type of encryption key is specified. It is used to encrypt all data + // before it is placed in permanent or semi-permanent storage. + DefaultEncryptionKey *string + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string +} + +type CreateDomainOutput struct { + + // The timestamp of when the domain was created. + // + // This member is required. + CreatedAt *time.Time + + // The default number of days until the data within the domain expires. + // + // This member is required. + DefaultExpirationDays *int32 + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // The timestamp of when the domain was most recently edited. + // + // This member is required. + LastUpdatedAt *time.Time + + // The URL of the SQS dead letter queue, which is used for reporting errors + // associated with ingesting data from third party applications. + DeadLetterQueueUrl *string + + // The default encryption key, which is an AWS managed key, is used when no + // specific type of encryption key is specified. It is used to encrypt all data + // before it is placed in permanent or semi-permanent storage. + DefaultEncryptionKey *string + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCreateDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateDomain{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateDomain{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateDomainValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDomain(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opCreateDomain(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "CreateDomain", + } +} diff --git a/service/customerprofiles/api_op_CreateProfile.go b/service/customerprofiles/api_op_CreateProfile.go new file mode 100644 index 00000000000..d99c734a0e4 --- /dev/null +++ b/service/customerprofiles/api_op_CreateProfile.go @@ -0,0 +1,183 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +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/customerprofiles/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a standard profile. A standard profile represents the following +// attributes for a customer profile in a domain. +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, addOperationCreateProfileMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateProfileOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateProfileInput struct { + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // A unique account number that you have given to the customer. + AccountNumber *string + + // Any additional information relevant to the customer's profile. + AdditionalInformation *string + + // A generic address associated with the customer that is not mailing, shipping, or + // billing. + Address *types.Address + + // A key value pair of attributes of a customer profile. + Attributes map[string]string + + // The customer’s billing address. + BillingAddress *types.Address + + // The customer’s birth date. + BirthDate *string + + // The customer’s business email address. + BusinessEmailAddress *string + + // The name of the customer’s business. + BusinessName *string + + // The customer’s business phone number. + BusinessPhoneNumber *string + + // The customer's email address, which has not been specified as a personal or + // business address. + EmailAddress *string + + // The customer’s first name. + FirstName *string + + // The gender with which the customer identifies. + Gender types.Gender + + // The customer’s home phone number. + HomePhoneNumber *string + + // The customer’s last name. + LastName *string + + // The customer’s mailing address. + MailingAddress *types.Address + + // The customer’s middle name. + MiddleName *string + + // The customer’s mobile phone number. + MobilePhoneNumber *string + + // The type of profile used to describe the customer. + PartyType types.PartyType + + // The customer’s personal email address. + PersonalEmailAddress *string + + // The customer's phone number, which has not been specified as a mobile, home, or + // business number. + PhoneNumber *string + + // The customer’s shipping address. + ShippingAddress *types.Address +} + +type CreateProfileOutput struct { + + // The unique identifier of a customer profile. + // + // This member is required. + ProfileId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "profile", + OperationName: "CreateProfile", + } +} diff --git a/service/customerprofiles/api_op_DeleteDomain.go b/service/customerprofiles/api_op_DeleteDomain.go new file mode 100644 index 00000000000..7ebbd2ec873 --- /dev/null +++ b/service/customerprofiles/api_op_DeleteDomain.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a specific domain and all of its customer data, such as customer profile +// attributes and their related objects. +func (c *Client) DeleteDomain(ctx context.Context, params *DeleteDomainInput, optFns ...func(*Options)) (*DeleteDomainOutput, error) { + if params == nil { + params = &DeleteDomainInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDomain", params, optFns, addOperationDeleteDomainMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDomainOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDomainInput struct { + + // The unique name of the domain. + // + // This member is required. + DomainName *string +} + +type DeleteDomainOutput struct { + + // A message that indicates the delete request is done. + // + // This member is required. + Message *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteDomain{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteDomain{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteDomainValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDomain(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDeleteDomain(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "DeleteDomain", + } +} diff --git a/service/customerprofiles/api_op_DeleteIntegration.go b/service/customerprofiles/api_op_DeleteIntegration.go new file mode 100644 index 00000000000..1f9367c53eb --- /dev/null +++ b/service/customerprofiles/api_op_DeleteIntegration.go @@ -0,0 +1,118 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +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 an integration from a specific domain. +func (c *Client) DeleteIntegration(ctx context.Context, params *DeleteIntegrationInput, optFns ...func(*Options)) (*DeleteIntegrationOutput, error) { + if params == nil { + params = &DeleteIntegrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteIntegration", params, optFns, addOperationDeleteIntegrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteIntegrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteIntegrationInput struct { + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // The URI of the S3 bucket or any other type of data source. + Uri *string +} + +type DeleteIntegrationOutput struct { + + // A message that indicates the delete request is done. + // + // This member is required. + Message *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteIntegrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteIntegration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteIntegration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteIntegrationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIntegration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDeleteIntegration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "DeleteIntegration", + } +} diff --git a/service/customerprofiles/api_op_DeleteProfile.go b/service/customerprofiles/api_op_DeleteProfile.go new file mode 100644 index 00000000000..e4cbd98ac8e --- /dev/null +++ b/service/customerprofiles/api_op_DeleteProfile.go @@ -0,0 +1,118 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the standard customer profile and all data pertaining to the profile. +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, addOperationDeleteProfileMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteProfileOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteProfileInput struct { + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // The unique identifier of a customer profile. + // + // This member is required. + ProfileId *string +} + +type DeleteProfileOutput struct { + + // A message that indicates the delete request is done. + Message *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "profile", + OperationName: "DeleteProfile", + } +} diff --git a/service/customerprofiles/api_op_DeleteProfileKey.go b/service/customerprofiles/api_op_DeleteProfileKey.go new file mode 100644 index 00000000000..91da6dc8548 --- /dev/null +++ b/service/customerprofiles/api_op_DeleteProfileKey.go @@ -0,0 +1,128 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes a searchable key from a customer profile. +func (c *Client) DeleteProfileKey(ctx context.Context, params *DeleteProfileKeyInput, optFns ...func(*Options)) (*DeleteProfileKeyOutput, error) { + if params == nil { + params = &DeleteProfileKeyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteProfileKey", params, optFns, addOperationDeleteProfileKeyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteProfileKeyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteProfileKeyInput struct { + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // A searchable identifier of a customer profile. + // + // This member is required. + KeyName *string + + // The unique identifier of a customer profile. + // + // This member is required. + ProfileId *string + + // A list of key values. + // + // This member is required. + Values []string +} + +type DeleteProfileKeyOutput struct { + + // A message that indicates the delete request is done. + Message *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteProfileKeyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteProfileKey{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteProfileKey{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteProfileKeyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProfileKey(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDeleteProfileKey(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "DeleteProfileKey", + } +} diff --git a/service/customerprofiles/api_op_DeleteProfileObject.go b/service/customerprofiles/api_op_DeleteProfileObject.go new file mode 100644 index 00000000000..db7726e465e --- /dev/null +++ b/service/customerprofiles/api_op_DeleteProfileObject.go @@ -0,0 +1,128 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +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 an object associated with a profile of a given ProfileObjectType. +func (c *Client) DeleteProfileObject(ctx context.Context, params *DeleteProfileObjectInput, optFns ...func(*Options)) (*DeleteProfileObjectOutput, error) { + if params == nil { + params = &DeleteProfileObjectInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteProfileObject", params, optFns, addOperationDeleteProfileObjectMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteProfileObjectOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteProfileObjectInput struct { + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // The name of the profile object type. + // + // This member is required. + ObjectTypeName *string + + // The unique identifier of a customer profile. + // + // This member is required. + ProfileId *string + + // The unique identifier of the profile object generated by the service. + // + // This member is required. + ProfileObjectUniqueKey *string +} + +type DeleteProfileObjectOutput struct { + + // A message that indicates the delete request is done. + Message *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteProfileObjectMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteProfileObject{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteProfileObject{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteProfileObjectValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProfileObject(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDeleteProfileObject(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "DeleteProfileObject", + } +} diff --git a/service/customerprofiles/api_op_DeleteProfileObjectType.go b/service/customerprofiles/api_op_DeleteProfileObjectType.go new file mode 100644 index 00000000000..80a37f8bbf2 --- /dev/null +++ b/service/customerprofiles/api_op_DeleteProfileObjectType.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes a ProfileObjectType from a specific domain as well as removes all the +// ProfileObjects of that type. It also disables integrations from this specific +// ProfileObjectType. In addition, it scrubs all of the fields of the standard +// profile that were populated from this ProfileObjectType. +func (c *Client) DeleteProfileObjectType(ctx context.Context, params *DeleteProfileObjectTypeInput, optFns ...func(*Options)) (*DeleteProfileObjectTypeOutput, error) { + if params == nil { + params = &DeleteProfileObjectTypeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteProfileObjectType", params, optFns, addOperationDeleteProfileObjectTypeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteProfileObjectTypeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteProfileObjectTypeInput struct { + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // The name of the profile object type. + // + // This member is required. + ObjectTypeName *string +} + +type DeleteProfileObjectTypeOutput struct { + + // A message that indicates the delete request is done. + // + // This member is required. + Message *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteProfileObjectTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteProfileObjectType{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteProfileObjectType{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteProfileObjectTypeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProfileObjectType(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDeleteProfileObjectType(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "DeleteProfileObjectType", + } +} diff --git a/service/customerprofiles/api_op_GetDomain.go b/service/customerprofiles/api_op_GetDomain.go new file mode 100644 index 00000000000..570c31ef2c8 --- /dev/null +++ b/service/customerprofiles/api_op_GetDomain.go @@ -0,0 +1,145 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +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/customerprofiles/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns information about a specific domain. +func (c *Client) GetDomain(ctx context.Context, params *GetDomainInput, optFns ...func(*Options)) (*GetDomainOutput, error) { + if params == nil { + params = &GetDomainInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDomain", params, optFns, addOperationGetDomainMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDomainOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDomainInput struct { + + // A unique name for the domain. + // + // This member is required. + DomainName *string +} + +type GetDomainOutput struct { + + // The timestamp of when the domain was created. + // + // This member is required. + CreatedAt *time.Time + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // The timestamp of when the domain was most recently edited. + // + // This member is required. + LastUpdatedAt *time.Time + + // The URL of the SQS dead letter queue, which is used for reporting errors + // associated with ingesting data from third party applications. + DeadLetterQueueUrl *string + + // The default encryption key, which is an AWS managed key, is used when no + // specific type of encryption key is specified. It is used to encrypt all data + // before it is placed in permanent or semi-permanent storage. + DefaultEncryptionKey *string + + // The default number of days until the data within the domain expires. + DefaultExpirationDays *int32 + + // Usage-specific statistics about the domain. + Stats *types.DomainStats + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDomain{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDomain{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetDomainValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDomain(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetDomain(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "GetDomain", + } +} diff --git a/service/customerprofiles/api_op_GetIntegration.go b/service/customerprofiles/api_op_GetIntegration.go new file mode 100644 index 00000000000..447171a33e0 --- /dev/null +++ b/service/customerprofiles/api_op_GetIntegration.go @@ -0,0 +1,142 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +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" +) + +// Returns an integration for a domain. +func (c *Client) GetIntegration(ctx context.Context, params *GetIntegrationInput, optFns ...func(*Options)) (*GetIntegrationOutput, error) { + if params == nil { + params = &GetIntegrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetIntegration", params, optFns, addOperationGetIntegrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetIntegrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetIntegrationInput struct { + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // The URI of the S3 bucket or any other type of data source. + Uri *string +} + +type GetIntegrationOutput struct { + + // The timestamp of when the domain was created. + // + // This member is required. + CreatedAt *time.Time + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // The timestamp of when the domain was most recently edited. + // + // This member is required. + LastUpdatedAt *time.Time + + // The name of the profile object type. + // + // This member is required. + ObjectTypeName *string + + // The URI of the S3 bucket or any other type of data source. + // + // This member is required. + Uri *string + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetIntegrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetIntegration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetIntegration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetIntegrationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIntegration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetIntegration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "GetIntegration", + } +} diff --git a/service/customerprofiles/api_op_GetProfileObjectType.go b/service/customerprofiles/api_op_GetProfileObjectType.go new file mode 100644 index 00000000000..68c254ade1a --- /dev/null +++ b/service/customerprofiles/api_op_GetProfileObjectType.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +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/customerprofiles/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns the object types for a specific domain. +func (c *Client) GetProfileObjectType(ctx context.Context, params *GetProfileObjectTypeInput, optFns ...func(*Options)) (*GetProfileObjectTypeOutput, error) { + if params == nil { + params = &GetProfileObjectTypeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetProfileObjectType", params, optFns, addOperationGetProfileObjectTypeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetProfileObjectTypeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetProfileObjectTypeInput struct { + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // The name of the profile object type. + // + // This member is required. + ObjectTypeName *string +} + +type GetProfileObjectTypeOutput struct { + + // The description of the profile object type. + // + // This member is required. + Description *string + + // The name of the profile object type. + // + // This member is required. + ObjectTypeName *string + + // Indicates whether a profile should be created when data is received if one + // doesn’t exist for an object of this type. The default is FALSE. If the + // AllowProfileCreation flag is set to FALSE, then the service tries to fetch a + // standard profile and associate this object with the profile. If it is set to + // TRUE, and if no match is found, then the service creates a new standard profile. + AllowProfileCreation bool + + // The timestamp of when the domain was created. + CreatedAt *time.Time + + // The customer-provided key to encrypt the profile object that will be created in + // this profile object type. + EncryptionKey *string + + // The number of days until the data in the object expires. + ExpirationDays *int32 + + // A map of the name and ObjectType field. + Fields map[string]types.ObjectTypeField + + // A list of unique keys that can be used to map data to the profile. + Keys map[string][]types.ObjectTypeKey + + // The timestamp of when the domain was most recently edited. + LastUpdatedAt *time.Time + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + // A unique identifier for the object template. + TemplateId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetProfileObjectTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetProfileObjectType{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetProfileObjectType{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetProfileObjectTypeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetProfileObjectType(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetProfileObjectType(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "GetProfileObjectType", + } +} diff --git a/service/customerprofiles/api_op_GetProfileObjectTypeTemplate.go b/service/customerprofiles/api_op_GetProfileObjectTypeTemplate.go new file mode 100644 index 00000000000..d6e21f78950 --- /dev/null +++ b/service/customerprofiles/api_op_GetProfileObjectTypeTemplate.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +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/customerprofiles/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the template information for a specific object type. A template is a +// predefined ProfileObjectType, such as “Salesforce-Account” or +// “Salesforce-Contact.” When a user sends a ProfileObject, using the +// PutProfileObject API, with an ObjectTypeName that matches one of the +// TemplateIds, it uses the mappings from the template. +func (c *Client) GetProfileObjectTypeTemplate(ctx context.Context, params *GetProfileObjectTypeTemplateInput, optFns ...func(*Options)) (*GetProfileObjectTypeTemplateOutput, error) { + if params == nil { + params = &GetProfileObjectTypeTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetProfileObjectTypeTemplate", params, optFns, addOperationGetProfileObjectTypeTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetProfileObjectTypeTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetProfileObjectTypeTemplateInput struct { + + // A unique identifier for the object template. + // + // This member is required. + TemplateId *string +} + +type GetProfileObjectTypeTemplateOutput struct { + + // Indicates whether a profile should be created when data is received if one + // doesn’t exist for an object of this type. The default is FALSE. If the + // AllowProfileCreation flag is set to FALSE, then the service tries to fetch a + // standard profile and associate this object with the profile. If it is set to + // TRUE, and if no match is found, then the service creates a new standard profile. + AllowProfileCreation bool + + // A map of the name and ObjectType field. + Fields map[string]types.ObjectTypeField + + // A list of unique keys that can be used to map data to the profile. + Keys map[string][]types.ObjectTypeKey + + // The name of the source of the object template. + SourceName *string + + // The source of the object template. + SourceObject *string + + // A unique identifier for the object template. + TemplateId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetProfileObjectTypeTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetProfileObjectTypeTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetProfileObjectTypeTemplate{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetProfileObjectTypeTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetProfileObjectTypeTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetProfileObjectTypeTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "GetProfileObjectTypeTemplate", + } +} diff --git a/service/customerprofiles/api_op_ListAccountIntegrations.go b/service/customerprofiles/api_op_ListAccountIntegrations.go new file mode 100644 index 00000000000..cf62742ee57 --- /dev/null +++ b/service/customerprofiles/api_op_ListAccountIntegrations.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +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/customerprofiles/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all of the integrations associated to a specific URI in the AWS account. +func (c *Client) ListAccountIntegrations(ctx context.Context, params *ListAccountIntegrationsInput, optFns ...func(*Options)) (*ListAccountIntegrationsOutput, error) { + if params == nil { + params = &ListAccountIntegrationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAccountIntegrations", params, optFns, addOperationListAccountIntegrationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAccountIntegrationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAccountIntegrationsInput struct { + + // The URI of the S3 bucket or any other type of data source. + // + // This member is required. + Uri *string + + // The maximum number of objects returned per page. + MaxResults *int32 + + // The pagination token from the previous ListAccountIntegrations API call. + NextToken *string +} + +type ListAccountIntegrationsOutput struct { + + // The list of ListAccountIntegration instances. + Items []types.ListIntegrationItem + + // The pagination token from the previous ListAccountIntegrations API call. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListAccountIntegrationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListAccountIntegrations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAccountIntegrations{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListAccountIntegrationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccountIntegrations(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opListAccountIntegrations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "ListAccountIntegrations", + } +} diff --git a/service/customerprofiles/api_op_ListDomains.go b/service/customerprofiles/api_op_ListDomains.go new file mode 100644 index 00000000000..a8461ca20bf --- /dev/null +++ b/service/customerprofiles/api_op_ListDomains.go @@ -0,0 +1,115 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +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/customerprofiles/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of all the domains for an AWS account that have been created. +func (c *Client) ListDomains(ctx context.Context, params *ListDomainsInput, optFns ...func(*Options)) (*ListDomainsOutput, error) { + if params == nil { + params = &ListDomainsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListDomains", params, optFns, addOperationListDomainsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListDomainsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListDomainsInput struct { + + // The maximum number of objects returned per page. + MaxResults *int32 + + // The pagination token from the previous ListDomain API call. + NextToken *string +} + +type ListDomainsOutput struct { + + // The list of ListDomains instances. + Items []types.ListDomainItem + + // The pagination token from the previous ListDomains API call. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListDomainsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListDomains{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDomains{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListDomains(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opListDomains(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "ListDomains", + } +} diff --git a/service/customerprofiles/api_op_ListIntegrations.go b/service/customerprofiles/api_op_ListIntegrations.go new file mode 100644 index 00000000000..4b912effc36 --- /dev/null +++ b/service/customerprofiles/api_op_ListIntegrations.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +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/customerprofiles/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all of the integrations in your domain. +func (c *Client) ListIntegrations(ctx context.Context, params *ListIntegrationsInput, optFns ...func(*Options)) (*ListIntegrationsOutput, error) { + if params == nil { + params = &ListIntegrationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListIntegrations", params, optFns, addOperationListIntegrationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListIntegrationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListIntegrationsInput struct { + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // The maximum number of objects returned per page. + MaxResults *int32 + + // The pagination token from the previous ListIntegrations API call. + NextToken *string +} + +type ListIntegrationsOutput struct { + + // The list of ListIntegrations instances. + Items []types.ListIntegrationItem + + // The pagination token from the previous ListIntegrations API call. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListIntegrationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListIntegrations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListIntegrations{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListIntegrationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListIntegrations(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opListIntegrations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "ListIntegrations", + } +} diff --git a/service/customerprofiles/api_op_ListProfileObjectTypeTemplates.go b/service/customerprofiles/api_op_ListProfileObjectTypeTemplates.go new file mode 100644 index 00000000000..ff674a92352 --- /dev/null +++ b/service/customerprofiles/api_op_ListProfileObjectTypeTemplates.go @@ -0,0 +1,115 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +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/customerprofiles/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all of the template information for object types. +func (c *Client) ListProfileObjectTypeTemplates(ctx context.Context, params *ListProfileObjectTypeTemplatesInput, optFns ...func(*Options)) (*ListProfileObjectTypeTemplatesOutput, error) { + if params == nil { + params = &ListProfileObjectTypeTemplatesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListProfileObjectTypeTemplates", params, optFns, addOperationListProfileObjectTypeTemplatesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListProfileObjectTypeTemplatesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListProfileObjectTypeTemplatesInput struct { + + // The maximum number of objects returned per page. + MaxResults *int32 + + // The pagination token from the previous ListObjectTypeTemplates API call. + NextToken *string +} + +type ListProfileObjectTypeTemplatesOutput struct { + + // The list of ListProfileObjectType template instances. + Items []types.ListProfileObjectTypeTemplateItem + + // The pagination token from the previous ListObjectTypeTemplates API call. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListProfileObjectTypeTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListProfileObjectTypeTemplates{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListProfileObjectTypeTemplates{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListProfileObjectTypeTemplates(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opListProfileObjectTypeTemplates(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "ListProfileObjectTypeTemplates", + } +} diff --git a/service/customerprofiles/api_op_ListProfileObjectTypes.go b/service/customerprofiles/api_op_ListProfileObjectTypes.go new file mode 100644 index 00000000000..b692b103783 --- /dev/null +++ b/service/customerprofiles/api_op_ListProfileObjectTypes.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +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/customerprofiles/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all of the templates available within the service. +func (c *Client) ListProfileObjectTypes(ctx context.Context, params *ListProfileObjectTypesInput, optFns ...func(*Options)) (*ListProfileObjectTypesOutput, error) { + if params == nil { + params = &ListProfileObjectTypesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListProfileObjectTypes", params, optFns, addOperationListProfileObjectTypesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListProfileObjectTypesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListProfileObjectTypesInput struct { + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // The maximum number of objects returned per page. + MaxResults *int32 + + // Identifies the next page of results to return. + NextToken *string +} + +type ListProfileObjectTypesOutput struct { + + // The list of ListProfileObjectTypes instances. + Items []types.ListProfileObjectTypeItem + + // Identifies the next page of results to return. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListProfileObjectTypesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListProfileObjectTypes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListProfileObjectTypes{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListProfileObjectTypesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListProfileObjectTypes(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opListProfileObjectTypes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "ListProfileObjectTypes", + } +} diff --git a/service/customerprofiles/api_op_ListProfileObjects.go b/service/customerprofiles/api_op_ListProfileObjects.go new file mode 100644 index 00000000000..29e99689ee6 --- /dev/null +++ b/service/customerprofiles/api_op_ListProfileObjects.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +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/customerprofiles/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of objects associated with a profile of a given +// ProfileObjectType. +func (c *Client) ListProfileObjects(ctx context.Context, params *ListProfileObjectsInput, optFns ...func(*Options)) (*ListProfileObjectsOutput, error) { + if params == nil { + params = &ListProfileObjectsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListProfileObjects", params, optFns, addOperationListProfileObjectsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListProfileObjectsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListProfileObjectsInput struct { + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // The name of the profile object type. + // + // This member is required. + ObjectTypeName *string + + // The unique identifier of a customer profile. + // + // This member is required. + ProfileId *string + + // The maximum number of objects returned per page. + MaxResults *int32 + + // The pagination token from the previous call to ListProfileObjects. + NextToken *string +} + +type ListProfileObjectsOutput struct { + + // The list of ListProfileObject instances. + Items []types.ListProfileObjectsItem + + // The pagination token from the previous call to ListProfileObjects. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListProfileObjectsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListProfileObjects{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListProfileObjects{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListProfileObjectsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListProfileObjects(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opListProfileObjects(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "ListProfileObjects", + } +} diff --git a/service/customerprofiles/api_op_ListTagsForResource.go b/service/customerprofiles/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..ea726e99fdb --- /dev/null +++ b/service/customerprofiles/api_op_ListTagsForResource.go @@ -0,0 +1,115 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Displays the tags associated with an Amazon Connect Customer Profiles resource. +// In Connect Customer Profiles, domains, profile object types, and integrations +// can be tagged. +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, addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The ARN of the resource for which you want to view tags. + // + // This member is required. + ResourceArn *string +} + +type ListTagsForResourceOutput struct { + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "profile", + OperationName: "ListTagsForResource", + } +} diff --git a/service/customerprofiles/api_op_PutIntegration.go b/service/customerprofiles/api_op_PutIntegration.go new file mode 100644 index 00000000000..667c7874882 --- /dev/null +++ b/service/customerprofiles/api_op_PutIntegration.go @@ -0,0 +1,154 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +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" +) + +// Adds an integration between the service and a third-party service, which +// includes Amazon AppFlow and Amazon Connect. An integration can belong to only +// one domain. +func (c *Client) PutIntegration(ctx context.Context, params *PutIntegrationInput, optFns ...func(*Options)) (*PutIntegrationOutput, error) { + if params == nil { + params = &PutIntegrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutIntegration", params, optFns, addOperationPutIntegrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutIntegrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutIntegrationInput struct { + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // The name of the profile object type. + // + // This member is required. + ObjectTypeName *string + + // The URI of the S3 bucket or any other type of data source. + // + // This member is required. + Uri *string + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string +} + +type PutIntegrationOutput struct { + + // The timestamp of when the domain was created. + // + // This member is required. + CreatedAt *time.Time + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // The timestamp of when the domain was most recently edited. + // + // This member is required. + LastUpdatedAt *time.Time + + // The name of the profile object type. + // + // This member is required. + ObjectTypeName *string + + // The URI of the S3 bucket or any other type of data source. + // + // This member is required. + Uri *string + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationPutIntegrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutIntegration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutIntegration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutIntegrationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutIntegration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opPutIntegration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "PutIntegration", + } +} diff --git a/service/customerprofiles/api_op_PutProfileObject.go b/service/customerprofiles/api_op_PutProfileObject.go new file mode 100644 index 00000000000..4e6990b568c --- /dev/null +++ b/service/customerprofiles/api_op_PutProfileObject.go @@ -0,0 +1,132 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +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 additional objects to customer profiles of a given ObjectType. When adding +// a specific profile object, like a Contact Trace Record (CTR), an inferred +// profile can get created if it is not mapped to an existing profile. The +// resulting profile will only have a phone number populated in the standard +// ProfileObject. Any additional CTRs with the same phone number will be mapped to +// the same inferred profile. When a ProfileObject is created and if a +// ProfileObjectType already exists for the ProfileObject, it will provide data to +// a standard profile depending on the ProfileObjectType definition. +// PutProfileObject needs an ObjectType, which can be created using +// PutProfileObjectType. +func (c *Client) PutProfileObject(ctx context.Context, params *PutProfileObjectInput, optFns ...func(*Options)) (*PutProfileObjectOutput, error) { + if params == nil { + params = &PutProfileObjectInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutProfileObject", params, optFns, addOperationPutProfileObjectMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutProfileObjectOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutProfileObjectInput struct { + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // A string that is serialized from a JSON object. + // + // This member is required. + Object *string + + // The name of the profile object type. + // + // This member is required. + ObjectTypeName *string +} + +type PutProfileObjectOutput struct { + + // The unique identifier of the profile object generated by the service. + ProfileObjectUniqueKey *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationPutProfileObjectMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutProfileObject{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutProfileObject{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutProfileObjectValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutProfileObject(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opPutProfileObject(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "PutProfileObject", + } +} diff --git a/service/customerprofiles/api_op_PutProfileObjectType.go b/service/customerprofiles/api_op_PutProfileObjectType.go new file mode 100644 index 00000000000..aad58f52571 --- /dev/null +++ b/service/customerprofiles/api_op_PutProfileObjectType.go @@ -0,0 +1,190 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +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/customerprofiles/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Defines a ProfileObjectType. +func (c *Client) PutProfileObjectType(ctx context.Context, params *PutProfileObjectTypeInput, optFns ...func(*Options)) (*PutProfileObjectTypeOutput, error) { + if params == nil { + params = &PutProfileObjectTypeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutProfileObjectType", params, optFns, addOperationPutProfileObjectTypeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutProfileObjectTypeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutProfileObjectTypeInput struct { + + // Description of the profile object type. + // + // This member is required. + Description *string + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // The name of the profile object type. + // + // This member is required. + ObjectTypeName *string + + // Indicates whether a profile should be created when data is received if one + // doesn’t exist for an object of this type. The default is FALSE. If the + // AllowProfileCreation flag is set to FALSE, then the service tries to fetch a + // standard profile and associate this object with the profile. If it is set to + // TRUE, and if no match is found, then the service creates a new standard profile. + AllowProfileCreation bool + + // The customer-provided key to encrypt the profile object that will be created in + // this profile object type. + EncryptionKey *string + + // The number of days until the data in the object expires. + ExpirationDays *int32 + + // A map of the name and ObjectType field. + Fields map[string]types.ObjectTypeField + + // A list of unique keys that can be used to map data to the profile. + Keys map[string][]types.ObjectTypeKey + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + // A unique identifier for the object template. + TemplateId *string +} + +type PutProfileObjectTypeOutput struct { + + // Description of the profile object type. + // + // This member is required. + Description *string + + // The name of the profile object type. + // + // This member is required. + ObjectTypeName *string + + // Indicates whether a profile should be created when data is received if one + // doesn’t exist for an object of this type. The default is FALSE. If the + // AllowProfileCreation flag is set to FALSE, then the service tries to fetch a + // standard profile and associate this object with the profile. If it is set to + // TRUE, and if no match is found, then the service creates a new standard profile. + AllowProfileCreation bool + + // The timestamp of when the domain was created. + CreatedAt *time.Time + + // The customer-provided key to encrypt the profile object that will be created in + // this profile object type. + EncryptionKey *string + + // The number of days until the data in the object expires. + ExpirationDays *int32 + + // A map of the name and ObjectType field. + Fields map[string]types.ObjectTypeField + + // A list of unique keys that can be used to map data to the profile. + Keys map[string][]types.ObjectTypeKey + + // The timestamp of when the domain was most recently edited. + LastUpdatedAt *time.Time + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + // A unique identifier for the object template. + TemplateId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationPutProfileObjectTypeMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutProfileObjectType{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutProfileObjectType{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutProfileObjectTypeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutProfileObjectType(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opPutProfileObjectType(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "PutProfileObjectType", + } +} diff --git a/service/customerprofiles/api_op_SearchProfiles.go b/service/customerprofiles/api_op_SearchProfiles.go new file mode 100644 index 00000000000..de7329ce9bd --- /dev/null +++ b/service/customerprofiles/api_op_SearchProfiles.go @@ -0,0 +1,137 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +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/customerprofiles/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Searches for profiles within a specific domain name using name, phone number, +// email address, account number, or a custom defined index. +func (c *Client) SearchProfiles(ctx context.Context, params *SearchProfilesInput, optFns ...func(*Options)) (*SearchProfilesOutput, error) { + if params == nil { + params = &SearchProfilesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SearchProfiles", params, optFns, addOperationSearchProfilesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SearchProfilesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SearchProfilesInput struct { + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // A searchable identifier of a customer profile. The predefined keys you can use + // to search include: _account, _profileId, _fullName, _phone, _email, + // _ctrContactId, _marketoLeadId, _salesforceAccountId, _salesforceContactId, + // _zendeskUserId, _zendeskExternalId, _serviceNowSystemId. + // + // This member is required. + KeyName *string + + // A list of key values. + // + // This member is required. + Values []string + + // The maximum number of objects returned per page. + MaxResults *int32 + + // The pagination token from the previous SearchProfiles API call. + NextToken *string +} + +type SearchProfilesOutput struct { + + // The list of SearchProfiles instances. + Items []types.Profile + + // The pagination token from the previous SearchProfiles API call. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationSearchProfilesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpSearchProfiles{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearchProfiles{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpSearchProfilesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchProfiles(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opSearchProfiles(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "SearchProfiles", + } +} diff --git a/service/customerprofiles/api_op_TagResource.go b/service/customerprofiles/api_op_TagResource.go new file mode 100644 index 00000000000..ed1f66def69 --- /dev/null +++ b/service/customerprofiles/api_op_TagResource.go @@ -0,0 +1,125 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Assigns one or more tags (key-value pairs) to the specified Amazon Connect +// Customer Profiles resource. Tags can help you organize and categorize your +// resources. You can also use them to scope user permissions by granting a user +// permission to access or change only resources with certain tag values. In +// Connect Customer Profiles, domains, profile object types, and integrations can +// be tagged. Tags don't have any semantic meaning to AWS and are interpreted +// strictly as strings of characters. You can use the TagResource action with a +// resource that already has tags. If you specify a new tag key, this tag is +// appended to the list of tags associated with the resource. If you specify a tag +// key that is already associated with the resource, the new tag value that you +// specify replaces the previous value for that tag. You can associate as many as +// 50 tags with a resource. +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The ARN of the resource that you're adding tags to. + // + // This member is required. + ResourceArn *string + + // The tags used to organize, track, or control access for this resource. + // + // This member is required. + Tags map[string]string +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "profile", + OperationName: "TagResource", + } +} diff --git a/service/customerprofiles/api_op_UntagResource.go b/service/customerprofiles/api_op_UntagResource.go new file mode 100644 index 00000000000..7e50d3b9483 --- /dev/null +++ b/service/customerprofiles/api_op_UntagResource.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes one or more tags from the specified Amazon Connect Customer Profiles +// resource. In Connect Customer Profiles, domains, profile object types, and +// integrations can be tagged. +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, addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The ARN of the resource from which you are removing tags. + // + // This member is required. + ResourceArn *string + + // The list of tag keys to remove from the resource. + // + // This member is required. + TagKeys []string +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "profile", + OperationName: "UntagResource", + } +} diff --git a/service/customerprofiles/api_op_UpdateDomain.go b/service/customerprofiles/api_op_UpdateDomain.go new file mode 100644 index 00000000000..706a0c708f0 --- /dev/null +++ b/service/customerprofiles/api_op_UpdateDomain.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Updates the properties of a domain, including creating or selecting a dead +// letter queue or an encryption key. Once a domain is created, the name can’t be +// changed. +func (c *Client) UpdateDomain(ctx context.Context, params *UpdateDomainInput, optFns ...func(*Options)) (*UpdateDomainOutput, error) { + if params == nil { + params = &UpdateDomainInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateDomain", params, optFns, addOperationUpdateDomainMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateDomainOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateDomainInput struct { + + // The unique name for the domain. + // + // This member is required. + DomainName *string + + // The URL of the SQS dead letter queue, which is used for reporting errors + // associated with ingesting data from third party applications. If specified as an + // empty string, it will clear any existing value. You must set up a policy on the + // DeadLetterQueue for the SendMessage operation to enable Amazon Connect Customer + // Profiles to send messages to the DeadLetterQueue. + DeadLetterQueueUrl *string + + // The default encryption key, which is an AWS managed key, is used when no + // specific type of encryption key is specified. It is used to encrypt all data + // before it is placed in permanent or semi-permanent storage. If specified as an + // empty string, it will clear any existing value. + DefaultEncryptionKey *string + + // The default number of days until the data within the domain expires. + DefaultExpirationDays *int32 + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string +} + +type UpdateDomainOutput struct { + + // The timestamp of when the domain was created. + // + // This member is required. + CreatedAt *time.Time + + // The unique name for the domain. + // + // This member is required. + DomainName *string + + // The timestamp of when the domain was most recently edited. + // + // This member is required. + LastUpdatedAt *time.Time + + // The URL of the SQS dead letter queue, which is used for reporting errors + // associated with ingesting data from third party applications. + DeadLetterQueueUrl *string + + // The default encryption key, which is an AWS managed key, is used when no + // specific type of encryption key is specified. It is used to encrypt all data + // before it is placed in permanent or semi-permanent storage. + DefaultEncryptionKey *string + + // The default number of days until the data within the domain expires. + DefaultExpirationDays *int32 + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationUpdateDomainMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateDomain{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateDomain{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateDomainValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDomain(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opUpdateDomain(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "profile", + OperationName: "UpdateDomain", + } +} diff --git a/service/customerprofiles/api_op_UpdateProfile.go b/service/customerprofiles/api_op_UpdateProfile.go new file mode 100644 index 00000000000..03b268dd767 --- /dev/null +++ b/service/customerprofiles/api_op_UpdateProfile.go @@ -0,0 +1,190 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +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/customerprofiles/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the properties of a profile. The ProfileId is required for updating a +// customer profile. When calling the UpdateProfile API, specifying an empty string +// value means that any existing value will be removed. Not specifying a string +// value means that any value already there will be kept. +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, addOperationUpdateProfileMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateProfileOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateProfileInput struct { + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // The unique identifier of a customer profile. + // + // This member is required. + ProfileId *string + + // A unique account number that you have given to the customer. + AccountNumber *string + + // Any additional information relevant to the customer's profile. + AdditionalInformation *string + + // A generic address associated with the customer that is not mailing, shipping, or + // billing. + Address *types.UpdateAddress + + // A key value pair of attributes of a customer profile. + Attributes map[string]string + + // The customer’s billing address. + BillingAddress *types.UpdateAddress + + // The customer’s birth date. + BirthDate *string + + // The customer’s business email address. + BusinessEmailAddress *string + + // The name of the customer’s business. + BusinessName *string + + // The customer’s business phone number. + BusinessPhoneNumber *string + + // The customer's email address, which has not been specified as a personal or + // business address. + EmailAddress *string + + // The customer’s first name. + FirstName *string + + // The gender with which the customer identifies. + Gender types.Gender + + // The customer’s home phone number. + HomePhoneNumber *string + + // The customer’s last name. + LastName *string + + // The customer’s mailing address. + MailingAddress *types.UpdateAddress + + // The customer’s middle name. + MiddleName *string + + // The customer’s mobile phone number. + MobilePhoneNumber *string + + // The type of profile used to describe the customer. + PartyType types.PartyType + + // The customer’s personal email address. + PersonalEmailAddress *string + + // The customer's phone number, which has not been specified as a mobile, home, or + // business number. + PhoneNumber *string + + // The customer’s shipping address. + ShippingAddress *types.UpdateAddress +} + +type UpdateProfileOutput struct { + + // The unique identifier of a customer profile. + // + // This member is required. + ProfileId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "profile", + OperationName: "UpdateProfile", + } +} diff --git a/service/customerprofiles/deserializers.go b/service/customerprofiles/deserializers.go new file mode 100644 index 00000000000..7a5330e5469 --- /dev/null +++ b/service/customerprofiles/deserializers.go @@ -0,0 +1,6707 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/customerprofiles/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_deserializeOpAddProfileKey struct { +} + +func (*awsRestjson1_deserializeOpAddProfileKey) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpAddProfileKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorAddProfileKey(response, &metadata) + } + output := &AddProfileKeyOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentAddProfileKeyOutput(&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_deserializeOpErrorAddProfileKey(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentAddProfileKeyOutput(v **AddProfileKeyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *AddProfileKeyOutput + if *v == nil { + sv = &AddProfileKeyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "KeyName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected name to be of type string, got %T instead", value) + } + sv.KeyName = ptr.String(jtv) + } + + case "Values": + if err := awsRestjson1_deserializeDocumentRequestValueList(&sv.Values, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateDomain struct { +} + +func (*awsRestjson1_deserializeOpCreateDomain) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateDomain(response, &metadata) + } + output := &CreateDomainOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateDomainOutput(&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_deserializeOpErrorCreateDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateDomainOutput(v **CreateDomainOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateDomainOutput + if *v == nil { + sv = &CreateDomainOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "DeadLetterQueueUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected sqsQueueUrl to be of type string, got %T instead", value) + } + sv.DeadLetterQueueUrl = ptr.String(jtv) + } + + case "DefaultEncryptionKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected encryptionKey to be of type string, got %T instead", value) + } + sv.DefaultEncryptionKey = ptr.String(jtv) + } + + case "DefaultExpirationDays": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected expirationDaysInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.DefaultExpirationDays = ptr.Int32(int32(i64)) + } + + case "DomainName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected name to be of type string, got %T instead", value) + } + sv.DomainName = ptr.String(jtv) + } + + case "LastUpdatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(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 "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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteDomain struct { +} + +func (*awsRestjson1_deserializeOpDeleteDomain) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteDomain(response, &metadata) + } + output := &DeleteDomainOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentDeleteDomainOutput(&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_deserializeOpErrorDeleteDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDeleteDomainOutput(v **DeleteDomainOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteDomainOutput + if *v == nil { + sv = &DeleteDomainOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteIntegration struct { +} + +func (*awsRestjson1_deserializeOpDeleteIntegration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteIntegration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteIntegration(response, &metadata) + } + output := &DeleteIntegrationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentDeleteIntegrationOutput(&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_deserializeOpErrorDeleteIntegration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDeleteIntegrationOutput(v **DeleteIntegrationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteIntegrationOutput + if *v == nil { + sv = &DeleteIntegrationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(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 "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteProfileKey struct { +} + +func (*awsRestjson1_deserializeOpDeleteProfileKey) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteProfileKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteProfileKey(response, &metadata) + } + output := &DeleteProfileKeyOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentDeleteProfileKeyOutput(&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_deserializeOpErrorDeleteProfileKey(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDeleteProfileKeyOutput(v **DeleteProfileKeyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteProfileKeyOutput + if *v == nil { + sv = &DeleteProfileKeyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteProfileObject struct { +} + +func (*awsRestjson1_deserializeOpDeleteProfileObject) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteProfileObject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteProfileObject(response, &metadata) + } + output := &DeleteProfileObjectOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentDeleteProfileObjectOutput(&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_deserializeOpErrorDeleteProfileObject(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDeleteProfileObjectOutput(v **DeleteProfileObjectOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteProfileObjectOutput + if *v == nil { + sv = &DeleteProfileObjectOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteProfileObjectType struct { +} + +func (*awsRestjson1_deserializeOpDeleteProfileObjectType) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteProfileObjectType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteProfileObjectType(response, &metadata) + } + output := &DeleteProfileObjectTypeOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentDeleteProfileObjectTypeOutput(&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_deserializeOpErrorDeleteProfileObjectType(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDeleteProfileObjectTypeOutput(v **DeleteProfileObjectTypeOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteProfileObjectTypeOutput + if *v == nil { + sv = &DeleteProfileObjectTypeOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetDomain struct { +} + +func (*awsRestjson1_deserializeOpGetDomain) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetDomain(response, &metadata) + } + output := &GetDomainOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetDomainOutput(&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_deserializeOpErrorGetDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetDomainOutput(v **GetDomainOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetDomainOutput + if *v == nil { + sv = &GetDomainOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "DeadLetterQueueUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected sqsQueueUrl to be of type string, got %T instead", value) + } + sv.DeadLetterQueueUrl = ptr.String(jtv) + } + + case "DefaultEncryptionKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected encryptionKey to be of type string, got %T instead", value) + } + sv.DefaultEncryptionKey = ptr.String(jtv) + } + + case "DefaultExpirationDays": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected expirationDaysInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.DefaultExpirationDays = ptr.Int32(int32(i64)) + } + + case "DomainName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected name to be of type string, got %T instead", value) + } + sv.DomainName = ptr.String(jtv) + } + + case "LastUpdatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "Stats": + if err := awsRestjson1_deserializeDocumentDomainStats(&sv.Stats, 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_deserializeOpGetIntegration struct { +} + +func (*awsRestjson1_deserializeOpGetIntegration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetIntegration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetIntegration(response, &metadata) + } + output := &GetIntegrationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetIntegrationOutput(&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_deserializeOpErrorGetIntegration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetIntegrationOutput(v **GetIntegrationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetIntegrationOutput + if *v == nil { + sv = &GetIntegrationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "DomainName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected name to be of type string, got %T instead", value) + } + sv.DomainName = ptr.String(jtv) + } + + case "LastUpdatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "ObjectTypeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected typeName to be of type string, got %T instead", value) + } + sv.ObjectTypeName = ptr.String(jtv) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "Uri": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.Uri = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetProfileObjectType struct { +} + +func (*awsRestjson1_deserializeOpGetProfileObjectType) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetProfileObjectType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetProfileObjectType(response, &metadata) + } + output := &GetProfileObjectTypeOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetProfileObjectTypeOutput(&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_deserializeOpErrorGetProfileObjectType(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetProfileObjectTypeOutput(v **GetProfileObjectTypeOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetProfileObjectTypeOutput + if *v == nil { + sv = &GetProfileObjectTypeOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AllowProfileCreation": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected boolean to be of type *bool, got %T instead", value) + } + sv.AllowProfileCreation = jtv + } + + case "CreatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected text to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "EncryptionKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected encryptionKey to be of type string, got %T instead", value) + } + sv.EncryptionKey = ptr.String(jtv) + } + + case "ExpirationDays": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected expirationDaysInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ExpirationDays = ptr.Int32(int32(i64)) + } + + case "Fields": + if err := awsRestjson1_deserializeDocumentFieldMap(&sv.Fields, value); err != nil { + return err + } + + case "Keys": + if err := awsRestjson1_deserializeDocumentKeyMap(&sv.Keys, value); err != nil { + return err + } + + case "LastUpdatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "ObjectTypeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected typeName to be of type string, got %T instead", value) + } + sv.ObjectTypeName = ptr.String(jtv) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "TemplateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected name to be of type string, got %T instead", value) + } + sv.TemplateId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetProfileObjectTypeTemplate struct { +} + +func (*awsRestjson1_deserializeOpGetProfileObjectTypeTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetProfileObjectTypeTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetProfileObjectTypeTemplate(response, &metadata) + } + output := &GetProfileObjectTypeTemplateOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetProfileObjectTypeTemplateOutput(&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_deserializeOpErrorGetProfileObjectTypeTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetProfileObjectTypeTemplateOutput(v **GetProfileObjectTypeTemplateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetProfileObjectTypeTemplateOutput + if *v == nil { + sv = &GetProfileObjectTypeTemplateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AllowProfileCreation": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected boolean to be of type *bool, got %T instead", value) + } + sv.AllowProfileCreation = jtv + } + + case "Fields": + if err := awsRestjson1_deserializeDocumentFieldMap(&sv.Fields, value); err != nil { + return err + } + + case "Keys": + if err := awsRestjson1_deserializeDocumentKeyMap(&sv.Keys, value); err != nil { + return err + } + + case "SourceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected name to be of type string, got %T instead", value) + } + sv.SourceName = ptr.String(jtv) + } + + case "SourceObject": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected name to be of type string, got %T instead", value) + } + sv.SourceObject = ptr.String(jtv) + } + + case "TemplateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected name to be of type string, got %T instead", value) + } + sv.TemplateId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListAccountIntegrations struct { +} + +func (*awsRestjson1_deserializeOpListAccountIntegrations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListAccountIntegrations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListAccountIntegrations(response, &metadata) + } + output := &ListAccountIntegrationsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListAccountIntegrationsOutput(&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_deserializeOpErrorListAccountIntegrations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListAccountIntegrationsOutput(v **ListAccountIntegrationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListAccountIntegrationsOutput + if *v == nil { + sv = &ListAccountIntegrationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Items": + if err := awsRestjson1_deserializeDocumentIntegrationList(&sv.Items, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListDomains struct { +} + +func (*awsRestjson1_deserializeOpListDomains) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListDomains) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListDomains(response, &metadata) + } + output := &ListDomainsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListDomainsOutput(&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_deserializeOpErrorListDomains(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListDomainsOutput(v **ListDomainsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListDomainsOutput + if *v == nil { + sv = &ListDomainsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Items": + if err := awsRestjson1_deserializeDocumentDomainList(&sv.Items, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListIntegrations struct { +} + +func (*awsRestjson1_deserializeOpListIntegrations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListIntegrations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListIntegrations(response, &metadata) + } + output := &ListIntegrationsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListIntegrationsOutput(&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_deserializeOpErrorListIntegrations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListIntegrationsOutput(v **ListIntegrationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListIntegrationsOutput + if *v == nil { + sv = &ListIntegrationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Items": + if err := awsRestjson1_deserializeDocumentIntegrationList(&sv.Items, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListProfileObjects struct { +} + +func (*awsRestjson1_deserializeOpListProfileObjects) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListProfileObjects) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListProfileObjects(response, &metadata) + } + output := &ListProfileObjectsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListProfileObjectsOutput(&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_deserializeOpErrorListProfileObjects(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListProfileObjectsOutput(v **ListProfileObjectsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListProfileObjectsOutput + if *v == nil { + sv = &ListProfileObjectsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Items": + if err := awsRestjson1_deserializeDocumentProfileObjectList(&sv.Items, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListProfileObjectTypes struct { +} + +func (*awsRestjson1_deserializeOpListProfileObjectTypes) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListProfileObjectTypes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListProfileObjectTypes(response, &metadata) + } + output := &ListProfileObjectTypesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListProfileObjectTypesOutput(&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_deserializeOpErrorListProfileObjectTypes(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListProfileObjectTypesOutput(v **ListProfileObjectTypesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListProfileObjectTypesOutput + if *v == nil { + sv = &ListProfileObjectTypesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Items": + if err := awsRestjson1_deserializeDocumentProfileObjectTypeList(&sv.Items, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListProfileObjectTypeTemplates struct { +} + +func (*awsRestjson1_deserializeOpListProfileObjectTypeTemplates) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListProfileObjectTypeTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListProfileObjectTypeTemplates(response, &metadata) + } + output := &ListProfileObjectTypeTemplatesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListProfileObjectTypeTemplatesOutput(&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_deserializeOpErrorListProfileObjectTypeTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListProfileObjectTypeTemplatesOutput(v **ListProfileObjectTypeTemplatesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListProfileObjectTypeTemplatesOutput + if *v == nil { + sv = &ListProfileObjectTypeTemplatesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Items": + if err := awsRestjson1_deserializeDocumentProfileObjectTypeTemplateList(&sv.Items, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(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_deserializeOpPutIntegration struct { +} + +func (*awsRestjson1_deserializeOpPutIntegration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutIntegration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorPutIntegration(response, &metadata) + } + output := &PutIntegrationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentPutIntegrationOutput(&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_deserializeOpErrorPutIntegration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPutIntegrationOutput(v **PutIntegrationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutIntegrationOutput + if *v == nil { + sv = &PutIntegrationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "DomainName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected name to be of type string, got %T instead", value) + } + sv.DomainName = ptr.String(jtv) + } + + case "LastUpdatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "ObjectTypeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected typeName to be of type string, got %T instead", value) + } + sv.ObjectTypeName = ptr.String(jtv) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "Uri": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.Uri = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutProfileObject struct { +} + +func (*awsRestjson1_deserializeOpPutProfileObject) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutProfileObject) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorPutProfileObject(response, &metadata) + } + output := &PutProfileObjectOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentPutProfileObjectOutput(&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_deserializeOpErrorPutProfileObject(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPutProfileObjectOutput(v **PutProfileObjectOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutProfileObjectOutput + if *v == nil { + sv = &PutProfileObjectOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ProfileObjectUniqueKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.ProfileObjectUniqueKey = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutProfileObjectType struct { +} + +func (*awsRestjson1_deserializeOpPutProfileObjectType) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutProfileObjectType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorPutProfileObjectType(response, &metadata) + } + output := &PutProfileObjectTypeOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentPutProfileObjectTypeOutput(&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_deserializeOpErrorPutProfileObjectType(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPutProfileObjectTypeOutput(v **PutProfileObjectTypeOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutProfileObjectTypeOutput + if *v == nil { + sv = &PutProfileObjectTypeOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AllowProfileCreation": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected boolean to be of type *bool, got %T instead", value) + } + sv.AllowProfileCreation = jtv + } + + case "CreatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected text to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "EncryptionKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected encryptionKey to be of type string, got %T instead", value) + } + sv.EncryptionKey = ptr.String(jtv) + } + + case "ExpirationDays": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected expirationDaysInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ExpirationDays = ptr.Int32(int32(i64)) + } + + case "Fields": + if err := awsRestjson1_deserializeDocumentFieldMap(&sv.Fields, value); err != nil { + return err + } + + case "Keys": + if err := awsRestjson1_deserializeDocumentKeyMap(&sv.Keys, value); err != nil { + return err + } + + case "LastUpdatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "ObjectTypeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected typeName to be of type string, got %T instead", value) + } + sv.ObjectTypeName = ptr.String(jtv) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "TemplateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected name to be of type string, got %T instead", value) + } + sv.TemplateId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpSearchProfiles struct { +} + +func (*awsRestjson1_deserializeOpSearchProfiles) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSearchProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorSearchProfiles(response, &metadata) + } + output := &SearchProfilesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentSearchProfilesOutput(&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_deserializeOpErrorSearchProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentSearchProfilesOutput(v **SearchProfilesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *SearchProfilesOutput + if *v == nil { + sv = &SearchProfilesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Items": + if err := awsRestjson1_deserializeDocumentProfileList(&sv.Items, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateDomain struct { +} + +func (*awsRestjson1_deserializeOpUpdateDomain) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateDomain) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateDomain(response, &metadata) + } + output := &UpdateDomainOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentUpdateDomainOutput(&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_deserializeOpErrorUpdateDomain(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateDomainOutput(v **UpdateDomainOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateDomainOutput + if *v == nil { + sv = &UpdateDomainOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "DeadLetterQueueUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected sqsQueueUrl to be of type string, got %T instead", value) + } + sv.DeadLetterQueueUrl = ptr.String(jtv) + } + + case "DefaultEncryptionKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected encryptionKey to be of type string, got %T instead", value) + } + sv.DefaultEncryptionKey = ptr.String(jtv) + } + + case "DefaultExpirationDays": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected expirationDaysInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.DefaultExpirationDays = ptr.Int32(int32(i64)) + } + + case "DomainName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected name to be of type string, got %T instead", value) + } + sv.DomainName = ptr.String(jtv) + } + + case "LastUpdatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, 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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(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 "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) + } + + 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_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.BadRequestException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentBadRequestException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_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_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_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_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 message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAddress(v **types.Address, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Address + if *v == nil { + sv = &types.Address{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Address1": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.Address1 = ptr.String(jtv) + } + + case "Address2": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.Address2 = ptr.String(jtv) + } + + case "Address3": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.Address3 = ptr.String(jtv) + } + + case "Address4": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.Address4 = ptr.String(jtv) + } + + case "City": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.City = ptr.String(jtv) + } + + case "Country": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.Country = ptr.String(jtv) + } + + case "County": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.County = ptr.String(jtv) + } + + case "PostalCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.PostalCode = ptr.String(jtv) + } + + case "Province": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.Province = ptr.String(jtv) + } + + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.State = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAttributes(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 string1To255 to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BadRequestException + if *v == nil { + sv = &types.BadRequestException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDomainList(v *[]types.ListDomainItem, 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.ListDomainItem + if *v == nil { + cv = []types.ListDomainItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ListDomainItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentListDomainItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentDomainStats(v **types.DomainStats, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DomainStats + if *v == nil { + sv = &types.DomainStats{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MeteringProfileCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MeteringProfileCount = i64 + } + + case "ObjectCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ObjectCount = i64 + } + + case "ProfileCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ProfileCount = i64 + } + + case "TotalSize": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected long to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TotalSize = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentFieldMap(v *map[string]types.ObjectTypeField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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]types.ObjectTypeField + if *v == nil { + mv = map[string]types.ObjectTypeField{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.ObjectTypeField + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentObjectTypeField(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentFieldNameList(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_deserializeDocumentIntegrationList(v *[]types.ListIntegrationItem, 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.ListIntegrationItem + if *v == nil { + cv = []types.ListIntegrationItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ListIntegrationItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentListIntegrationItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + 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 message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentKeyMap(v *map[string][]types.ObjectTypeKey, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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][]types.ObjectTypeKey + if *v == nil { + mv = map[string][]types.ObjectTypeKey{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal []types.ObjectTypeKey + mapVar := parsedVal + if err := awsRestjson1_deserializeDocumentObjectTypeKeyList(&mapVar, value); err != nil { + return err + } + parsedVal = mapVar + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentListDomainItem(v **types.ListDomainItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ListDomainItem + if *v == nil { + sv = &types.ListDomainItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "DomainName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected name to be of type string, got %T instead", value) + } + sv.DomainName = ptr.String(jtv) + } + + case "LastUpdatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListIntegrationItem(v **types.ListIntegrationItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ListIntegrationItem + if *v == nil { + sv = &types.ListIntegrationItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "DomainName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected name to be of type string, got %T instead", value) + } + sv.DomainName = ptr.String(jtv) + } + + case "LastUpdatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "ObjectTypeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected typeName to be of type string, got %T instead", value) + } + sv.ObjectTypeName = ptr.String(jtv) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "Uri": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.Uri = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListProfileObjectsItem(v **types.ListProfileObjectsItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ListProfileObjectsItem + if *v == nil { + sv = &types.ListProfileObjectsItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Object": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected stringifiedJson to be of type string, got %T instead", value) + } + sv.Object = ptr.String(jtv) + } + + case "ObjectTypeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected typeName to be of type string, got %T instead", value) + } + sv.ObjectTypeName = ptr.String(jtv) + } + + case "ProfileObjectUniqueKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.ProfileObjectUniqueKey = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListProfileObjectTypeItem(v **types.ListProfileObjectTypeItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ListProfileObjectTypeItem + if *v == nil { + sv = &types.ListProfileObjectTypeItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected text to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "LastUpdatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "ObjectTypeName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected typeName to be of type string, got %T instead", value) + } + sv.ObjectTypeName = ptr.String(jtv) + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentListProfileObjectTypeTemplateItem(v **types.ListProfileObjectTypeTemplateItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ListProfileObjectTypeTemplateItem + if *v == nil { + sv = &types.ListProfileObjectTypeTemplateItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SourceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected name to be of type string, got %T instead", value) + } + sv.SourceName = ptr.String(jtv) + } + + case "SourceObject": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected name to be of type string, got %T instead", value) + } + sv.SourceObject = ptr.String(jtv) + } + + case "TemplateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected name to be of type string, got %T instead", value) + } + sv.TemplateId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentObjectTypeField(v **types.ObjectTypeField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ObjectTypeField + if *v == nil { + sv = &types.ObjectTypeField{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ContentType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldContentType to be of type string, got %T instead", value) + } + sv.ContentType = types.FieldContentType(jtv) + } + + case "Source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected text to be of type string, got %T instead", value) + } + sv.Source = ptr.String(jtv) + } + + case "Target": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected text to be of type string, got %T instead", value) + } + sv.Target = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentObjectTypeKey(v **types.ObjectTypeKey, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ObjectTypeKey + if *v == nil { + sv = &types.ObjectTypeKey{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FieldNames": + if err := awsRestjson1_deserializeDocumentFieldNameList(&sv.FieldNames, value); err != nil { + return err + } + + case "StandardIdentifiers": + if err := awsRestjson1_deserializeDocumentStandardIdentifierList(&sv.StandardIdentifiers, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentObjectTypeKeyList(v *[]types.ObjectTypeKey, 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.ObjectTypeKey + if *v == nil { + cv = []types.ObjectTypeKey{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ObjectTypeKey + destAddr := &col + if err := awsRestjson1_deserializeDocumentObjectTypeKey(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentProfile(v **types.Profile, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Profile + if *v == nil { + sv = &types.Profile{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AccountNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.AccountNumber = ptr.String(jtv) + } + + case "AdditionalInformation": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To1000 to be of type string, got %T instead", value) + } + sv.AdditionalInformation = ptr.String(jtv) + } + + case "Address": + if err := awsRestjson1_deserializeDocumentAddress(&sv.Address, value); err != nil { + return err + } + + case "Attributes": + if err := awsRestjson1_deserializeDocumentAttributes(&sv.Attributes, value); err != nil { + return err + } + + case "BillingAddress": + if err := awsRestjson1_deserializeDocumentAddress(&sv.BillingAddress, value); err != nil { + return err + } + + case "BirthDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.BirthDate = ptr.String(jtv) + } + + case "BusinessEmailAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.BusinessEmailAddress = ptr.String(jtv) + } + + case "BusinessName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.BusinessName = ptr.String(jtv) + } + + case "BusinessPhoneNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.BusinessPhoneNumber = ptr.String(jtv) + } + + case "EmailAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.EmailAddress = ptr.String(jtv) + } + + case "FirstName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.FirstName = ptr.String(jtv) + } + + case "Gender": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Gender to be of type string, got %T instead", value) + } + sv.Gender = types.Gender(jtv) + } + + case "HomePhoneNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.HomePhoneNumber = ptr.String(jtv) + } + + case "LastName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.LastName = ptr.String(jtv) + } + + case "MailingAddress": + if err := awsRestjson1_deserializeDocumentAddress(&sv.MailingAddress, value); err != nil { + return err + } + + case "MiddleName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.MiddleName = ptr.String(jtv) + } + + case "MobilePhoneNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.MobilePhoneNumber = ptr.String(jtv) + } + + case "PartyType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PartyType to be of type string, got %T instead", value) + } + sv.PartyType = types.PartyType(jtv) + } + + case "PersonalEmailAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.PersonalEmailAddress = ptr.String(jtv) + } + + case "PhoneNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string1To255 to be of type string, got %T instead", value) + } + sv.PhoneNumber = 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 "ShippingAddress": + if err := awsRestjson1_deserializeDocumentAddress(&sv.ShippingAddress, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentProfileList(v *[]types.Profile, 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.Profile + if *v == nil { + cv = []types.Profile{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Profile + destAddr := &col + if err := awsRestjson1_deserializeDocumentProfile(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentProfileObjectList(v *[]types.ListProfileObjectsItem, 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.ListProfileObjectsItem + if *v == nil { + cv = []types.ListProfileObjectsItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ListProfileObjectsItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentListProfileObjectsItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentProfileObjectTypeList(v *[]types.ListProfileObjectTypeItem, 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.ListProfileObjectTypeItem + if *v == nil { + cv = []types.ListProfileObjectTypeItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ListProfileObjectTypeItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentListProfileObjectTypeItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentProfileObjectTypeTemplateList(v *[]types.ListProfileObjectTypeTemplateItem, 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.ListProfileObjectTypeTemplateItem + if *v == nil { + cv = []types.ListProfileObjectTypeTemplateItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ListProfileObjectTypeTemplateItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentListProfileObjectTypeTemplateItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRequestValueList(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 string1To255 to be of type string, got %T instead", value) + } + col = jtv + } + 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 message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentStandardIdentifierList(v *[]types.StandardIdentifier, 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.StandardIdentifier + if *v == nil { + cv = []types.StandardIdentifier{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.StandardIdentifier + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StandardIdentifier to be of type string, got %T instead", value) + } + col = types.StandardIdentifier(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_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 message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/customerprofiles/doc.go b/service/customerprofiles/doc.go new file mode 100644 index 00000000000..b89727c3531 --- /dev/null +++ b/service/customerprofiles/doc.go @@ -0,0 +1,17 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package customerprofiles provides the API client, operations, and parameter +// types for Amazon Connect Customer Profiles. +// +// Amazon Connect Customer Profiles Welcome to the Amazon Connect Customer Profiles +// API Reference. This guide provides information about the Amazon Connect Customer +// Profiles API, including supported operations, data types, parameters, and +// schemas. Amazon Connect Customer Profiles is a unified customer profile for your +// contact center that has pre-built connectors powered by AppFlow that make it +// easy to combine customer information from third party applications, such as +// Salesforce (CRM), ServiceNow (ITSM), and your enterprise resource planning +// (ERP), with contact history from your Amazon Connect contact center. If you're +// new to Amazon Connect, you might find it helpful to also review the Amazon +// Connect Administrator Guide +// (https://docs.aws.amazon.com/connect/latest/adminguide/what-is-amazon-connect.html). +package customerprofiles diff --git a/service/customerprofiles/endpoints.go b/service/customerprofiles/endpoints.go new file mode 100644 index 00000000000..0b5fc08b7fa --- /dev/null +++ b/service/customerprofiles/endpoints.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +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/customerprofiles/internal/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/url" +) + +// 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() +} + +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") + } + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), m.Options) + 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 = "profile" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + 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.EndpointResolver + 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) + 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) +} + +// 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. +// awsResolver and fallbackResolver must not be nil +func WithEndpointResolver(awsResolver aws.EndpointResolver, fallbackResolver EndpointResolver) EndpointResolver { + return &wrappedEndpointResolver{ + awsResolver: awsResolver, + resolver: fallbackResolver, + } +} diff --git a/service/customerprofiles/go.mod b/service/customerprofiles/go.mod new file mode 100644 index 00000000000..c037685343a --- /dev/null +++ b/service/customerprofiles/go.mod @@ -0,0 +1,10 @@ +module github.com/aws/aws-sdk-go-v2/service/customerprofiles + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v0.30.1-0.20201222223005-ee883de66531 + github.com/aws/smithy-go v0.4.1-0.20201222001052-74df8ddd8c79 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/customerprofiles/go.sum b/service/customerprofiles/go.sum new file mode 100644 index 00000000000..934e2b5c702 --- /dev/null +++ b/service/customerprofiles/go.sum @@ -0,0 +1,14 @@ +github.com/aws/smithy-go v0.4.1-0.20201222001052-74df8ddd8c79 h1:Ufuk/0gkbBZVZ7jlujsyzn5ruWhdTFBcZDCVIy60tsQ= +github.com/aws/smithy-go v0.4.1-0.20201222001052-74df8ddd8c79/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/customerprofiles/internal/endpoints/endpoints.go b/service/customerprofiles/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..c839fb29315 --- /dev/null +++ b/service/customerprofiles/internal/endpoints/endpoints.go @@ -0,0 +1,91 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + DisableHTTPS bool +} + +// Resolver Customer Profiles 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 := endpoints.Options{ + DisableHTTPS: options.DisableHTTPS, + } + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: endpoints.Endpoint{ + Hostname: "profile.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-cn", + Defaults: endpoints.Endpoint{ + Hostname: "profile.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: endpoints.Endpoint{ + Hostname: "profile.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: endpoints.Endpoint{ + Hostname: "profile.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: endpoints.Endpoint{ + Hostname: "profile.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, +} diff --git a/service/customerprofiles/internal/endpoints/endpoints_test.go b/service/customerprofiles/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/customerprofiles/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/customerprofiles/protocol_test.go b/service/customerprofiles/protocol_test.go new file mode 100644 index 00000000000..f1b7b2da539 --- /dev/null +++ b/service/customerprofiles/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles diff --git a/service/customerprofiles/serializers.go b/service/customerprofiles/serializers.go new file mode 100644 index 00000000000..2c9f62c838d --- /dev/null +++ b/service/customerprofiles/serializers.go @@ -0,0 +1,2863 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/customerprofiles/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_serializeOpAddProfileKey struct { +} + +func (*awsRestjson1_serializeOpAddProfileKey) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpAddProfileKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AddProfileKeyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{DomainName}/profiles/keys") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsAddProfileKeyInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentAddProfileKeyInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsAddProfileKeyInput(v *AddProfileKeyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentAddProfileKeyInput(v *AddProfileKeyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KeyName != nil { + ok := object.Key("KeyName") + ok.String(*v.KeyName) + } + + if v.ProfileId != nil { + ok := object.Key("ProfileId") + ok.String(*v.ProfileId) + } + + if v.Values != nil { + ok := object.Key("Values") + if err := awsRestjson1_serializeDocumentRequestValueList(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateDomain struct { +} + +func (*awsRestjson1_serializeOpCreateDomain) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDomainInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{DomainName}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsCreateDomainInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateDomainInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateDomainInput(v *CreateDomainInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateDomainInput(v *CreateDomainInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DeadLetterQueueUrl != nil { + ok := object.Key("DeadLetterQueueUrl") + ok.String(*v.DeadLetterQueueUrl) + } + + if v.DefaultEncryptionKey != nil { + ok := object.Key("DefaultEncryptionKey") + ok.String(*v.DefaultEncryptionKey) + } + + if v.DefaultExpirationDays != nil { + ok := object.Key("DefaultExpirationDays") + ok.Integer(*v.DefaultExpirationDays) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +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("/domains/{DomainName}/profiles") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsCreateProfileInput(input, restEncoder); 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) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateProfileInput(v *CreateProfileInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountNumber != nil { + ok := object.Key("AccountNumber") + ok.String(*v.AccountNumber) + } + + if v.AdditionalInformation != nil { + ok := object.Key("AdditionalInformation") + ok.String(*v.AdditionalInformation) + } + + if v.Address != nil { + ok := object.Key("Address") + if err := awsRestjson1_serializeDocumentAddress(v.Address, ok); err != nil { + return err + } + } + + if v.Attributes != nil { + ok := object.Key("Attributes") + if err := awsRestjson1_serializeDocumentAttributes(v.Attributes, ok); err != nil { + return err + } + } + + if v.BillingAddress != nil { + ok := object.Key("BillingAddress") + if err := awsRestjson1_serializeDocumentAddress(v.BillingAddress, ok); err != nil { + return err + } + } + + if v.BirthDate != nil { + ok := object.Key("BirthDate") + ok.String(*v.BirthDate) + } + + if v.BusinessEmailAddress != nil { + ok := object.Key("BusinessEmailAddress") + ok.String(*v.BusinessEmailAddress) + } + + if v.BusinessName != nil { + ok := object.Key("BusinessName") + ok.String(*v.BusinessName) + } + + if v.BusinessPhoneNumber != nil { + ok := object.Key("BusinessPhoneNumber") + ok.String(*v.BusinessPhoneNumber) + } + + if v.EmailAddress != nil { + ok := object.Key("EmailAddress") + ok.String(*v.EmailAddress) + } + + if v.FirstName != nil { + ok := object.Key("FirstName") + ok.String(*v.FirstName) + } + + if len(v.Gender) > 0 { + ok := object.Key("Gender") + ok.String(string(v.Gender)) + } + + if v.HomePhoneNumber != nil { + ok := object.Key("HomePhoneNumber") + ok.String(*v.HomePhoneNumber) + } + + if v.LastName != nil { + ok := object.Key("LastName") + ok.String(*v.LastName) + } + + if v.MailingAddress != nil { + ok := object.Key("MailingAddress") + if err := awsRestjson1_serializeDocumentAddress(v.MailingAddress, ok); err != nil { + return err + } + } + + if v.MiddleName != nil { + ok := object.Key("MiddleName") + ok.String(*v.MiddleName) + } + + if v.MobilePhoneNumber != nil { + ok := object.Key("MobilePhoneNumber") + ok.String(*v.MobilePhoneNumber) + } + + if len(v.PartyType) > 0 { + ok := object.Key("PartyType") + ok.String(string(v.PartyType)) + } + + if v.PersonalEmailAddress != nil { + ok := object.Key("PersonalEmailAddress") + ok.String(*v.PersonalEmailAddress) + } + + if v.PhoneNumber != nil { + ok := object.Key("PhoneNumber") + ok.String(*v.PhoneNumber) + } + + if v.ShippingAddress != nil { + ok := object.Key("ShippingAddress") + if err := awsRestjson1_serializeDocumentAddress(v.ShippingAddress, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteDomain struct { +} + +func (*awsRestjson1_serializeOpDeleteDomain) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDomainInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{DomainName}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteDomainInput(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_serializeOpHttpBindingsDeleteDomainInput(v *DeleteDomainInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteIntegration struct { +} + +func (*awsRestjson1_serializeOpDeleteIntegration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteIntegration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteIntegrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{DomainName}/integrations/delete") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteIntegrationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDeleteIntegrationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDeleteIntegrationInput(v *DeleteIntegrationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteIntegrationInput(v *DeleteIntegrationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Uri != nil { + ok := object.Key("Uri") + ok.String(*v.Uri) + } + + 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("/domains/{DomainName}/profiles/delete") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteProfileInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDeleteProfileInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = 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.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteProfileInput(v *DeleteProfileInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ProfileId != nil { + ok := object.Key("ProfileId") + ok.String(*v.ProfileId) + } + + return nil +} + +type awsRestjson1_serializeOpDeleteProfileKey struct { +} + +func (*awsRestjson1_serializeOpDeleteProfileKey) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteProfileKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteProfileKeyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{DomainName}/profiles/keys/delete") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteProfileKeyInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDeleteProfileKeyInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDeleteProfileKeyInput(v *DeleteProfileKeyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteProfileKeyInput(v *DeleteProfileKeyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KeyName != nil { + ok := object.Key("KeyName") + ok.String(*v.KeyName) + } + + if v.ProfileId != nil { + ok := object.Key("ProfileId") + ok.String(*v.ProfileId) + } + + if v.Values != nil { + ok := object.Key("Values") + if err := awsRestjson1_serializeDocumentRequestValueList(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteProfileObject struct { +} + +func (*awsRestjson1_serializeOpDeleteProfileObject) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteProfileObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteProfileObjectInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{DomainName}/profiles/objects/delete") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteProfileObjectInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDeleteProfileObjectInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDeleteProfileObjectInput(v *DeleteProfileObjectInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteProfileObjectInput(v *DeleteProfileObjectInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ObjectTypeName != nil { + ok := object.Key("ObjectTypeName") + ok.String(*v.ObjectTypeName) + } + + if v.ProfileId != nil { + ok := object.Key("ProfileId") + ok.String(*v.ProfileId) + } + + if v.ProfileObjectUniqueKey != nil { + ok := object.Key("ProfileObjectUniqueKey") + ok.String(*v.ProfileObjectUniqueKey) + } + + return nil +} + +type awsRestjson1_serializeOpDeleteProfileObjectType struct { +} + +func (*awsRestjson1_serializeOpDeleteProfileObjectType) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteProfileObjectType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteProfileObjectTypeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{DomainName}/object-types/{ObjectTypeName}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteProfileObjectTypeInput(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_serializeOpHttpBindingsDeleteProfileObjectTypeInput(v *DeleteProfileObjectTypeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + if v.ObjectTypeName == nil || len(*v.ObjectTypeName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ObjectTypeName must not be empty")} + } + if v.ObjectTypeName != nil { + if err := encoder.SetURI("ObjectTypeName").String(*v.ObjectTypeName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetDomain struct { +} + +func (*awsRestjson1_serializeOpGetDomain) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetDomainInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{DomainName}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetDomainInput(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_serializeOpHttpBindingsGetDomainInput(v *GetDomainInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetIntegration struct { +} + +func (*awsRestjson1_serializeOpGetIntegration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetIntegration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetIntegrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{DomainName}/integrations") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetIntegrationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentGetIntegrationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsGetIntegrationInput(v *GetIntegrationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGetIntegrationInput(v *GetIntegrationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Uri != nil { + ok := object.Key("Uri") + ok.String(*v.Uri) + } + + return nil +} + +type awsRestjson1_serializeOpGetProfileObjectType struct { +} + +func (*awsRestjson1_serializeOpGetProfileObjectType) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetProfileObjectType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetProfileObjectTypeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{DomainName}/object-types/{ObjectTypeName}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetProfileObjectTypeInput(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_serializeOpHttpBindingsGetProfileObjectTypeInput(v *GetProfileObjectTypeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + if v.ObjectTypeName == nil || len(*v.ObjectTypeName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ObjectTypeName must not be empty")} + } + if v.ObjectTypeName != nil { + if err := encoder.SetURI("ObjectTypeName").String(*v.ObjectTypeName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetProfileObjectTypeTemplate struct { +} + +func (*awsRestjson1_serializeOpGetProfileObjectTypeTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetProfileObjectTypeTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetProfileObjectTypeTemplateInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/templates/{TemplateId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetProfileObjectTypeTemplateInput(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_serializeOpHttpBindingsGetProfileObjectTypeTemplateInput(v *GetProfileObjectTypeTemplateInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.TemplateId == nil || len(*v.TemplateId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member TemplateId must not be empty")} + } + if v.TemplateId != nil { + if err := encoder.SetURI("TemplateId").String(*v.TemplateId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListAccountIntegrations struct { +} + +func (*awsRestjson1_serializeOpListAccountIntegrations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListAccountIntegrations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListAccountIntegrationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/integrations") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListAccountIntegrationsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListAccountIntegrationsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListAccountIntegrationsInput(v *ListAccountIntegrationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("max-results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("next-token").String(*v.NextToken) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListAccountIntegrationsInput(v *ListAccountIntegrationsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Uri != nil { + ok := object.Key("Uri") + ok.String(*v.Uri) + } + + return nil +} + +type awsRestjson1_serializeOpListDomains struct { +} + +func (*awsRestjson1_serializeOpListDomains) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListDomains) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListDomainsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListDomainsInput(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_serializeOpHttpBindingsListDomainsInput(v *ListDomainsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("max-results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("next-token").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListIntegrations struct { +} + +func (*awsRestjson1_serializeOpListIntegrations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListIntegrations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListIntegrationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{DomainName}/integrations") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListIntegrationsInput(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_serializeOpHttpBindingsListIntegrationsInput(v *ListIntegrationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("max-results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("next-token").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListProfileObjects struct { +} + +func (*awsRestjson1_serializeOpListProfileObjects) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListProfileObjects) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListProfileObjectsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{DomainName}/profiles/objects") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListProfileObjectsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListProfileObjectsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListProfileObjectsInput(v *ListProfileObjectsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("max-results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("next-token").String(*v.NextToken) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListProfileObjectsInput(v *ListProfileObjectsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ObjectTypeName != nil { + ok := object.Key("ObjectTypeName") + ok.String(*v.ObjectTypeName) + } + + if v.ProfileId != nil { + ok := object.Key("ProfileId") + ok.String(*v.ProfileId) + } + + return nil +} + +type awsRestjson1_serializeOpListProfileObjectTypes struct { +} + +func (*awsRestjson1_serializeOpListProfileObjectTypes) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListProfileObjectTypes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListProfileObjectTypesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{DomainName}/object-types") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListProfileObjectTypesInput(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_serializeOpHttpBindingsListProfileObjectTypesInput(v *ListProfileObjectTypesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("max-results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("next-token").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListProfileObjectTypeTemplates struct { +} + +func (*awsRestjson1_serializeOpListProfileObjectTypeTemplates) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListProfileObjectTypeTemplates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListProfileObjectTypeTemplatesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/templates") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListProfileObjectTypeTemplatesInput(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_serializeOpHttpBindingsListProfileObjectTypeTemplatesInput(v *ListProfileObjectTypeTemplatesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("max-results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("next-token").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 = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpPutIntegration struct { +} + +func (*awsRestjson1_serializeOpPutIntegration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutIntegration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutIntegrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{DomainName}/integrations") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + request.URL.RawQuery = opQuery + } + + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutIntegrationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutIntegrationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsPutIntegrationInput(v *PutIntegrationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutIntegrationInput(v *PutIntegrationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ObjectTypeName != nil { + ok := object.Key("ObjectTypeName") + ok.String(*v.ObjectTypeName) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + if v.Uri != nil { + ok := object.Key("Uri") + ok.String(*v.Uri) + } + + return nil +} + +type awsRestjson1_serializeOpPutProfileObject struct { +} + +func (*awsRestjson1_serializeOpPutProfileObject) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutProfileObject) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutProfileObjectInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{DomainName}/profiles/objects") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + request.URL.RawQuery = opQuery + } + + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutProfileObjectInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutProfileObjectInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsPutProfileObjectInput(v *PutProfileObjectInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutProfileObjectInput(v *PutProfileObjectInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Object != nil { + ok := object.Key("Object") + ok.String(*v.Object) + } + + if v.ObjectTypeName != nil { + ok := object.Key("ObjectTypeName") + ok.String(*v.ObjectTypeName) + } + + return nil +} + +type awsRestjson1_serializeOpPutProfileObjectType struct { +} + +func (*awsRestjson1_serializeOpPutProfileObjectType) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutProfileObjectType) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutProfileObjectTypeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{DomainName}/object-types/{ObjectTypeName}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + request.URL.RawQuery = opQuery + } + + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutProfileObjectTypeInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutProfileObjectTypeInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsPutProfileObjectTypeInput(v *PutProfileObjectTypeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + if v.ObjectTypeName == nil || len(*v.ObjectTypeName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ObjectTypeName must not be empty")} + } + if v.ObjectTypeName != nil { + if err := encoder.SetURI("ObjectTypeName").String(*v.ObjectTypeName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutProfileObjectTypeInput(v *PutProfileObjectTypeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AllowProfileCreation { + ok := object.Key("AllowProfileCreation") + ok.Boolean(v.AllowProfileCreation) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.EncryptionKey != nil { + ok := object.Key("EncryptionKey") + ok.String(*v.EncryptionKey) + } + + if v.ExpirationDays != nil { + ok := object.Key("ExpirationDays") + ok.Integer(*v.ExpirationDays) + } + + if v.Fields != nil { + ok := object.Key("Fields") + if err := awsRestjson1_serializeDocumentFieldMap(v.Fields, ok); err != nil { + return err + } + } + + if v.Keys != nil { + ok := object.Key("Keys") + if err := awsRestjson1_serializeDocumentKeyMap(v.Keys, 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.TemplateId != nil { + ok := object.Key("TemplateId") + ok.String(*v.TemplateId) + } + + return nil +} + +type awsRestjson1_serializeOpSearchProfiles struct { +} + +func (*awsRestjson1_serializeOpSearchProfiles) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpSearchProfiles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SearchProfilesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{DomainName}/profiles/search") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsSearchProfilesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentSearchProfilesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsSearchProfilesInput(v *SearchProfilesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + if v.MaxResults != nil { + encoder.SetQuery("max-results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("next-token").String(*v.NextToken) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentSearchProfilesInput(v *SearchProfilesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.KeyName != nil { + ok := object.Key("KeyName") + ok.String(*v.KeyName) + } + + if v.Values != nil { + ok := object.Key("Values") + if err := awsRestjson1_serializeDocumentRequestValueList(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpTagResource struct { +} + +func (*awsRestjson1_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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 = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpUpdateDomain struct { +} + +func (*awsRestjson1_serializeOpUpdateDomain) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateDomain) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateDomainInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domains/{DomainName}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + request.URL.RawQuery = opQuery + } + + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateDomainInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateDomainInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateDomainInput(v *UpdateDomainInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateDomainInput(v *UpdateDomainInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DeadLetterQueueUrl != nil { + ok := object.Key("DeadLetterQueueUrl") + ok.String(*v.DeadLetterQueueUrl) + } + + if v.DefaultEncryptionKey != nil { + ok := object.Key("DefaultEncryptionKey") + ok.String(*v.DefaultEncryptionKey) + } + + if v.DefaultExpirationDays != nil { + ok := object.Key("DefaultExpirationDays") + ok.Integer(*v.DefaultExpirationDays) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + 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("/domains/{DomainName}/profiles") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + request.URL.RawQuery = opQuery + } + + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_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.DomainName == nil || len(*v.DomainName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member DomainName must not be empty")} + } + if v.DomainName != nil { + if err := encoder.SetURI("DomainName").String(*v.DomainName); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateProfileInput(v *UpdateProfileInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountNumber != nil { + ok := object.Key("AccountNumber") + ok.String(*v.AccountNumber) + } + + if v.AdditionalInformation != nil { + ok := object.Key("AdditionalInformation") + ok.String(*v.AdditionalInformation) + } + + if v.Address != nil { + ok := object.Key("Address") + if err := awsRestjson1_serializeDocumentUpdateAddress(v.Address, ok); err != nil { + return err + } + } + + if v.Attributes != nil { + ok := object.Key("Attributes") + if err := awsRestjson1_serializeDocumentUpdateAttributes(v.Attributes, ok); err != nil { + return err + } + } + + if v.BillingAddress != nil { + ok := object.Key("BillingAddress") + if err := awsRestjson1_serializeDocumentUpdateAddress(v.BillingAddress, ok); err != nil { + return err + } + } + + if v.BirthDate != nil { + ok := object.Key("BirthDate") + ok.String(*v.BirthDate) + } + + if v.BusinessEmailAddress != nil { + ok := object.Key("BusinessEmailAddress") + ok.String(*v.BusinessEmailAddress) + } + + if v.BusinessName != nil { + ok := object.Key("BusinessName") + ok.String(*v.BusinessName) + } + + if v.BusinessPhoneNumber != nil { + ok := object.Key("BusinessPhoneNumber") + ok.String(*v.BusinessPhoneNumber) + } + + if v.EmailAddress != nil { + ok := object.Key("EmailAddress") + ok.String(*v.EmailAddress) + } + + if v.FirstName != nil { + ok := object.Key("FirstName") + ok.String(*v.FirstName) + } + + if len(v.Gender) > 0 { + ok := object.Key("Gender") + ok.String(string(v.Gender)) + } + + if v.HomePhoneNumber != nil { + ok := object.Key("HomePhoneNumber") + ok.String(*v.HomePhoneNumber) + } + + if v.LastName != nil { + ok := object.Key("LastName") + ok.String(*v.LastName) + } + + if v.MailingAddress != nil { + ok := object.Key("MailingAddress") + if err := awsRestjson1_serializeDocumentUpdateAddress(v.MailingAddress, ok); err != nil { + return err + } + } + + if v.MiddleName != nil { + ok := object.Key("MiddleName") + ok.String(*v.MiddleName) + } + + if v.MobilePhoneNumber != nil { + ok := object.Key("MobilePhoneNumber") + ok.String(*v.MobilePhoneNumber) + } + + if len(v.PartyType) > 0 { + ok := object.Key("PartyType") + ok.String(string(v.PartyType)) + } + + if v.PersonalEmailAddress != nil { + ok := object.Key("PersonalEmailAddress") + ok.String(*v.PersonalEmailAddress) + } + + if v.PhoneNumber != nil { + ok := object.Key("PhoneNumber") + ok.String(*v.PhoneNumber) + } + + if v.ProfileId != nil { + ok := object.Key("ProfileId") + ok.String(*v.ProfileId) + } + + if v.ShippingAddress != nil { + ok := object.Key("ShippingAddress") + if err := awsRestjson1_serializeDocumentUpdateAddress(v.ShippingAddress, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentAddress(v *types.Address, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Address1 != nil { + ok := object.Key("Address1") + ok.String(*v.Address1) + } + + if v.Address2 != nil { + ok := object.Key("Address2") + ok.String(*v.Address2) + } + + if v.Address3 != nil { + ok := object.Key("Address3") + ok.String(*v.Address3) + } + + if v.Address4 != nil { + ok := object.Key("Address4") + ok.String(*v.Address4) + } + + if v.City != nil { + ok := object.Key("City") + ok.String(*v.City) + } + + if v.Country != nil { + ok := object.Key("Country") + ok.String(*v.Country) + } + + if v.County != nil { + ok := object.Key("County") + ok.String(*v.County) + } + + if v.PostalCode != nil { + ok := object.Key("PostalCode") + ok.String(*v.PostalCode) + } + + if v.Province != nil { + ok := object.Key("Province") + ok.String(*v.Province) + } + + if v.State != nil { + ok := object.Key("State") + ok.String(*v.State) + } + + return nil +} + +func awsRestjson1_serializeDocumentAttributes(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_serializeDocumentFieldMap(v map[string]types.ObjectTypeField, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + mapVar := v[key] + if err := awsRestjson1_serializeDocumentObjectTypeField(&mapVar, om); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentFieldNameList(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_serializeDocumentKeyMap(v map[string][]types.ObjectTypeKey, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + if vv := v[key]; vv == nil { + continue + } + if err := awsRestjson1_serializeDocumentObjectTypeKeyList(v[key], om); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentObjectTypeField(v *types.ObjectTypeField, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.ContentType) > 0 { + ok := object.Key("ContentType") + ok.String(string(v.ContentType)) + } + + if v.Source != nil { + ok := object.Key("Source") + ok.String(*v.Source) + } + + if v.Target != nil { + ok := object.Key("Target") + ok.String(*v.Target) + } + + return nil +} + +func awsRestjson1_serializeDocumentObjectTypeKey(v *types.ObjectTypeKey, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FieldNames != nil { + ok := object.Key("FieldNames") + if err := awsRestjson1_serializeDocumentFieldNameList(v.FieldNames, ok); err != nil { + return err + } + } + + if v.StandardIdentifiers != nil { + ok := object.Key("StandardIdentifiers") + if err := awsRestjson1_serializeDocumentStandardIdentifierList(v.StandardIdentifiers, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentObjectTypeKeyList(v []types.ObjectTypeKey, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentObjectTypeKey(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentRequestValueList(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_serializeDocumentStandardIdentifierList(v []types.StandardIdentifier, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func 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_serializeDocumentUpdateAddress(v *types.UpdateAddress, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Address1 != nil { + ok := object.Key("Address1") + ok.String(*v.Address1) + } + + if v.Address2 != nil { + ok := object.Key("Address2") + ok.String(*v.Address2) + } + + if v.Address3 != nil { + ok := object.Key("Address3") + ok.String(*v.Address3) + } + + if v.Address4 != nil { + ok := object.Key("Address4") + ok.String(*v.Address4) + } + + if v.City != nil { + ok := object.Key("City") + ok.String(*v.City) + } + + if v.Country != nil { + ok := object.Key("Country") + ok.String(*v.Country) + } + + if v.County != nil { + ok := object.Key("County") + ok.String(*v.County) + } + + if v.PostalCode != nil { + ok := object.Key("PostalCode") + ok.String(*v.PostalCode) + } + + if v.Province != nil { + ok := object.Key("Province") + ok.String(*v.Province) + } + + if v.State != nil { + ok := object.Key("State") + ok.String(*v.State) + } + + return nil +} + +func awsRestjson1_serializeDocumentUpdateAttributes(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 +} diff --git a/service/customerprofiles/types/enums.go b/service/customerprofiles/types/enums.go new file mode 100644 index 00000000000..9bd2880e529 --- /dev/null +++ b/service/customerprofiles/types/enums.go @@ -0,0 +1,91 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type FieldContentType string + +// Enum values for FieldContentType +const ( + FieldContentTypeString FieldContentType = "STRING" + FieldContentTypeNumber FieldContentType = "NUMBER" + FieldContentTypePhoneNumber FieldContentType = "PHONE_NUMBER" + FieldContentTypeEmailAddress FieldContentType = "EMAIL_ADDRESS" + FieldContentTypeName FieldContentType = "NAME" +) + +// Values returns all known values for FieldContentType. 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 (FieldContentType) Values() []FieldContentType { + return []FieldContentType{ + "STRING", + "NUMBER", + "PHONE_NUMBER", + "EMAIL_ADDRESS", + "NAME", + } +} + +type Gender string + +// Enum values for Gender +const ( + GenderMale Gender = "MALE" + GenderFemale Gender = "FEMALE" + GenderUnspecified Gender = "UNSPECIFIED" +) + +// Values returns all known values for Gender. 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 (Gender) Values() []Gender { + return []Gender{ + "MALE", + "FEMALE", + "UNSPECIFIED", + } +} + +type PartyType string + +// Enum values for PartyType +const ( + PartyTypeIndividual PartyType = "INDIVIDUAL" + PartyTypeBusiness PartyType = "BUSINESS" + PartyTypeOther PartyType = "OTHER" +) + +// Values returns all known values for PartyType. 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 (PartyType) Values() []PartyType { + return []PartyType{ + "INDIVIDUAL", + "BUSINESS", + "OTHER", + } +} + +type StandardIdentifier string + +// Enum values for StandardIdentifier +const ( + StandardIdentifierProfile StandardIdentifier = "PROFILE" + StandardIdentifierUnique StandardIdentifier = "UNIQUE" + StandardIdentifierSecondary StandardIdentifier = "SECONDARY" + StandardIdentifierLookupOnly StandardIdentifier = "LOOKUP_ONLY" + StandardIdentifierNewOnly StandardIdentifier = "NEW_ONLY" +) + +// Values returns all known values for StandardIdentifier. 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 (StandardIdentifier) Values() []StandardIdentifier { + return []StandardIdentifier{ + "PROFILE", + "UNIQUE", + "SECONDARY", + "LOOKUP_ONLY", + "NEW_ONLY", + } +} diff --git a/service/customerprofiles/types/errors.go b/service/customerprofiles/types/errors.go new file mode 100644 index 00000000000..066c272c7ee --- /dev/null +++ b/service/customerprofiles/types/errors.go @@ -0,0 +1,93 @@ +// 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 +} + +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 { return "AccessDeniedException" } +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The input you provided is invalid. +type BadRequestException struct { + Message *string +} + +func (e *BadRequestException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *BadRequestException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *BadRequestException) ErrorCode() string { return "BadRequestException" } +func (e *BadRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// An internal service error occurred. +type InternalServerException struct { + Message *string +} + +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 { return "InternalServerException" } +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The requested resource does not exist, or access was denied. +type ResourceNotFoundException struct { + Message *string +} + +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 { return "ResourceNotFoundException" } +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// You exceeded the maximum number of requests. +type ThrottlingException struct { + Message *string +} + +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 { return "ThrottlingException" } +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/customerprofiles/types/types.go b/service/customerprofiles/types/types.go new file mode 100644 index 00000000000..9003a58a350 --- /dev/null +++ b/service/customerprofiles/types/types.go @@ -0,0 +1,307 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "time" +) + +// A generic address associated with the customer that is not mailing, shipping, or +// billing. +type Address struct { + + // The first line of a customer address. + Address1 *string + + // The second line of a customer address. + Address2 *string + + // The third line of a customer address. + Address3 *string + + // The fourth line of a customer address. + Address4 *string + + // The city in which a customer lives. + City *string + + // The country in which a customer lives. + Country *string + + // The county in which a customer lives. + County *string + + // The postal code of a customer address. + PostalCode *string + + // The province in which a customer lives. + Province *string + + // The state in which a customer lives. + State *string +} + +// Usage-specific statistics about the domain. +type DomainStats struct { + + // The number of profiles that you are currently paying for in the domain. If you + // have more than 100 objects associated with a single profile, that profile counts + // as two profiles. If you have more than 200 objects, that profile counts as + // three, and so on. + MeteringProfileCount int64 + + // The total number of objects in domain. + ObjectCount int64 + + // The total number of profiles currently in the domain. + ProfileCount int64 + + // The total size, in bytes, of all objects in the domain. + TotalSize int64 +} + +// An object in a list that represents a domain. +type ListDomainItem struct { + + // The timestamp of when the domain was created. + // + // This member is required. + CreatedAt *time.Time + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // The timestamp of when the domain was most recently edited. + // + // This member is required. + LastUpdatedAt *time.Time + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string +} + +// An integration in list of integrations. +type ListIntegrationItem struct { + + // The timestamp of when the domain was created. + // + // This member is required. + CreatedAt *time.Time + + // The unique name of the domain. + // + // This member is required. + DomainName *string + + // The timestamp of when the domain was most recently edited. + // + // This member is required. + LastUpdatedAt *time.Time + + // The name of the profile object type. + // + // This member is required. + ObjectTypeName *string + + // The URI of the S3 bucket or any other type of data source. + // + // This member is required. + Uri *string + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string +} + +// A ProfileObject in a list of ProfileObjects. +type ListProfileObjectsItem struct { + + // A JSON representation of a ProfileObject that belongs to a profile. + Object *string + + // Specifies the kind of object being added to a profile, such as + // "Salesforce-Account." + ObjectTypeName *string + + // The unique identifier of the ProfileObject generated by the service. + ProfileObjectUniqueKey *string +} + +// A ProfileObjectType instance. +type ListProfileObjectTypeItem struct { + + // Description of the profile object type. + // + // This member is required. + Description *string + + // The name of the profile object type. + // + // This member is required. + ObjectTypeName *string + + // The timestamp of when the domain was created. + CreatedAt *time.Time + + // The timestamp of when the domain was most recently edited. + LastUpdatedAt *time.Time + + // The tags used to organize, track, or control access for this resource. + Tags map[string]string +} + +// A ProfileObjectTypeTemplate in a list of ProfileObjectTypeTemplates. +type ListProfileObjectTypeTemplateItem struct { + + // The name of the source of the object template. + SourceName *string + + // The source of the object template. + SourceObject *string + + // A unique identifier for the object template. + TemplateId *string +} + +// Represents a field in a ProfileObjectType. +type ObjectTypeField struct { + + // The content type of the field. Used for determining equality when searching. + ContentType FieldContentType + + // A field of a ProfileObject. For example: _source.FirstName, where “_source” is a + // ProfileObjectType of a Zendesk user and “FirstName” is a field in that + // ObjectType. + Source *string + + // The location of the data in the standard ProfileObject model. For example: + // _profile.Address.PostalCode. + Target *string +} + +// An object that defines the Key element of a ProfileObject. A Key is a special +// element that can be used to search for a customer profile. +type ObjectTypeKey struct { + + // The reference for the key name of the fields map. + FieldNames []string + + // The types of keys that a ProfileObject can have. Each ProfileObject can have + // only 1 UNIQUE key but multiple PROFILE keys. PROFILE means that this key can be + // used to tie an object to a PROFILE. UNIQUE means that it can be used to uniquely + // identify an object. If a key a is marked as SECONDARY, it will be used to search + // for profiles after all other PROFILE keys have been searched. A LOOKUP_ONLY key + // is only used to match a profile but is not persisted to be used for searching of + // the profile. A NEW_ONLY key is only used if the profile does not already exist + // before the object is ingested, otherwise it is only used for matching objects to + // profiles. + StandardIdentifiers []StandardIdentifier +} + +// The standard profile of a customer. +type Profile struct { + + // A unique account number that you have given to the customer. + AccountNumber *string + + // Any additional information relevant to the customer's profile. + AdditionalInformation *string + + // A generic address associated with the customer that is not mailing, shipping, or + // billing. + Address *Address + + // A key value pair of attributes of a customer profile. + Attributes map[string]string + + // The customer’s billing address. + BillingAddress *Address + + // The customer’s birth date. + BirthDate *string + + // The customer’s business email address. + BusinessEmailAddress *string + + // The name of the customer’s business. + BusinessName *string + + // The customer’s home phone number. + BusinessPhoneNumber *string + + // The customer's email address, which has not been specified as a personal or + // business address. + EmailAddress *string + + // The customer’s first name. + FirstName *string + + // The gender with which the customer identifies. + Gender Gender + + // The customer’s home phone number. + HomePhoneNumber *string + + // The customer’s last name. + LastName *string + + // The customer’s mailing address. + MailingAddress *Address + + // The customer’s middle name. + MiddleName *string + + // The customer’s mobile phone number. + MobilePhoneNumber *string + + // The type of profile used to describe the customer. + PartyType PartyType + + // The customer’s personal email address. + PersonalEmailAddress *string + + // The customer's phone number, which has not been specified as a mobile, home, or + // business number. + PhoneNumber *string + + // The unique identifier of a customer profile. + ProfileId *string + + // The customer’s shipping address. + ShippingAddress *Address +} + +// Updates associated with the address properties of a customer profile. +type UpdateAddress struct { + + // The first line of a customer address. + Address1 *string + + // The second line of a customer address. + Address2 *string + + // The third line of a customer address. + Address3 *string + + // The fourth line of a customer address. + Address4 *string + + // The city in which a customer lives. + City *string + + // The country in which a customer lives. + Country *string + + // The county in which a customer lives. + County *string + + // The postal code of a customer address. + PostalCode *string + + // The province in which a customer lives. + Province *string + + // The state in which a customer lives. + State *string +} diff --git a/service/customerprofiles/validators.go b/service/customerprofiles/validators.go new file mode 100644 index 00000000000..783485ba5ea --- /dev/null +++ b/service/customerprofiles/validators.go @@ -0,0 +1,1102 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package customerprofiles + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpAddProfileKey struct { +} + +func (*validateOpAddProfileKey) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAddProfileKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AddProfileKeyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAddProfileKeyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateDomain struct { +} + +func (*validateOpCreateDomain) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDomainInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDomainInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateProfile struct { +} + +func (*validateOpCreateProfile) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateProfileInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateProfileInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDomain struct { +} + +func (*validateOpDeleteDomain) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDomainInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDomainInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteIntegration struct { +} + +func (*validateOpDeleteIntegration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteIntegration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteIntegrationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteIntegrationInput(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 validateOpDeleteProfileKey struct { +} + +func (*validateOpDeleteProfileKey) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteProfileKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteProfileKeyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteProfileKeyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteProfileObject struct { +} + +func (*validateOpDeleteProfileObject) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteProfileObject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteProfileObjectInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteProfileObjectInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteProfileObjectType struct { +} + +func (*validateOpDeleteProfileObjectType) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteProfileObjectType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteProfileObjectTypeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteProfileObjectTypeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetDomain struct { +} + +func (*validateOpGetDomain) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetDomainInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetDomainInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetIntegration struct { +} + +func (*validateOpGetIntegration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetIntegration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetIntegrationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetIntegrationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetProfileObjectType struct { +} + +func (*validateOpGetProfileObjectType) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetProfileObjectType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetProfileObjectTypeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetProfileObjectTypeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetProfileObjectTypeTemplate struct { +} + +func (*validateOpGetProfileObjectTypeTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetProfileObjectTypeTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetProfileObjectTypeTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetProfileObjectTypeTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListAccountIntegrations struct { +} + +func (*validateOpListAccountIntegrations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListAccountIntegrations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListAccountIntegrationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListAccountIntegrationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListIntegrations struct { +} + +func (*validateOpListIntegrations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListIntegrations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListIntegrationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListIntegrationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListProfileObjects struct { +} + +func (*validateOpListProfileObjects) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListProfileObjects) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListProfileObjectsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListProfileObjectsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListProfileObjectTypes struct { +} + +func (*validateOpListProfileObjectTypes) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListProfileObjectTypes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListProfileObjectTypesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListProfileObjectTypesInput(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 validateOpPutIntegration struct { +} + +func (*validateOpPutIntegration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutIntegration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutIntegrationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutIntegrationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutProfileObject struct { +} + +func (*validateOpPutProfileObject) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutProfileObject) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutProfileObjectInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutProfileObjectInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutProfileObjectType struct { +} + +func (*validateOpPutProfileObjectType) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutProfileObjectType) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutProfileObjectTypeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutProfileObjectTypeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSearchProfiles struct { +} + +func (*validateOpSearchProfiles) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSearchProfiles) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SearchProfilesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSearchProfilesInput(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 validateOpUpdateDomain struct { +} + +func (*validateOpUpdateDomain) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateDomain) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateDomainInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateDomainInput(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) +} + +func addOpAddProfileKeyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAddProfileKey{}, middleware.After) +} + +func addOpCreateDomainValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDomain{}, middleware.After) +} + +func addOpCreateProfileValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateProfile{}, middleware.After) +} + +func addOpDeleteDomainValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDomain{}, middleware.After) +} + +func addOpDeleteIntegrationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteIntegration{}, middleware.After) +} + +func addOpDeleteProfileValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteProfile{}, middleware.After) +} + +func addOpDeleteProfileKeyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteProfileKey{}, middleware.After) +} + +func addOpDeleteProfileObjectValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteProfileObject{}, middleware.After) +} + +func addOpDeleteProfileObjectTypeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteProfileObjectType{}, middleware.After) +} + +func addOpGetDomainValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetDomain{}, middleware.After) +} + +func addOpGetIntegrationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetIntegration{}, middleware.After) +} + +func addOpGetProfileObjectTypeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetProfileObjectType{}, middleware.After) +} + +func addOpGetProfileObjectTypeTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetProfileObjectTypeTemplate{}, middleware.After) +} + +func addOpListAccountIntegrationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAccountIntegrations{}, middleware.After) +} + +func addOpListIntegrationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListIntegrations{}, middleware.After) +} + +func addOpListProfileObjectsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListProfileObjects{}, middleware.After) +} + +func addOpListProfileObjectTypesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListProfileObjectTypes{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpPutIntegrationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutIntegration{}, middleware.After) +} + +func addOpPutProfileObjectValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutProfileObject{}, middleware.After) +} + +func addOpPutProfileObjectTypeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutProfileObjectType{}, middleware.After) +} + +func addOpSearchProfilesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSearchProfiles{}, 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 addOpUpdateDomainValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateDomain{}, middleware.After) +} + +func addOpUpdateProfileValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateProfile{}, middleware.After) +} + +func validateOpAddProfileKeyInput(v *AddProfileKeyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AddProfileKeyInput"} + if v.ProfileId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProfileId")) + } + if v.KeyName == nil { + invalidParams.Add(smithy.NewErrParamRequired("KeyName")) + } + if v.Values == nil { + invalidParams.Add(smithy.NewErrParamRequired("Values")) + } + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDomainInput(v *CreateDomainInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDomainInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if v.DefaultExpirationDays == nil { + invalidParams.Add(smithy.NewErrParamRequired("DefaultExpirationDays")) + } + 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.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDomainInput(v *DeleteDomainInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDomainInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteIntegrationInput(v *DeleteIntegrationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteIntegrationInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + 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 v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteProfileKeyInput(v *DeleteProfileKeyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteProfileKeyInput"} + if v.ProfileId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProfileId")) + } + if v.KeyName == nil { + invalidParams.Add(smithy.NewErrParamRequired("KeyName")) + } + if v.Values == nil { + invalidParams.Add(smithy.NewErrParamRequired("Values")) + } + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteProfileObjectInput(v *DeleteProfileObjectInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteProfileObjectInput"} + if v.ProfileId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProfileId")) + } + if v.ProfileObjectUniqueKey == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProfileObjectUniqueKey")) + } + if v.ObjectTypeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ObjectTypeName")) + } + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteProfileObjectTypeInput(v *DeleteProfileObjectTypeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteProfileObjectTypeInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if v.ObjectTypeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ObjectTypeName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetDomainInput(v *GetDomainInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetDomainInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetIntegrationInput(v *GetIntegrationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetIntegrationInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetProfileObjectTypeInput(v *GetProfileObjectTypeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetProfileObjectTypeInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if v.ObjectTypeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ObjectTypeName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetProfileObjectTypeTemplateInput(v *GetProfileObjectTypeTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetProfileObjectTypeTemplateInput"} + if v.TemplateId == nil { + invalidParams.Add(smithy.NewErrParamRequired("TemplateId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListAccountIntegrationsInput(v *ListAccountIntegrationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListAccountIntegrationsInput"} + if v.Uri == nil { + invalidParams.Add(smithy.NewErrParamRequired("Uri")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListIntegrationsInput(v *ListIntegrationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListIntegrationsInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListProfileObjectsInput(v *ListProfileObjectsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListProfileObjectsInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if v.ObjectTypeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ObjectTypeName")) + } + if v.ProfileId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProfileId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListProfileObjectTypesInput(v *ListProfileObjectTypesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListProfileObjectTypesInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + 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 validateOpPutIntegrationInput(v *PutIntegrationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutIntegrationInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if v.Uri == nil { + invalidParams.Add(smithy.NewErrParamRequired("Uri")) + } + if v.ObjectTypeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ObjectTypeName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutProfileObjectInput(v *PutProfileObjectInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutProfileObjectInput"} + if v.ObjectTypeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ObjectTypeName")) + } + if v.Object == nil { + invalidParams.Add(smithy.NewErrParamRequired("Object")) + } + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutProfileObjectTypeInput(v *PutProfileObjectTypeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutProfileObjectTypeInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if v.ObjectTypeName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ObjectTypeName")) + } + if v.Description == nil { + invalidParams.Add(smithy.NewErrParamRequired("Description")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSearchProfilesInput(v *SearchProfilesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchProfilesInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if v.KeyName == nil { + invalidParams.Add(smithy.NewErrParamRequired("KeyName")) + } + if v.Values == nil { + invalidParams.Add(smithy.NewErrParamRequired("Values")) + } + 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 validateOpUpdateDomainInput(v *UpdateDomainInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateDomainInput"} + if v.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + 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.DomainName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainName")) + } + if v.ProfileId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProfileId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/databasemigrationservice/api_op_ModifyReplicationInstance.go b/service/databasemigrationservice/api_op_ModifyReplicationInstance.go index 01ef9c08004..2a3dfa56588 100644 --- a/service/databasemigrationservice/api_op_ModifyReplicationInstance.go +++ b/service/databasemigrationservice/api_op_ModifyReplicationInstance.go @@ -54,7 +54,7 @@ type ModifyReplicationInstanceInput struct { // A value that indicates that minor version upgrades are applied automatically to // the replication instance during the maintenance window. Changing this parameter - // doesn't result in an outage, except in the case dsecribed following. The change + // doesn't result in an outage, except in the case described following. The change // is asynchronously applied as soon as possible. An outage does result if these // factors apply: // diff --git a/service/databasemigrationservice/deserializers.go b/service/databasemigrationservice/deserializers.go index e7dfd2b25e5..06fe523176e 100644 --- a/service/databasemigrationservice/deserializers.go +++ b/service/databasemigrationservice/deserializers.go @@ -7771,6 +7771,24 @@ func awsAwsjson11_deserializeDocumentDocDbSettings(v **types.DocDbSettings, valu sv.Port = ptr.Int32(int32(i64)) } + case "SecretsManagerAccessRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SecretsManagerAccessRoleArn = ptr.String(jtv) + } + + case "SecretsManagerSecretId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SecretsManagerSecretId = ptr.String(jtv) + } + case "ServerName": if value != nil { jtv, ok := value.(string) @@ -8653,6 +8671,24 @@ func awsAwsjson11_deserializeDocumentIBMDb2Settings(v **types.IBMDb2Settings, va sv.Port = ptr.Int32(int32(i64)) } + case "SecretsManagerAccessRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SecretsManagerAccessRoleArn = ptr.String(jtv) + } + + case "SecretsManagerSecretId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SecretsManagerSecretId = ptr.String(jtv) + } + case "ServerName": if value != nil { jtv, ok := value.(string) @@ -9495,6 +9531,24 @@ func awsAwsjson11_deserializeDocumentMicrosoftSQLServerSettings(v **types.Micros sv.SafeguardPolicy = types.SafeguardPolicy(jtv) } + case "SecretsManagerAccessRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SecretsManagerAccessRoleArn = ptr.String(jtv) + } + + case "SecretsManagerSecretId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SecretsManagerSecretId = ptr.String(jtv) + } + case "ServerName": if value != nil { jtv, ok := value.(string) @@ -9647,6 +9701,24 @@ func awsAwsjson11_deserializeDocumentMongoDbSettings(v **types.MongoDbSettings, sv.Port = ptr.Int32(int32(i64)) } + case "SecretsManagerAccessRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SecretsManagerAccessRoleArn = ptr.String(jtv) + } + + case "SecretsManagerSecretId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SecretsManagerSecretId = ptr.String(jtv) + } + case "ServerName": if value != nil { jtv, ok := value.(string) @@ -9775,6 +9847,24 @@ func awsAwsjson11_deserializeDocumentMySQLSettings(v **types.MySQLSettings, valu sv.Port = ptr.Int32(int32(i64)) } + case "SecretsManagerAccessRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SecretsManagerAccessRoleArn = ptr.String(jtv) + } + + case "SecretsManagerSecretId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SecretsManagerSecretId = ptr.String(jtv) + } + case "ServerName": if value != nil { jtv, ok := value.(string) @@ -10192,6 +10282,24 @@ func awsAwsjson11_deserializeDocumentOracleSettings(v **types.OracleSettings, va sv.RetryInterval = ptr.Int32(int32(i64)) } + case "SecretsManagerAccessRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SecretsManagerAccessRoleArn = ptr.String(jtv) + } + + case "SecretsManagerSecretId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SecretsManagerSecretId = ptr.String(jtv) + } + case "SecurityDbEncryption": if value != nil { jtv, ok := value.(string) @@ -10693,6 +10801,24 @@ func awsAwsjson11_deserializeDocumentPostgreSQLSettings(v **types.PostgreSQLSett sv.Port = ptr.Int32(int32(i64)) } + case "SecretsManagerAccessRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SecretsManagerAccessRoleArn = ptr.String(jtv) + } + + case "SecretsManagerSecretId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SecretsManagerSecretId = ptr.String(jtv) + } + case "ServerName": if value != nil { jtv, ok := value.(string) @@ -10951,6 +11077,24 @@ func awsAwsjson11_deserializeDocumentRedshiftSettings(v **types.RedshiftSettings sv.ReplaceInvalidChars = ptr.String(jtv) } + case "SecretsManagerAccessRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SecretsManagerAccessRoleArn = ptr.String(jtv) + } + + case "SecretsManagerSecretId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SecretsManagerSecretId = ptr.String(jtv) + } + case "ServerName": if value != nil { jtv, ok := value.(string) @@ -13687,6 +13831,24 @@ func awsAwsjson11_deserializeDocumentSybaseSettings(v **types.SybaseSettings, va sv.Port = ptr.Int32(int32(i64)) } + case "SecretsManagerAccessRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SecretsManagerAccessRoleArn = ptr.String(jtv) + } + + case "SecretsManagerSecretId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SecretsManagerSecretId = ptr.String(jtv) + } + case "ServerName": if value != nil { jtv, ok := value.(string) diff --git a/service/databasemigrationservice/serializers.go b/service/databasemigrationservice/serializers.go index 5c9abd607fc..984cf243b3f 100644 --- a/service/databasemigrationservice/serializers.go +++ b/service/databasemigrationservice/serializers.go @@ -2547,6 +2547,16 @@ func awsAwsjson11_serializeDocumentDocDbSettings(v *types.DocDbSettings, value s ok.Integer(*v.Port) } + if v.SecretsManagerAccessRoleArn != nil { + ok := object.Key("SecretsManagerAccessRoleArn") + ok.String(*v.SecretsManagerAccessRoleArn) + } + + if v.SecretsManagerSecretId != nil { + ok := object.Key("SecretsManagerSecretId") + ok.String(*v.SecretsManagerSecretId) + } + if v.ServerName != nil { ok := object.Key("ServerName") ok.String(*v.ServerName) @@ -2693,6 +2703,16 @@ func awsAwsjson11_serializeDocumentIBMDb2Settings(v *types.IBMDb2Settings, value ok.Integer(*v.Port) } + if v.SecretsManagerAccessRoleArn != nil { + ok := object.Key("SecretsManagerAccessRoleArn") + ok.String(*v.SecretsManagerAccessRoleArn) + } + + if v.SecretsManagerSecretId != nil { + ok := object.Key("SecretsManagerSecretId") + ok.String(*v.SecretsManagerSecretId) + } + if v.ServerName != nil { ok := object.Key("ServerName") ok.String(*v.ServerName) @@ -2881,6 +2901,16 @@ func awsAwsjson11_serializeDocumentMicrosoftSQLServerSettings(v *types.Microsoft ok.String(string(v.SafeguardPolicy)) } + if v.SecretsManagerAccessRoleArn != nil { + ok := object.Key("SecretsManagerAccessRoleArn") + ok.String(*v.SecretsManagerAccessRoleArn) + } + + if v.SecretsManagerSecretId != nil { + ok := object.Key("SecretsManagerSecretId") + ok.String(*v.SecretsManagerSecretId) + } + if v.ServerName != nil { ok := object.Key("ServerName") ok.String(*v.ServerName) @@ -2953,6 +2983,16 @@ func awsAwsjson11_serializeDocumentMongoDbSettings(v *types.MongoDbSettings, val ok.Integer(*v.Port) } + if v.SecretsManagerAccessRoleArn != nil { + ok := object.Key("SecretsManagerAccessRoleArn") + ok.String(*v.SecretsManagerAccessRoleArn) + } + + if v.SecretsManagerSecretId != nil { + ok := object.Key("SecretsManagerSecretId") + ok.String(*v.SecretsManagerSecretId) + } + if v.ServerName != nil { ok := object.Key("ServerName") ok.String(*v.ServerName) @@ -3005,6 +3045,16 @@ func awsAwsjson11_serializeDocumentMySQLSettings(v *types.MySQLSettings, value s ok.Integer(*v.Port) } + if v.SecretsManagerAccessRoleArn != nil { + ok := object.Key("SecretsManagerAccessRoleArn") + ok.String(*v.SecretsManagerAccessRoleArn) + } + + if v.SecretsManagerSecretId != nil { + ok := object.Key("SecretsManagerSecretId") + ok.String(*v.SecretsManagerSecretId) + } + if v.ServerName != nil { ok := object.Key("ServerName") ok.String(*v.ServerName) @@ -3194,6 +3244,16 @@ func awsAwsjson11_serializeDocumentOracleSettings(v *types.OracleSettings, value ok.Integer(*v.RetryInterval) } + if v.SecretsManagerAccessRoleArn != nil { + ok := object.Key("SecretsManagerAccessRoleArn") + ok.String(*v.SecretsManagerAccessRoleArn) + } + + if v.SecretsManagerSecretId != nil { + ok := object.Key("SecretsManagerSecretId") + ok.String(*v.SecretsManagerSecretId) + } + if v.SecurityDbEncryption != nil { ok := object.Key("SecurityDbEncryption") ok.String(*v.SecurityDbEncryption) @@ -3276,6 +3336,16 @@ func awsAwsjson11_serializeDocumentPostgreSQLSettings(v *types.PostgreSQLSetting ok.Integer(*v.Port) } + if v.SecretsManagerAccessRoleArn != nil { + ok := object.Key("SecretsManagerAccessRoleArn") + ok.String(*v.SecretsManagerAccessRoleArn) + } + + if v.SecretsManagerSecretId != nil { + ok := object.Key("SecretsManagerSecretId") + ok.String(*v.SecretsManagerSecretId) + } + if v.ServerName != nil { ok := object.Key("ServerName") ok.String(*v.ServerName) @@ -3398,6 +3468,16 @@ func awsAwsjson11_serializeDocumentRedshiftSettings(v *types.RedshiftSettings, v ok.String(*v.ReplaceInvalidChars) } + if v.SecretsManagerAccessRoleArn != nil { + ok := object.Key("SecretsManagerAccessRoleArn") + ok.String(*v.SecretsManagerAccessRoleArn) + } + + if v.SecretsManagerSecretId != nil { + ok := object.Key("SecretsManagerSecretId") + ok.String(*v.SecretsManagerSecretId) + } + if v.ServerName != nil { ok := object.Key("ServerName") ok.String(*v.ServerName) @@ -3629,6 +3709,16 @@ func awsAwsjson11_serializeDocumentSybaseSettings(v *types.SybaseSettings, value ok.Integer(*v.Port) } + if v.SecretsManagerAccessRoleArn != nil { + ok := object.Key("SecretsManagerAccessRoleArn") + ok.String(*v.SecretsManagerAccessRoleArn) + } + + if v.SecretsManagerSecretId != nil { + ok := object.Key("SecretsManagerSecretId") + ok.String(*v.SecretsManagerSecretId) + } + if v.ServerName != nil { ok := object.Key("ServerName") ok.String(*v.ServerName) diff --git a/service/databasemigrationservice/types/enums.go b/service/databasemigrationservice/types/enums.go index 033c4f5738a..79923c6b946 100644 --- a/service/databasemigrationservice/types/enums.go +++ b/service/databasemigrationservice/types/enums.go @@ -371,6 +371,11 @@ func (SafeguardPolicy) Values() []SafeguardPolicy { type SourceType string +// Enum values for SourceType +const ( + SourceTypeReplicationInstance SourceType = "replication-instance" +) + // Values returns all known values for SourceType. 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. diff --git a/service/databasemigrationservice/types/types.go b/service/databasemigrationservice/types/types.go index 3cd79d1a0cc..3adba8fa378 100644 --- a/service/databasemigrationservice/types/types.go +++ b/service/databasemigrationservice/types/types.go @@ -147,6 +147,24 @@ type DocDbSettings struct { // The port value for the DocumentDB source endpoint. Port *int32 + // The full Amazon Resource Name (ARN) of the IAM role that specifies AWS DMS as + // the trusted entity and grants the required permissions to access the value in + // SecretsManagerSecret. SecretsManagerSecret has the value of the AWS Secrets + // Manager secret that allows access to the DocumentDB endpoint. You can specify + // one of two sets of values for these permissions. You can specify the values for + // this setting and SecretsManagerSecretId. Or you can specify clear-text values + // for UserName, Password, ServerName, and Port. You can't specify both. For more + // information on creating this SecretsManagerSecret and the + // SecretsManagerAccessRoleArn and SecretsManagerSecretId required to access it, + // see Using secrets to access AWS Database Migration Service resources + // (https://docs.aws.amazon.com/https:/docs.aws.amazon.com/dms/latest/userguide/CHAP_Security.html#security-iam-secretsmanager) + // in the AWS Database Migration Service User Guide. + SecretsManagerAccessRoleArn *string + + // The full ARN, partial ARN, or friendly name of the SecretsManagerSecret that + // contains the DocumentDB endpoint connection details. + SecretsManagerSecretId *string + // The name of the server on the DocumentDB source endpoint. ServerName *string @@ -423,7 +441,7 @@ type EventSubscription struct { // Identifies the name and value of a filter object. This filter is used to limit // the number and type of AWS DMS objects that are returned for a particular // Describe* call or similar operation. Filters are used as an optional parameter -// to the following APIs. +// for certain API operations. type Filter struct { // The name of the filter as specified for a Describe* or similar operation. @@ -457,6 +475,24 @@ type IBMDb2Settings struct { // Endpoint TCP port. Port *int32 + // The full Amazon Resource Name (ARN) of the IAM role that specifies AWS DMS as + // the trusted entity and grants the required permissions to access the value in + // SecretsManagerSecret. SecretsManagerSecret has the value of the AWS Secrets + // Manager secret that allows access to the Db2 LUW endpoint. You can specify one + // of two sets of values for these permissions. You can specify the values for this + // setting and SecretsManagerSecretId. Or you can specify clear-text values for + // UserName, Password, ServerName, and Port. You can't specify both. For more + // information on creating this SecretsManagerSecret and the + // SecretsManagerAccessRoleArn and SecretsManagerSecretId required to access it, + // see Using secrets to access AWS Database Migration Service resources + // (https://docs.aws.amazon.com/https:/docs.aws.amazon.com/dms/latest/userguide/CHAP_Security.html#security-iam-secretsmanager) + // in the AWS Database Migration Service User Guide. + SecretsManagerAccessRoleArn *string + + // The full ARN, partial ARN, or friendly name of the SecretsManagerSecret that + // contains the Db2 LUW endpoint connection details. + SecretsManagerSecretId *string + // Fully qualified domain name of the endpoint. ServerName *string @@ -575,9 +611,9 @@ type MicrosoftSQLServerSettings struct { // The maximum size of the packets (in bytes) used to transfer data using BCP. BcpPacketSize *int32 - // Specify a filegroup for the AWS DMS internal tables. When the replication task - // starts, all the internal AWS DMS control tables (awsdms_ apply_exception, - // awsdms_apply, awsdms_changes) are created on the specified filegroup. + // Specifies a file group for the AWS DMS internal tables. When the replication + // task starts, all the internal AWS DMS control tables (awsdms_ apply_exception, + // awsdms_apply, awsdms_changes) are created for the specified file group. ControlTablesFileGroup *string // Database name for the endpoint. @@ -612,6 +648,24 @@ type MicrosoftSQLServerSettings struct { // use the default method. SafeguardPolicy SafeguardPolicy + // The full Amazon Resource Name (ARN) of the IAM role that specifies AWS DMS as + // the trusted entity and grants the required permissions to access the value in + // SecretsManagerSecret. SecretsManagerSecret has the value of the AWS Secrets + // Manager secret that allows access to the SQL Server endpoint. You can specify + // one of two sets of values for these permissions. You can specify the values for + // this setting and SecretsManagerSecretId. Or you can specify clear-text values + // for UserName, Password, ServerName, and Port. You can't specify both. For more + // information on creating this SecretsManagerSecret and the + // SecretsManagerAccessRoleArn and SecretsManagerSecretId required to access it, + // see Using secrets to access AWS Database Migration Service resources + // (https://docs.aws.amazon.com/https:/docs.aws.amazon.com/dms/latest/userguide/CHAP_Security.html#security-iam-secretsmanager) + // in the AWS Database Migration Service User Guide. + SecretsManagerAccessRoleArn *string + + // The full ARN, partial ARN, or friendly name of the SecretsManagerSecret that + // contains the SQL Server endpoint connection details. + SecretsManagerSecretId *string + // Fully qualified domain name of the endpoint. ServerName *string @@ -670,6 +724,24 @@ type MongoDbSettings struct { // The port value for the MongoDB source endpoint. Port *int32 + // The full Amazon Resource Name (ARN) of the IAM role that specifies AWS DMS as + // the trusted entity and grants the required permissions to access the value in + // SecretsManagerSecret. SecretsManagerSecret has the value of the AWS Secrets + // Manager secret that allows access to the MongoDB endpoint. You can specify one + // of two sets of values for these permissions. You can specify the values for this + // setting and SecretsManagerSecretId. Or you can specify clear-text values for + // UserName, Password, ServerName, and Port. You can't specify both. For more + // information on creating this SecretsManagerSecret and the + // SecretsManagerAccessRoleArn and SecretsManagerSecretId required to access it, + // see Using secrets to access AWS Database Migration Service resources + // (https://docs.aws.amazon.com/https:/docs.aws.amazon.com/dms/latest/userguide/CHAP_Security.html#security-iam-secretsmanager) + // in the AWS Database Migration Service User Guide. + SecretsManagerAccessRoleArn *string + + // The full ARN, partial ARN, or friendly name of the SecretsManagerSecret that + // contains the MongoDB endpoint connection details. + SecretsManagerSecretId *string + // The name of the server on the MongoDB source endpoint. ServerName *string @@ -697,11 +769,11 @@ type MySQLSettings struct { // MySQL-compatible database. Example: maxFileSize=512 MaxFileSize *int32 - // Improves performance when loading data into the MySQLcompatible target database. - // Specifies how many threads to use to load the data into the MySQL-compatible - // target database. Setting a large number of threads can have an adverse effect on - // database performance, because a separate connection is required for each thread. - // Example: parallelLoadThreads=1 + // Improves performance when loading data into the MySQL-compatible target + // database. Specifies how many threads to use to load the data into the + // MySQL-compatible target database. Setting a large number of threads can have an + // adverse effect on database performance, because a separate connection is + // required for each thread. Example: parallelLoadThreads=1 ParallelLoadThreads *int32 // Endpoint connection password. @@ -710,6 +782,24 @@ type MySQLSettings struct { // Endpoint TCP port. Port *int32 + // The full Amazon Resource Name (ARN) of the IAM role that specifies AWS DMS as + // the trusted entity and grants the required permissions to access the value in + // SecretsManagerSecret. SecretsManagerSecret has the value of the AWS Secrets + // Manager secret that allows access to the MySQL endpoint. You can specify one of + // two sets of values for these permissions. You can specify the values for this + // setting and SecretsManagerSecretId. Or you can specify clear-text values for + // UserName, Password, ServerName, and Port. You can't specify both. For more + // information on creating this SecretsManagerSecret and the + // SecretsManagerAccessRoleArn and SecretsManagerSecretId required to access it, + // see Using secrets to access AWS Database Migration Service resources + // (https://docs.aws.amazon.com/https:/docs.aws.amazon.com/dms/latest/userguide/CHAP_Security.html#security-iam-secretsmanager) + // in the AWS Database Migration Service User Guide. + SecretsManagerAccessRoleArn *string + + // The full ARN, partial ARN, or friendly name of the SecretsManagerSecret that + // contains the MySQL endpoint connection details. + SecretsManagerSecretId *string + // Fully qualified domain name of the endpoint. ServerName *string @@ -905,6 +995,24 @@ type OracleSettings struct { // Example: retryInterval=6; RetryInterval *int32 + // The full Amazon Resource Name (ARN) of the IAM role that specifies AWS DMS as + // the trusted entity and grants the required permissions to access the value in + // SecretsManagerSecret. SecretsManagerSecret has the value of the AWS Secrets + // Manager secret that allows access to the Oracle endpoint. You can specify one of + // two sets of values for these permissions. You can specify the values for this + // setting and SecretsManagerSecretId. Or you can specify clear-text values for + // UserName, Password, ServerName, and Port. You can't specify both. For more + // information on creating this SecretsManagerSecret and the + // SecretsManagerAccessRoleArn and SecretsManagerSecretId required to access it, + // see Using secrets to access AWS Database Migration Service resources + // (https://docs.aws.amazon.com/https:/docs.aws.amazon.com/dms/latest/userguide/CHAP_Security.html#security-iam-secretsmanager) + // in the AWS Database Migration Service User Guide. + SecretsManagerAccessRoleArn *string + + // The full ARN, partial ARN, or friendly name of the SecretsManagerSecret that + // contains the Oracle endpoint connection details. + SecretsManagerSecretId *string + // For an Oracle source endpoint, the transparent data encryption (TDE) password // required by AWM DMS to access Oracle redo logs encrypted by TDE using Binary // Reader. It is also the TDE_Password part of the comma-separated value you set @@ -1066,6 +1174,24 @@ type PostgreSQLSettings struct { // Endpoint TCP port. Port *int32 + // The full Amazon Resource Name (ARN) of the IAM role that specifies AWS DMS as + // the trusted entity and grants the required permissions to access the value in + // SecretsManagerSecret. SecretsManagerSecret has the value of the AWS Secrets + // Manager secret that allows access to the PostgreSQL endpoint. You can specify + // one of two sets of values for these permissions. You can specify the values for + // this setting and SecretsManagerSecretId. Or you can specify clear-text values + // for UserName, Password, ServerName, and Port. You can't specify both. For more + // information on creating this SecretsManagerSecret and the + // SecretsManagerAccessRoleArn and SecretsManagerSecretId required to access it, + // see Using secrets to access AWS Database Migration Service resources + // (https://docs.aws.amazon.com/https:/docs.aws.amazon.com/dms/latest/userguide/CHAP_Security.html#security-iam-secretsmanager) + // in the AWS Database Migration Service User Guide. + SecretsManagerAccessRoleArn *string + + // The full ARN, partial ARN, or friendly name of the SecretsManagerSecret that + // contains the PostgreSQL endpoint connection details. + SecretsManagerSecretId *string + // Fully qualified domain name of the endpoint. ServerName *string @@ -1098,10 +1224,11 @@ type RedshiftSettings struct { // converts source records into .csv files and loads them to the // BucketFolder/TableID path. AWS DMS uses the Redshift COPY command to upload the // .csv files to the target table. The files are deleted once the COPY operation - // has finished. For more information, see Amazon Redshift Database Developer Guide - // (https://docs.aws.amazon.com/redshift/latest/dg/r_COPY.html) For - // change-data-capture (CDC) mode, AWS DMS creates a NetChanges table, and loads - // the .csv files to this BucketFolder/NetChangesTableID path. + // has finished. For more information, see COPY + // (https://docs.aws.amazon.com/redshift/latest/dg/r_COPY.html) in the Amazon + // Redshift Database Developer Guide. For change-data-capture (CDC) mode, AWS DMS + // creates a NetChanges table, and loads the .csv files to this + // BucketFolder/NetChangesTableID path. BucketFolder *string // The name of the intermediate S3 bucket used to store .csv files before uploading @@ -1191,6 +1318,24 @@ type RedshiftSettings struct { // A list of characters that you want to replace. Use with ReplaceChars. ReplaceInvalidChars *string + // The full Amazon Resource Name (ARN) of the IAM role that specifies AWS DMS as + // the trusted entity and grants the required permissions to access the value in + // SecretsManagerSecret. SecretsManagerSecret has the value of the AWS Secrets + // Manager secret that allows access to the Amazon Redshift endpoint. You can + // specify one of two sets of values for these permissions. You can specify the + // values for this setting and SecretsManagerSecretId. Or you can specify + // clear-text values for UserName, Password, ServerName, and Port. You can't + // specify both. For more information on creating this SecretsManagerSecret and the + // SecretsManagerAccessRoleArn and SecretsManagerSecretId required to access it, + // see Using secrets to access AWS Database Migration Service resources + // (https://docs.aws.amazon.com/https:/docs.aws.amazon.com/dms/latest/userguide/CHAP_Security.html#security-iam-secretsmanager) + // in the AWS Database Migration Service User Guide. + SecretsManagerAccessRoleArn *string + + // The full ARN, partial ARN, or friendly name of the SecretsManagerSecret that + // contains the Amazon Redshift endpoint connection details. + SecretsManagerSecretId *string + // The name of the Amazon Redshift cluster you are using. ServerName *string @@ -1891,18 +2036,25 @@ type S3Settings struct { // Specifies the folder path of CDC files. For an S3 source, this setting is // required if a task captures change data; otherwise, it's optional. If CdcPath is // set, AWS DMS reads CDC files from this path and replicates the data changes to - // the target endpoint. For an S3 target, if CdcPathis set, it is the folder path - // where data changes are replicated. If you set PreserveTransactions to true, AWS - // DMS verifies that you have set this parameter to a folder path on your S3 target - // where AWS DMS can save the transaction order for the CDC load. AWS DMS creates - // this CDC folder path in either your S3 target working directory or the S3 target - // location specified by BucketFolder and BucketName. For example, if you specify - // CdcPath as MyChangedData, and you specify BucketName as MyTargetBucket but do - // not specify BucketFolder, AWS DMS creates the CDC folder path following: - // MyTargetBucket/MyChangedData. If you specify the same CdcPath, and you specify - // BucketName as MyTargetBucket and BucketFolder as MyTargetData, AWS DMS creates - // the CDC folder path following: MyTargetBucket/MyTargetData/MyChangedData. This - // setting is supported in AWS DMS versions 3.4.2 and later. + // the target endpoint. For an S3 target if you set PreserveTransactions + // (https://docs.aws.amazon.com/dms/latest/APIReference/API_S3Settings.html#DMS-Type-S3Settings-PreserveTransactions) + // to true, AWS DMS verifies that you have set this parameter to a folder path on + // your S3 target where AWS DMS can save the transaction order for the CDC load. + // AWS DMS creates this CDC folder path in either your S3 target working directory + // or the S3 target location specified by BucketFolder + // (https://docs.aws.amazon.com/dms/latest/APIReference/API_S3Settings.html#DMS-Type-S3Settings-BucketFolder) + // and BucketName + // (https://docs.aws.amazon.com/dms/latest/APIReference/API_S3Settings.html#DMS-Type-S3Settings-BucketName). + // For example, if you specify CdcPath as MyChangedData, and you specify BucketName + // as MyTargetBucket but do not specify BucketFolder, AWS DMS creates the CDC + // folder path following: MyTargetBucket/MyChangedData. If you specify the same + // CdcPath, and you specify BucketName as MyTargetBucket and BucketFolder as + // MyTargetData, AWS DMS creates the CDC folder path following: + // MyTargetBucket/MyTargetData/MyChangedData. For more information on CDC including + // transaction order on an S3 target, see Capturing data changes (CDC) including + // transaction order on the S3 target + // (https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.S3.html#CHAP_Target.S3.EndpointSettings.CdcPath). + // This setting is supported in AWS DMS versions 3.4.2 and later. CdcPath *string // An optional parameter to use GZIP to compress the target files. Set to GZIP to @@ -1916,11 +2068,13 @@ type S3Settings struct { CsvDelimiter *string // This setting only applies if your Amazon S3 output files during a change data - // capture (CDC) load are written in .csv format. If UseCsvNoSupValue is set to - // true, specify a string value that you want AWS DMS to use for all columns not - // included in the supplemental log. If you do not specify a string value, AWS DMS - // uses the null value for these columns regardless of the UseCsvNoSupValue - // setting. This setting is supported in AWS DMS versions 3.4.1 and later. + // capture (CDC) load are written in .csv format. If UseCsvNoSupValue + // (https://docs.aws.amazon.com/dms/latest/APIReference/API_S3Settings.html#DMS-Type-S3Settings-UseCsvNoSupValue) + // is set to true, specify a string value that you want AWS DMS to use for all + // columns not included in the supplemental log. If you do not specify a string + // value, AWS DMS uses the null value for these columns regardless of the + // UseCsvNoSupValue setting. This setting is supported in AWS DMS versions 3.4.1 + // and later. CsvNoSupValue *string // The delimiter used to separate rows in the .csv file for both source and target. @@ -2059,8 +2213,12 @@ type S3Settings struct { ParquetVersion ParquetVersionValue // If set to true, AWS DMS saves the transaction order for a change data capture - // (CDC) load on the Amazon S3 target specified by CdcPath. This setting is - // supported in AWS DMS versions 3.4.2 and later. + // (CDC) load on the Amazon S3 target specified by CdcPath + // (https://docs.aws.amazon.com/dms/latest/APIReference/API_S3Settings.html#DMS-Type-S3Settings-CdcPath). + // For more information, see Capturing data changes (CDC) including transaction + // order on the S3 target + // (https://docs.aws.amazon.com/dms/latest/userguide/CHAP_Target.S3.html#CHAP_Target.S3.EndpointSettings.CdcPath). + // This setting is supported in AWS DMS versions 3.4.2 and later. PreserveTransactions *bool // The number of rows in a row group. A smaller row group size provides faster @@ -2100,9 +2258,10 @@ type S3Settings struct { // This setting applies if the S3 output files during a change data capture (CDC) // load are written in .csv format. If set to true for columns not included in the - // supplemental log, AWS DMS uses the value specified by CsvNoSupValue. If not set - // or set to false, AWS DMS uses the null value for these columns. This setting is - // supported in AWS DMS versions 3.4.1 and later. + // supplemental log, AWS DMS uses the value specified by CsvNoSupValue + // (https://docs.aws.amazon.com/dms/latest/APIReference/API_S3Settings.html#DMS-Type-S3Settings-CsvNoSupValue). + // If not set or set to false, AWS DMS uses the null value for these columns. This + // setting is supported in AWS DMS versions 3.4.1 and later. UseCsvNoSupValue *bool } @@ -2161,6 +2320,24 @@ type SybaseSettings struct { // Endpoint TCP port. Port *int32 + // The full Amazon Resource Name (ARN) of the IAM role that specifies AWS DMS as + // the trusted entity and grants the required permissions to access the value in + // SecretsManagerSecret. SecretsManagerSecret has the value of the AWS Secrets + // Manager secret that allows access to the SAP ASE endpoint. You can specify one + // of two sets of values for these permissions. You can specify the values for this + // setting and SecretsManagerSecretId. Or you can specify clear-text values for + // UserName, Password, ServerName, and Port. You can't specify both. For more + // information on creating this SecretsManagerSecret and the + // SecretsManagerAccessRoleArn and SecretsManagerSecretId required to access it, + // see Using secrets to access AWS Database Migration Service resources + // (https://docs.aws.amazon.com/https:/docs.aws.amazon.com/dms/latest/userguide/CHAP_Security.html#security-iam-secretsmanager) + // in the AWS Database Migration Service User Guide. + SecretsManagerAccessRoleArn *string + + // The full ARN, partial ARN, or friendly name of the SecretsManagerSecret that + // contains the SAP SAE endpoint connection details. + SecretsManagerSecretId *string + // Fully qualified domain name of the endpoint. ServerName *string diff --git a/service/dax/types/enums.go b/service/dax/types/enums.go index 4164ab141a2..e39c82bff7f 100644 --- a/service/dax/types/enums.go +++ b/service/dax/types/enums.go @@ -4,6 +4,12 @@ package types type ChangeType string +// Enum values for ChangeType +const ( + ChangeTypeImmediate ChangeType = "IMMEDIATE" + ChangeTypeRequiresReboot ChangeType = "REQUIRES_REBOOT" +) + // Values returns all known values for ChangeType. 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. @@ -16,6 +22,13 @@ func (ChangeType) Values() []ChangeType { type IsModifiable string +// Enum values for IsModifiable +const ( + IsModifiableTrue IsModifiable = "TRUE" + IsModifiableFalse IsModifiable = "FALSE" + IsModifiableConditional IsModifiable = "CONDITIONAL" +) + // Values returns all known values for IsModifiable. 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. @@ -29,6 +42,12 @@ func (IsModifiable) Values() []IsModifiable { type ParameterType string +// Enum values for ParameterType +const ( + ParameterTypeDefault ParameterType = "DEFAULT" + ParameterTypeNodeTypeSpecific ParameterType = "NODE_TYPE_SPECIFIC" +) + // Values returns all known values for ParameterType. 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. @@ -41,6 +60,13 @@ func (ParameterType) Values() []ParameterType { type SourceType string +// Enum values for SourceType +const ( + SourceTypeCluster SourceType = "CLUSTER" + SourceTypeParameterGroup SourceType = "PARAMETER_GROUP" + SourceTypeSubnetGroup SourceType = "SUBNET_GROUP" +) + // Values returns all known values for SourceType. 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. @@ -54,6 +80,14 @@ func (SourceType) Values() []SourceType { type SSEStatus string +// Enum values for SSEStatus +const ( + SSEStatusEnabling SSEStatus = "ENABLING" + SSEStatusEnabled SSEStatus = "ENABLED" + SSEStatusDisabling SSEStatus = "DISABLING" + SSEStatusDisabled SSEStatus = "DISABLED" +) + // Values returns all known values for SSEStatus. 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. diff --git a/service/devopsguru/api_op_AddNotificationChannel.go b/service/devopsguru/api_op_AddNotificationChannel.go index 5e4f55ad600..5f13531bee2 100644 --- a/service/devopsguru/api_op_AddNotificationChannel.go +++ b/service/devopsguru/api_op_AddNotificationChannel.go @@ -11,6 +11,18 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// Adds a notification channel to DevOps Guru. A notification channel is used to +// notify you about important DevOps Guru events, such as when an insight is +// generated. If you use an Amazon SNS topic in another account, you must attach a +// policy to it that grants DevOps Guru permission to it notifications. DevOps Guru +// adds the required policy on your behalf to send notifications using Amazon SNS +// in your account. For more information, see Permissions for cross account Amazon +// SNS topics +// (https://docs.aws.amazon.com/devops-guru/latest/userguide/sns-required-permissions.html). +// If you use an Amazon SNS topic that is encrypted by an AWS Key Management +// Service customer-managed key (CMK), then you must add permissions to the CMK. +// For more information, see Permissions for AWS KMS–encrypted Amazon SNS topics +// (https://docs.aws.amazon.com/devops-guru/latest/userguide/sns-kms-permissions.html). func (c *Client) AddNotificationChannel(ctx context.Context, params *AddNotificationChannelInput, optFns ...func(*Options)) (*AddNotificationChannelOutput, error) { if params == nil { params = &AddNotificationChannelInput{} @@ -28,11 +40,19 @@ func (c *Client) AddNotificationChannel(ctx context.Context, params *AddNotifica type AddNotificationChannelInput struct { + // A NotificationChannelConfig object that specifies what type of notification + // channel to add. The one supported notification channel is Amazon Simple + // Notification Service (Amazon SNS). + // // This member is required. Config *types.NotificationChannelConfig } type AddNotificationChannelOutput struct { + + // The ID of the added notification channel. + // + // This member is required. Id *string // Metadata pertaining to the operation's result. diff --git a/service/devopsguru/api_op_DescribeAccountHealth.go b/service/devopsguru/api_op_DescribeAccountHealth.go index 3165fe3d795..08bae245edf 100644 --- a/service/devopsguru/api_op_DescribeAccountHealth.go +++ b/service/devopsguru/api_op_DescribeAccountHealth.go @@ -10,6 +10,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// Returns the number of open reactive insights, the number of open proactive +// insights, and the number of metrics analyzed in your AWS account. Use these +// numbers to gauge the health of operations in your AWS account. func (c *Client) DescribeAccountHealth(ctx context.Context, params *DescribeAccountHealthInput, optFns ...func(*Options)) (*DescribeAccountHealthOutput, error) { if params == nil { params = &DescribeAccountHealthInput{} @@ -29,10 +32,23 @@ type DescribeAccountHealthInput struct { } type DescribeAccountHealthOutput struct { + + // An integer that specifies the number of metrics that have been analyzed in your + // AWS account. + // + // This member is required. MetricsAnalyzed int32 + // An integer that specifies the number of open proactive insights in your AWS + // account. + // + // This member is required. OpenProactiveInsights int32 + // An integer that specifies the number of open reactive insights in your AWS + // account. + // + // This member is required. OpenReactiveInsights int32 // Metadata pertaining to the operation's result. diff --git a/service/devopsguru/api_op_DescribeAccountOverview.go b/service/devopsguru/api_op_DescribeAccountOverview.go index 4dcdd34ba77..69306e89c6d 100644 --- a/service/devopsguru/api_op_DescribeAccountOverview.go +++ b/service/devopsguru/api_op_DescribeAccountOverview.go @@ -11,6 +11,9 @@ import ( "time" ) +// For the time range passed in, returns the number of open reactive insight that +// were created, the number of open proactive insights that were created, and the +// Mean Time to Recover (MTTR) for all closed reactive insights. func (c *Client) DescribeAccountOverview(ctx context.Context, params *DescribeAccountOverviewInput, optFns ...func(*Options)) (*DescribeAccountOverviewOutput, error) { if params == nil { params = &DescribeAccountOverviewInput{} @@ -28,17 +31,37 @@ func (c *Client) DescribeAccountOverview(ctx context.Context, params *DescribeAc type DescribeAccountOverviewInput struct { + // The start of the time range passed in. The start time granularity is at the day + // level. The floor of the start time is used. Returned information occurred after + // this day. + // // This member is required. FromTime *time.Time + // The end of the time range passed in. The start time granularity is at the day + // level. The floor of the start time is used. Returned information occurred before + // this day. If this is not specified, then the current day is used. ToTime *time.Time } type DescribeAccountOverviewOutput struct { - MeanTimeToRecoverInMilliseconds int64 + // The Mean Time to Recover (MTTR) for all closed insights that were created during + // the time range passed in. + // + // This member is required. + MeanTimeToRecoverInMilliseconds *int64 + + // An integer that specifies the number of open proactive insights in your AWS + // account that were created during the time range passed in. + // + // This member is required. ProactiveInsights int32 + // An integer that specifies the number of open reactive insights in your AWS + // account that were created during the time range passed in. + // + // This member is required. ReactiveInsights int32 // Metadata pertaining to the operation's result. diff --git a/service/devopsguru/api_op_DescribeAnomaly.go b/service/devopsguru/api_op_DescribeAnomaly.go index 1ecf68b452d..f1e8713b139 100644 --- a/service/devopsguru/api_op_DescribeAnomaly.go +++ b/service/devopsguru/api_op_DescribeAnomaly.go @@ -11,6 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// Returns details about an anomaly that you specify using its ID. func (c *Client) DescribeAnomaly(ctx context.Context, params *DescribeAnomalyInput, optFns ...func(*Options)) (*DescribeAnomalyOutput, error) { if params == nil { params = &DescribeAnomalyInput{} @@ -28,13 +29,18 @@ func (c *Client) DescribeAnomaly(ctx context.Context, params *DescribeAnomalyInp type DescribeAnomalyInput struct { + // The ID of the anomaly. + // // This member is required. Id *string } type DescribeAnomalyOutput struct { + + // An ReactiveAnomaly object that represents the requested anomaly. ProactiveAnomaly *types.ProactiveAnomaly + // An ProactiveAnomaly object that represents the requested anomaly. ReactiveAnomaly *types.ReactiveAnomaly // Metadata pertaining to the operation's result. diff --git a/service/devopsguru/api_op_DescribeInsight.go b/service/devopsguru/api_op_DescribeInsight.go index bf1cf334591..c73202a46f1 100644 --- a/service/devopsguru/api_op_DescribeInsight.go +++ b/service/devopsguru/api_op_DescribeInsight.go @@ -11,6 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// Returns details about an insight that you specify using its ID. func (c *Client) DescribeInsight(ctx context.Context, params *DescribeInsightInput, optFns ...func(*Options)) (*DescribeInsightOutput, error) { if params == nil { params = &DescribeInsightInput{} @@ -28,13 +29,18 @@ func (c *Client) DescribeInsight(ctx context.Context, params *DescribeInsightInp type DescribeInsightInput struct { + // The ID of the insight. + // // This member is required. Id *string } type DescribeInsightOutput struct { + + // An ProactiveInsight object that represents the requested insight. ProactiveInsight *types.ProactiveInsight + // An ReactiveInsight object that represents the requested insight. ReactiveInsight *types.ReactiveInsight // Metadata pertaining to the operation's result. diff --git a/service/devopsguru/api_op_DescribeResourceCollectionHealth.go b/service/devopsguru/api_op_DescribeResourceCollectionHealth.go index 2c41459a8dc..9e3c7b5fa00 100644 --- a/service/devopsguru/api_op_DescribeResourceCollectionHealth.go +++ b/service/devopsguru/api_op_DescribeResourceCollectionHealth.go @@ -12,6 +12,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// Returns the number of open proactive insights, open reactive insights, and the +// Mean Time to Recover (MTTR) for all closed insights in resource collections in +// your account. You specify the type of AWS resources collection. The one type of +// AWS resource collection supported is AWS CloudFormation stacks. DevOps Guru can +// be configured to analyze only the AWS resources that are defined in the stacks. func (c *Client) DescribeResourceCollectionHealth(ctx context.Context, params *DescribeResourceCollectionHealthInput, optFns ...func(*Options)) (*DescribeResourceCollectionHealthOutput, error) { if params == nil { params = &DescribeResourceCollectionHealthInput{} @@ -29,15 +34,29 @@ func (c *Client) DescribeResourceCollectionHealth(ctx context.Context, params *D type DescribeResourceCollectionHealthInput struct { + // An AWS resource collection type. This type specifies how analyzed AWS resources + // are defined. The one type of AWS resource collection supported is AWS + // CloudFormation stacks. DevOps Guru can be configured to analyze only the AWS + // resources that are defined in the stacks. + // // This member is required. - ResourceCollectionType *string + ResourceCollectionType types.ResourceCollectionType + // The pagination token to use to retrieve the next page of results for this + // operation. If this value is null, it retrieves the first page. NextToken *string } type DescribeResourceCollectionHealthOutput struct { + + // The returned CloudFormationHealthOverview object that contains an + // InsightHealthOverview object with the requested system health information. + // + // This member is required. CloudFormation []types.CloudFormationHealth + // The pagination token to use to retrieve the next page of results for this + // operation. If there are no more pages, this value is null. NextToken *string // Metadata pertaining to the operation's result. diff --git a/service/devopsguru/api_op_DescribeServiceIntegration.go b/service/devopsguru/api_op_DescribeServiceIntegration.go index fb8bb577485..e65f48cd0f2 100644 --- a/service/devopsguru/api_op_DescribeServiceIntegration.go +++ b/service/devopsguru/api_op_DescribeServiceIntegration.go @@ -11,6 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// Returns the integration status of services that are integrated with DevOps Guru. +// The one service that can be integrated with DevOps Guru is AWS Systems Manager, +// which can be used to create an OpsItem for each generated insight. func (c *Client) DescribeServiceIntegration(ctx context.Context, params *DescribeServiceIntegrationInput, optFns ...func(*Options)) (*DescribeServiceIntegrationOutput, error) { if params == nil { params = &DescribeServiceIntegrationInput{} @@ -30,6 +33,9 @@ type DescribeServiceIntegrationInput struct { } type DescribeServiceIntegrationOutput struct { + + // Information about the integration of DevOps Guru with another AWS service, such + // as AWS Systems Manager. ServiceIntegration *types.ServiceIntegrationConfig // Metadata pertaining to the operation's result. diff --git a/service/devopsguru/api_op_GetResourceCollection.go b/service/devopsguru/api_op_GetResourceCollection.go index 58f67c9d0c9..b00a4680503 100644 --- a/service/devopsguru/api_op_GetResourceCollection.go +++ b/service/devopsguru/api_op_GetResourceCollection.go @@ -12,6 +12,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// Returns lists AWS resources that are of the specified resource collection type. +// The one type of AWS resource collection supported is AWS CloudFormation stacks. +// DevOps Guru can be configured to analyze only the AWS resources that are defined +// in the stacks. func (c *Client) GetResourceCollection(ctx context.Context, params *GetResourceCollectionInput, optFns ...func(*Options)) (*GetResourceCollectionOutput, error) { if params == nil { params = &GetResourceCollectionInput{} @@ -29,15 +33,26 @@ func (c *Client) GetResourceCollection(ctx context.Context, params *GetResourceC type GetResourceCollectionInput struct { + // The type of AWS resource collections to return. The one valid value is + // CLOUD_FORMATION for AWS CloudFormation stacks. + // // This member is required. - ResourceCollectionType *string + ResourceCollectionType types.ResourceCollectionType + // The pagination token to use to retrieve the next page of results for this + // operation. If this value is null, it retrieves the first page. NextToken *string } type GetResourceCollectionOutput struct { + + // The pagination token to use to retrieve the next page of results for this + // operation. If there are no more pages, this value is null. NextToken *string + // The requested list of AWS resource collections. The one type of AWS resource + // collection supported is AWS CloudFormation stacks. DevOps Guru can be configured + // to analyze only the AWS resources that are defined in the stacks. ResourceCollection *types.ResourceCollectionFilter // Metadata pertaining to the operation's result. diff --git a/service/devopsguru/api_op_ListAnomaliesForInsight.go b/service/devopsguru/api_op_ListAnomaliesForInsight.go index 4bf2cac3334..de62eff0ce6 100644 --- a/service/devopsguru/api_op_ListAnomaliesForInsight.go +++ b/service/devopsguru/api_op_ListAnomaliesForInsight.go @@ -12,6 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// Returns a list of the anomalies that belong to an insight that you specify using +// its ID. func (c *Client) ListAnomaliesForInsight(ctx context.Context, params *ListAnomaliesForInsightInput, optFns ...func(*Options)) (*ListAnomaliesForInsightOutput, error) { if params == nil { params = &ListAnomaliesForInsightInput{} @@ -29,21 +31,36 @@ func (c *Client) ListAnomaliesForInsight(ctx context.Context, params *ListAnomal type ListAnomaliesForInsightInput struct { + // The ID of the insight. The returned anomalies belong to this insight. + // // This member is required. InsightId *string - MaxResults int32 + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int32 + // The pagination token to use to retrieve the next page of results for this + // operation. If this value is null, it retrieves the first page. NextToken *string + // A time range used to specify when the requested anomalies started. All returned + // anomalies started during this time range. StartTimeRange *types.StartTimeRange } type ListAnomaliesForInsightOutput struct { + + // The pagination token to use to retrieve the next page of results for this + // operation. If there are no more pages, this value is null. NextToken *string + // An array of ProactiveAnomalySummary objects that represent the requested + // anomalies ProactiveAnomalies []types.ProactiveAnomalySummary + // An array of ReactiveAnomalySummary objects that represent the requested + // anomalies ReactiveAnomalies []types.ReactiveAnomalySummary // Metadata pertaining to the operation's result. @@ -121,6 +138,8 @@ var _ ListAnomaliesForInsightAPIClient = (*Client)(nil) // ListAnomaliesForInsightPaginatorOptions is the paginator options for // ListAnomaliesForInsight type ListAnomaliesForInsightPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. Limit int32 // Set to true if pagination should stop if the service returns a pagination token @@ -141,8 +160,8 @@ type ListAnomaliesForInsightPaginator struct { // ListAnomaliesForInsightPaginator func NewListAnomaliesForInsightPaginator(client ListAnomaliesForInsightAPIClient, params *ListAnomaliesForInsightInput, optFns ...func(*ListAnomaliesForInsightPaginatorOptions)) *ListAnomaliesForInsightPaginator { options := ListAnomaliesForInsightPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -175,7 +194,11 @@ func (p *ListAnomaliesForInsightPaginator) NextPage(ctx context.Context, optFns params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListAnomaliesForInsight(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/devopsguru/api_op_ListEvents.go b/service/devopsguru/api_op_ListEvents.go index f0aea3d9b82..1f2c273c96d 100644 --- a/service/devopsguru/api_op_ListEvents.go +++ b/service/devopsguru/api_op_ListEvents.go @@ -12,6 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// Returns a list of the events emitted by the resources that are evaluated by +// DevOps Guru. You can use filters to specify which events are returned. func (c *Client) ListEvents(ctx context.Context, params *ListEventsInput, optFns ...func(*Options)) (*ListEventsOutput, error) { if params == nil { params = &ListEventsInput{} @@ -29,17 +31,29 @@ func (c *Client) ListEvents(ctx context.Context, params *ListEventsInput, optFns type ListEventsInput struct { + // A ListEventsFilters object used to specify which events to return. + // // This member is required. Filters *types.ListEventsFilters - MaxResults int32 + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int32 + // The pagination token to use to retrieve the next page of results for this + // operation. If this value is null, it retrieves the first page. NextToken *string } type ListEventsOutput struct { + + // A list of the requested events. + // + // This member is required. Events []types.Event + // The pagination token to use to retrieve the next page of results for this + // operation. If there are no more pages, this value is null. NextToken *string // Metadata pertaining to the operation's result. @@ -115,6 +129,8 @@ var _ ListEventsAPIClient = (*Client)(nil) // ListEventsPaginatorOptions is the paginator options for ListEvents type ListEventsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. Limit int32 // Set to true if pagination should stop if the service returns a pagination token @@ -134,8 +150,8 @@ type ListEventsPaginator struct { // NewListEventsPaginator returns a new ListEventsPaginator func NewListEventsPaginator(client ListEventsAPIClient, params *ListEventsInput, optFns ...func(*ListEventsPaginatorOptions)) *ListEventsPaginator { options := ListEventsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -168,7 +184,11 @@ func (p *ListEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Opti params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListEvents(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/devopsguru/api_op_ListInsights.go b/service/devopsguru/api_op_ListInsights.go index ffff30e808c..3f95b785bec 100644 --- a/service/devopsguru/api_op_ListInsights.go +++ b/service/devopsguru/api_op_ListInsights.go @@ -12,6 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// Returns a list of insights in your AWS account. You can specify which insights +// are returned by their start time and status (ONGOING, CLOSED, or ANY). func (c *Client) ListInsights(ctx context.Context, params *ListInsightsInput, optFns ...func(*Options)) (*ListInsightsOutput, error) { if params == nil { params = &ListInsightsInput{} @@ -29,19 +31,31 @@ func (c *Client) ListInsights(ctx context.Context, params *ListInsightsInput, op type ListInsightsInput struct { + // A filter used to filter the returned insights by their status. You can specify + // one status filter. + // // This member is required. StatusFilter *types.ListInsightsStatusFilter - MaxResults int32 + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int32 + // The pagination token to use to retrieve the next page of results for this + // operation. If this value is null, it retrieves the first page. NextToken *string } type ListInsightsOutput struct { + + // The pagination token to use to retrieve the next page of results for this + // operation. If there are no more pages, this value is null. NextToken *string + // The returned list of proactive insights. ProactiveInsights []types.ProactiveInsightSummary + // The returned list of reactive insights. ReactiveInsights []types.ReactiveInsightSummary // Metadata pertaining to the operation's result. @@ -117,6 +131,8 @@ var _ ListInsightsAPIClient = (*Client)(nil) // ListInsightsPaginatorOptions is the paginator options for ListInsights type ListInsightsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. Limit int32 // Set to true if pagination should stop if the service returns a pagination token @@ -136,8 +152,8 @@ type ListInsightsPaginator struct { // NewListInsightsPaginator returns a new ListInsightsPaginator func NewListInsightsPaginator(client ListInsightsAPIClient, params *ListInsightsInput, optFns ...func(*ListInsightsPaginatorOptions)) *ListInsightsPaginator { options := ListInsightsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -170,7 +186,11 @@ func (p *ListInsightsPaginator) NextPage(ctx context.Context, optFns ...func(*Op params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.ListInsights(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/devopsguru/api_op_ListNotificationChannels.go b/service/devopsguru/api_op_ListNotificationChannels.go index 11be10fe990..26271a29df2 100644 --- a/service/devopsguru/api_op_ListNotificationChannels.go +++ b/service/devopsguru/api_op_ListNotificationChannels.go @@ -12,6 +12,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// Returns a list of notification channels configured for DevOps Guru. Each +// notification channel is used to notify you when DevOps Guru generates an insight +// that contains information about how to improve your operations. The one +// supported notification channel is Amazon Simple Notification Service (Amazon +// SNS). func (c *Client) ListNotificationChannels(ctx context.Context, params *ListNotificationChannelsInput, optFns ...func(*Options)) (*ListNotificationChannelsOutput, error) { if params == nil { params = &ListNotificationChannelsInput{} @@ -28,12 +33,19 @@ func (c *Client) ListNotificationChannels(ctx context.Context, params *ListNotif } type ListNotificationChannelsInput struct { + + // The pagination token to use to retrieve the next page of results for this + // operation. If this value is null, it retrieves the first page. NextToken *string } type ListNotificationChannelsOutput struct { + + // An array that contains the requested notification channels. Channels []types.NotificationChannel + // The pagination token to use to retrieve the next page of results for this + // operation. If there are no more pages, this value is null. NextToken *string // Metadata pertaining to the operation's result. diff --git a/service/devopsguru/api_op_ListRecommendations.go b/service/devopsguru/api_op_ListRecommendations.go index e28b25b4599..bfeffa75318 100644 --- a/service/devopsguru/api_op_ListRecommendations.go +++ b/service/devopsguru/api_op_ListRecommendations.go @@ -12,6 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// Returns a list of a specified insight's recommendations. Each recommendation +// includes a list of related metrics and a list of related events. func (c *Client) ListRecommendations(ctx context.Context, params *ListRecommendationsInput, optFns ...func(*Options)) (*ListRecommendationsOutput, error) { if params == nil { params = &ListRecommendationsInput{} @@ -29,15 +31,23 @@ func (c *Client) ListRecommendations(ctx context.Context, params *ListRecommenda type ListRecommendationsInput struct { + // The ID of the requested insight. + // // This member is required. InsightId *string + // The pagination token to use to retrieve the next page of results for this + // operation. If this value is null, it retrieves the first page. NextToken *string } type ListRecommendationsOutput struct { + + // The pagination token to use to retrieve the next page of results for this + // operation. If there are no more pages, this value is null. NextToken *string + // An array of the requested recommendations. Recommendations []types.Recommendation // Metadata pertaining to the operation's result. diff --git a/service/devopsguru/api_op_PutFeedback.go b/service/devopsguru/api_op_PutFeedback.go index 3c306bbeb59..8b124c9a26c 100644 --- a/service/devopsguru/api_op_PutFeedback.go +++ b/service/devopsguru/api_op_PutFeedback.go @@ -11,6 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// Collects customer feedback about the specified insight. func (c *Client) PutFeedback(ctx context.Context, params *PutFeedbackInput, optFns ...func(*Options)) (*PutFeedbackOutput, error) { if params == nil { params = &PutFeedbackInput{} @@ -27,6 +28,8 @@ func (c *Client) PutFeedback(ctx context.Context, params *PutFeedbackInput, optF } type PutFeedbackInput struct { + + // The feedback from customers is about the recommendations in this insight. InsightFeedback *types.InsightFeedback } diff --git a/service/devopsguru/api_op_RemoveNotificationChannel.go b/service/devopsguru/api_op_RemoveNotificationChannel.go index 0d6bdfce021..f4fbdd70213 100644 --- a/service/devopsguru/api_op_RemoveNotificationChannel.go +++ b/service/devopsguru/api_op_RemoveNotificationChannel.go @@ -10,6 +10,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// Removes a notification channel from DevOps Guru. A notification channel is used +// to notify you when DevOps Guru generates an insight that contains information +// about how to improve your operations. func (c *Client) RemoveNotificationChannel(ctx context.Context, params *RemoveNotificationChannelInput, optFns ...func(*Options)) (*RemoveNotificationChannelOutput, error) { if params == nil { params = &RemoveNotificationChannelInput{} @@ -27,6 +30,8 @@ func (c *Client) RemoveNotificationChannel(ctx context.Context, params *RemoveNo type RemoveNotificationChannelInput struct { + // The ID of the notification channel to be removed. + // // This member is required. Id *string } diff --git a/service/devopsguru/api_op_SearchInsights.go b/service/devopsguru/api_op_SearchInsights.go index 52a31cb970f..418c87c8fe4 100644 --- a/service/devopsguru/api_op_SearchInsights.go +++ b/service/devopsguru/api_op_SearchInsights.go @@ -12,6 +12,12 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// Returns a list of insights in your AWS account. You can specify which insights +// are returned by their start time, one or more statuses (ONGOING, CLOSED, and +// CLOSED), one or more severities (LOW, MEDIUM, and HIGH), and type (REACTIVE or +// PROACTIVE). Use the Filters parameter to specify status and severity search +// parameters. Use the Type parameter to specify REACTIVE or PROACTIVE in your +// search. func (c *Client) SearchInsights(ctx context.Context, params *SearchInsightsInput, optFns ...func(*Options)) (*SearchInsightsOutput, error) { if params == nil { params = &SearchInsightsInput{} @@ -29,24 +35,40 @@ func (c *Client) SearchInsights(ctx context.Context, params *SearchInsightsInput type SearchInsightsInput struct { + // The start of the time range passed in. Returned insights occurred after this + // time. + // // This member is required. StartTimeRange *types.StartTimeRange + // The type of insights you are searching for (REACTIVE or PROACTIVE). + // // This member is required. Type types.InsightType + // A SearchInsightsFilters object that is used to set the severity and status + // filters on your insight search. Filters *types.SearchInsightsFilters - MaxResults int32 + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. + MaxResults *int32 + // The pagination token to use to retrieve the next page of results for this + // operation. If this value is null, it retrieves the first page. NextToken *string } type SearchInsightsOutput struct { + + // The pagination token to use to retrieve the next page of results for this + // operation. If there are no more pages, this value is null. NextToken *string + // The returned proactive insights. ProactiveInsights []types.ProactiveInsightSummary + // The returned reactive insights. ReactiveInsights []types.ReactiveInsightSummary // Metadata pertaining to the operation's result. @@ -123,6 +145,8 @@ var _ SearchInsightsAPIClient = (*Client)(nil) // SearchInsightsPaginatorOptions is the paginator options for SearchInsights type SearchInsightsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call with the returned nextToken value. Limit int32 // Set to true if pagination should stop if the service returns a pagination token @@ -142,8 +166,8 @@ type SearchInsightsPaginator struct { // NewSearchInsightsPaginator returns a new SearchInsightsPaginator func NewSearchInsightsPaginator(client SearchInsightsAPIClient, params *SearchInsightsInput, optFns ...func(*SearchInsightsPaginatorOptions)) *SearchInsightsPaginator { options := SearchInsightsPaginatorOptions{} - if params.MaxResults != 0 { - options.Limit = params.MaxResults + if params.MaxResults != nil { + options.Limit = *params.MaxResults } for _, fn := range optFns { @@ -176,7 +200,11 @@ func (p *SearchInsightsPaginator) NextPage(ctx context.Context, optFns ...func(* params := *p.params params.NextToken = p.nextToken - params.MaxResults = p.options.Limit + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit result, err := p.client.SearchInsights(ctx, ¶ms, optFns...) if err != nil { diff --git a/service/devopsguru/api_op_UpdateResourceCollection.go b/service/devopsguru/api_op_UpdateResourceCollection.go index 7ccb7199214..a634596ff27 100644 --- a/service/devopsguru/api_op_UpdateResourceCollection.go +++ b/service/devopsguru/api_op_UpdateResourceCollection.go @@ -11,6 +11,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// Updates the collection of resources that DevOps Guru analyzes. The one type of +// AWS resource collection supported is AWS CloudFormation stacks. DevOps Guru can +// be configured to analyze only the AWS resources that are defined in the stacks. +// This method also creates the IAM role required for you to use DevOps Guru. func (c *Client) UpdateResourceCollection(ctx context.Context, params *UpdateResourceCollectionInput, optFns ...func(*Options)) (*UpdateResourceCollectionOutput, error) { if params == nil { params = &UpdateResourceCollectionInput{} @@ -28,9 +32,14 @@ func (c *Client) UpdateResourceCollection(ctx context.Context, params *UpdateRes type UpdateResourceCollectionInput struct { + // Specifies if the resource collection in the request is added or deleted to the + // resource collection. + // // This member is required. Action types.UpdateResourceCollectionAction + // Contains information used to update a collection of AWS resources. + // // This member is required. ResourceCollection *types.UpdateResourceCollectionFilter } diff --git a/service/devopsguru/api_op_UpdateServiceIntegration.go b/service/devopsguru/api_op_UpdateServiceIntegration.go index 7a040f645c1..7af2b5ce196 100644 --- a/service/devopsguru/api_op_UpdateServiceIntegration.go +++ b/service/devopsguru/api_op_UpdateServiceIntegration.go @@ -11,6 +11,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// Enables or disables integration with a service that can be integrated with +// DevOps Guru. The one service that can be integrated with DevOps Guru is AWS +// Systems Manager, which can be used to create an OpsItem for each generated +// insight. func (c *Client) UpdateServiceIntegration(ctx context.Context, params *UpdateServiceIntegrationInput, optFns ...func(*Options)) (*UpdateServiceIntegrationOutput, error) { if params == nil { params = &UpdateServiceIntegrationInput{} @@ -28,6 +32,9 @@ func (c *Client) UpdateServiceIntegration(ctx context.Context, params *UpdateSer type UpdateServiceIntegrationInput struct { + // An IntegratedServiceConfig object used to specify the integrated service you + // want to update, and whether you want to update it to enabled or disabled. + // // This member is required. ServiceIntegration *types.UpdateServiceIntegrationConfig } diff --git a/service/devopsguru/deserializers.go b/service/devopsguru/deserializers.go index 2b6d6bcf554..1ef0441eda5 100644 --- a/service/devopsguru/deserializers.go +++ b/service/devopsguru/deserializers.go @@ -16,6 +16,7 @@ import ( smithytime "github.com/aws/smithy-go/time" smithyhttp "github.com/aws/smithy-go/transport/http" "io" + "strconv" "strings" ) @@ -174,7 +175,7 @@ func awsRestjson1_deserializeOpDocumentAddNotificationChannelOutput(v **AddNotif if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin36Max36PatternAF098AF094AF094AF094AF0912 to be of type string, got %T instead", value) + return fmt.Errorf("expected NotificationChannelId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } @@ -334,7 +335,7 @@ func awsRestjson1_deserializeOpDocumentDescribeAccountHealthOutput(v **DescribeA if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) + return fmt.Errorf("expected NumMetricsAnalyzed to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { @@ -347,7 +348,7 @@ func awsRestjson1_deserializeOpDocumentDescribeAccountHealthOutput(v **DescribeA if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) + return fmt.Errorf("expected NumOpenProactiveInsights to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { @@ -360,7 +361,7 @@ func awsRestjson1_deserializeOpDocumentDescribeAccountHealthOutput(v **DescribeA if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) + return fmt.Errorf("expected NumOpenReactiveInsights to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { @@ -524,20 +525,20 @@ func awsRestjson1_deserializeOpDocumentDescribeAccountOverviewOutput(v **Describ if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __long to be json.Number, got %T instead", value) + return fmt.Errorf("expected MeanTimeToRecoverInMilliseconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.MeanTimeToRecoverInMilliseconds = i64 + sv.MeanTimeToRecoverInMilliseconds = ptr.Int64(i64) } case "ProactiveInsights": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) + return fmt.Errorf("expected NumProactiveInsights to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { @@ -550,7 +551,7 @@ func awsRestjson1_deserializeOpDocumentDescribeAccountOverviewOutput(v **Describ if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) + return fmt.Errorf("expected NumReactiveInsights to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { @@ -1039,7 +1040,7 @@ func awsRestjson1_deserializeOpDocumentDescribeResourceCollectionHealthOutput(v for key, value := range shape { switch key { case "CloudFormation": - if err := awsRestjson1_deserializeDocument__listOfCloudFormationHealth(&sv.CloudFormation, value); err != nil { + if err := awsRestjson1_deserializeDocumentCloudFormationHealths(&sv.CloudFormation, value); err != nil { return err } @@ -1047,7 +1048,7 @@ func awsRestjson1_deserializeOpDocumentDescribeResourceCollectionHealthOutput(v if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin36Max36PatternAF098AF094AF094AF094AF0912 to be of type string, got %T instead", value) + return fmt.Errorf("expected UuidNextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } @@ -1366,7 +1367,7 @@ func awsRestjson1_deserializeOpDocumentGetResourceCollectionOutput(v **GetResour if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin36Max36PatternAF098AF094AF094AF094AF0912 to be of type string, got %T instead", value) + return fmt.Errorf("expected UuidNextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } @@ -1534,18 +1535,18 @@ func awsRestjson1_deserializeOpDocumentListAnomaliesForInsightOutput(v **ListAno if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin36Max36PatternAF098AF094AF094AF094AF0912 to be of type string, got %T instead", value) + return fmt.Errorf("expected UuidNextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "ProactiveAnomalies": - if err := awsRestjson1_deserializeDocument__listOfProactiveAnomalySummary(&sv.ProactiveAnomalies, value); err != nil { + if err := awsRestjson1_deserializeDocumentProactiveAnomalies(&sv.ProactiveAnomalies, value); err != nil { return err } case "ReactiveAnomalies": - if err := awsRestjson1_deserializeDocument__listOfReactiveAnomalySummary(&sv.ReactiveAnomalies, value); err != nil { + if err := awsRestjson1_deserializeDocumentReactiveAnomalies(&sv.ReactiveAnomalies, value); err != nil { return err } @@ -1704,7 +1705,7 @@ func awsRestjson1_deserializeOpDocumentListEventsOutput(v **ListEventsOutput, va for key, value := range shape { switch key { case "Events": - if err := awsRestjson1_deserializeDocument__listOfEvent(&sv.Events, value); err != nil { + if err := awsRestjson1_deserializeDocumentEvents(&sv.Events, value); err != nil { return err } @@ -1712,7 +1713,7 @@ func awsRestjson1_deserializeOpDocumentListEventsOutput(v **ListEventsOutput, va if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin36Max36PatternAF098AF094AF094AF094AF0912 to be of type string, got %T instead", value) + return fmt.Errorf("expected UuidNextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } @@ -1872,18 +1873,18 @@ func awsRestjson1_deserializeOpDocumentListInsightsOutput(v **ListInsightsOutput if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin36Max36PatternAF098AF094AF094AF094AF0912 to be of type string, got %T instead", value) + return fmt.Errorf("expected UuidNextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "ProactiveInsights": - if err := awsRestjson1_deserializeDocument__listOfProactiveInsightSummary(&sv.ProactiveInsights, value); err != nil { + if err := awsRestjson1_deserializeDocumentProactiveInsights(&sv.ProactiveInsights, value); err != nil { return err } case "ReactiveInsights": - if err := awsRestjson1_deserializeDocument__listOfReactiveInsightSummary(&sv.ReactiveInsights, value); err != nil { + if err := awsRestjson1_deserializeDocumentReactiveInsights(&sv.ReactiveInsights, value); err != nil { return err } @@ -2039,7 +2040,7 @@ func awsRestjson1_deserializeOpDocumentListNotificationChannelsOutput(v **ListNo for key, value := range shape { switch key { case "Channels": - if err := awsRestjson1_deserializeDocument__listOfNotificationChannel(&sv.Channels, value); err != nil { + if err := awsRestjson1_deserializeDocumentChannels(&sv.Channels, value); err != nil { return err } @@ -2047,7 +2048,7 @@ func awsRestjson1_deserializeOpDocumentListNotificationChannelsOutput(v **ListNo if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin36Max36PatternAF098AF094AF094AF094AF0912 to be of type string, got %T instead", value) + return fmt.Errorf("expected UuidNextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } @@ -2210,13 +2211,13 @@ func awsRestjson1_deserializeOpDocumentListRecommendationsOutput(v **ListRecomme if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin36Max36PatternAF098AF094AF094AF094AF0912 to be of type string, got %T instead", value) + return fmt.Errorf("expected UuidNextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "Recommendations": - if err := awsRestjson1_deserializeDocument__listOfRecommendation(&sv.Recommendations, value); err != nil { + if err := awsRestjson1_deserializeDocumentRecommendations(&sv.Recommendations, value); err != nil { return err } @@ -2571,18 +2572,18 @@ func awsRestjson1_deserializeOpDocumentSearchInsightsOutput(v **SearchInsightsOu if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin36Max36PatternAF098AF094AF094AF094AF0912 to be of type string, got %T instead", value) + return fmt.Errorf("expected UuidNextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } case "ProactiveInsights": - if err := awsRestjson1_deserializeDocument__listOfProactiveInsightSummary(&sv.ProactiveInsights, value); err != nil { + if err := awsRestjson1_deserializeDocumentProactiveInsights(&sv.ProactiveInsights, value); err != nil { return err } case "ReactiveInsights": - if err := awsRestjson1_deserializeDocument__listOfReactiveInsightSummary(&sv.ReactiveInsights, value); err != nil { + if err := awsRestjson1_deserializeDocumentReactiveInsights(&sv.ReactiveInsights, value); err != nil { return err } @@ -2785,6 +2786,38 @@ func awsRestjson1_deserializeOpErrorUpdateServiceIntegration(response *smithyhtt } } +func awsRestjson1_deserializeOpHttpBindingsInternalServerException(v *types.InternalServerException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = int32(vv) + } + + return nil +} +func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = int32(vv) + } + + return nil +} func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.AccessDeniedException{} var buff [1024]byte @@ -2890,6 +2923,10 @@ func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.R errorBody.Seek(0, io.SeekStart) + if err := awsRestjson1_deserializeOpHttpBindingsInternalServerException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + return output } @@ -2998,6 +3035,10 @@ func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Respo errorBody.Seek(0, io.SeekStart) + if err := awsRestjson1_deserializeOpHttpBindingsThrottlingException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + return output } @@ -3015,674 +3056,26 @@ func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Respo 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_deserializeDocument__listOf__stringMin1Max128PatternAZAZAZAZ09(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 __stringMin1Max128PatternAZAZAZAZ09 to be of type string, got %T instead", value) - } - col = jtv - } - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__listOfCloudFormationHealth(v *[]types.CloudFormationHealth, 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.CloudFormationHealth - if *v == nil { - cv = []types.CloudFormationHealth{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.CloudFormationHealth - destAddr := &col - if err := awsRestjson1_deserializeDocumentCloudFormationHealth(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__listOfCloudWatchMetricsDetail(v *[]types.CloudWatchMetricsDetail, 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.CloudWatchMetricsDetail - if *v == nil { - cv = []types.CloudWatchMetricsDetail{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.CloudWatchMetricsDetail - destAddr := &col - if err := awsRestjson1_deserializeDocumentCloudWatchMetricsDetail(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__listOfCloudWatchMetricsDimension(v *[]types.CloudWatchMetricsDimension, 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.CloudWatchMetricsDimension - if *v == nil { - cv = []types.CloudWatchMetricsDimension{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.CloudWatchMetricsDimension - destAddr := &col - if err := awsRestjson1_deserializeDocumentCloudWatchMetricsDimension(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__listOfEvent(v *[]types.Event, 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.Event - if *v == nil { - cv = []types.Event{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.Event - destAddr := &col - if err := awsRestjson1_deserializeDocumentEvent(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__listOfEventResource(v *[]types.EventResource, 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.EventResource - if *v == nil { - cv = []types.EventResource{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.EventResource - destAddr := &col - if err := awsRestjson1_deserializeDocumentEventResource(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__listOfNotificationChannel(v *[]types.NotificationChannel, 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.NotificationChannel - if *v == nil { - cv = []types.NotificationChannel{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.NotificationChannel - destAddr := &col - if err := awsRestjson1_deserializeDocumentNotificationChannel(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__listOfProactiveAnomalySummary(v *[]types.ProactiveAnomalySummary, 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.ProactiveAnomalySummary - if *v == nil { - cv = []types.ProactiveAnomalySummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ProactiveAnomalySummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentProactiveAnomalySummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__listOfProactiveInsightSummary(v *[]types.ProactiveInsightSummary, 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.ProactiveInsightSummary - if *v == nil { - cv = []types.ProactiveInsightSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ProactiveInsightSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentProactiveInsightSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__listOfReactiveAnomalySummary(v *[]types.ReactiveAnomalySummary, 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.ReactiveAnomalySummary - if *v == nil { - cv = []types.ReactiveAnomalySummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ReactiveAnomalySummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentReactiveAnomalySummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__listOfReactiveInsightSummary(v *[]types.ReactiveInsightSummary, 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.ReactiveInsightSummary - if *v == nil { - cv = []types.ReactiveInsightSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ReactiveInsightSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentReactiveInsightSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__listOfRecommendation(v *[]types.Recommendation, 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.Recommendation - if *v == nil { - cv = []types.Recommendation{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.Recommendation - destAddr := &col - if err := awsRestjson1_deserializeDocumentRecommendation(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__listOfRecommendationRelatedAnomaly(v *[]types.RecommendationRelatedAnomaly, 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.RecommendationRelatedAnomaly - if *v == nil { - cv = []types.RecommendationRelatedAnomaly{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.RecommendationRelatedAnomaly - destAddr := &col - if err := awsRestjson1_deserializeDocumentRecommendationRelatedAnomaly(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__listOfRecommendationRelatedAnomalyResource(v *[]types.RecommendationRelatedAnomalyResource, 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.RecommendationRelatedAnomalyResource - if *v == nil { - cv = []types.RecommendationRelatedAnomalyResource{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.RecommendationRelatedAnomalyResource - destAddr := &col - if err := awsRestjson1_deserializeDocumentRecommendationRelatedAnomalyResource(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__listOfRecommendationRelatedAnomalySourceDetail(v *[]types.RecommendationRelatedAnomalySourceDetail, 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.RecommendationRelatedAnomalySourceDetail - if *v == nil { - cv = []types.RecommendationRelatedAnomalySourceDetail{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.RecommendationRelatedAnomalySourceDetail - destAddr := &col - if err := awsRestjson1_deserializeDocumentRecommendationRelatedAnomalySourceDetail(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__listOfRecommendationRelatedCloudWatchMetricsSourceDetail(v *[]types.RecommendationRelatedCloudWatchMetricsSourceDetail, 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.RecommendationRelatedCloudWatchMetricsSourceDetail - if *v == nil { - cv = []types.RecommendationRelatedCloudWatchMetricsSourceDetail{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.RecommendationRelatedCloudWatchMetricsSourceDetail - destAddr := &col - if err := awsRestjson1_deserializeDocumentRecommendationRelatedCloudWatchMetricsSourceDetail(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__listOfRecommendationRelatedEvent(v *[]types.RecommendationRelatedEvent, 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.RecommendationRelatedEvent - if *v == nil { - cv = []types.RecommendationRelatedEvent{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.RecommendationRelatedEvent - destAddr := &col - if err := awsRestjson1_deserializeDocumentRecommendationRelatedEvent(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__listOfRecommendationRelatedEventResource(v *[]types.RecommendationRelatedEventResource, 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.RecommendationRelatedEventResource - if *v == nil { - cv = []types.RecommendationRelatedEventResource{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.RecommendationRelatedEventResource - destAddr := &col - if err := awsRestjson1_deserializeDocumentRecommendationRelatedEventResource(&destAddr, value); err != nil { - return err + Snapshot: snapshot.Bytes(), } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocument__listOfValidationExceptionField(v *[]types.ValidationExceptionField, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil + return err } - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + err := awsRestjson1_deserializeDocumentValidationException(&output, shape) - var cv []types.ValidationExceptionField - if *v == nil { - cv = []types.ValidationExceptionField{} - } else { - cv = *v + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err } - for _, value := range shape { - var col types.ValidationExceptionField - destAddr := &col - if err := awsRestjson1_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + errorBody.Seek(0, io.SeekStart) - } - *v = cv - return nil + return output } func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { @@ -3711,7 +3104,7 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessageString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } @@ -3748,7 +3141,7 @@ func awsRestjson1_deserializeDocumentAnomalySourceDetails(v **types.AnomalySourc for key, value := range shape { switch key { case "CloudWatchMetrics": - if err := awsRestjson1_deserializeDocument__listOfCloudWatchMetricsDetail(&sv.CloudWatchMetrics, value); err != nil { + if err := awsRestjson1_deserializeDocumentCloudWatchMetricsDetails(&sv.CloudWatchMetrics, value); err != nil { return err } @@ -3787,7 +3180,7 @@ func awsRestjson1_deserializeDocumentAnomalyTimeRange(v **types.AnomalyTimeRange if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __timestampUnix to be json.Number, got %T instead", value) + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) } f64, err := jtv.Float64() if err != nil { @@ -3800,7 +3193,7 @@ func awsRestjson1_deserializeDocumentAnomalyTimeRange(v **types.AnomalyTimeRange if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __timestampUnix to be json.Number, got %T instead", value) + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) } f64, err := jtv.Float64() if err != nil { @@ -3818,6 +3211,40 @@ func awsRestjson1_deserializeDocumentAnomalyTimeRange(v **types.AnomalyTimeRange return nil } +func awsRestjson1_deserializeDocumentChannels(v *[]types.NotificationChannel, 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.NotificationChannel + if *v == nil { + cv = []types.NotificationChannel{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.NotificationChannel + destAddr := &col + if err := awsRestjson1_deserializeDocumentNotificationChannel(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentCloudFormationCollection(v **types.CloudFormationCollection, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3841,7 +3268,7 @@ func awsRestjson1_deserializeDocumentCloudFormationCollection(v **types.CloudFor for key, value := range shape { switch key { case "StackNames": - if err := awsRestjson1_deserializeDocument__listOf__stringMin1Max128PatternAZAZAZAZ09(&sv.StackNames, value); err != nil { + if err := awsRestjson1_deserializeDocumentStackNames(&sv.StackNames, value); err != nil { return err } @@ -3877,7 +3304,7 @@ func awsRestjson1_deserializeDocumentCloudFormationCollectionFilter(v **types.Cl for key, value := range shape { switch key { case "StackNames": - if err := awsRestjson1_deserializeDocument__listOf__stringMin1Max128PatternAZAZAZAZ09(&sv.StackNames, value); err != nil { + if err := awsRestjson1_deserializeDocumentStackNames(&sv.StackNames, value); err != nil { return err } @@ -3921,7 +3348,7 @@ func awsRestjson1_deserializeDocumentCloudFormationHealth(v **types.CloudFormati if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin1Max128PatternAZAZAZAZ09 to be of type string, got %T instead", value) + return fmt.Errorf("expected StackName to be of type string, got %T instead", value) } sv.StackName = ptr.String(jtv) } @@ -3935,6 +3362,40 @@ func awsRestjson1_deserializeDocumentCloudFormationHealth(v **types.CloudFormati return nil } +func awsRestjson1_deserializeDocumentCloudFormationHealths(v *[]types.CloudFormationHealth, 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.CloudFormationHealth + if *v == nil { + cv = []types.CloudFormationHealth{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CloudFormationHealth + destAddr := &col + if err := awsRestjson1_deserializeDocumentCloudFormationHealth(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentCloudWatchMetricsDetail(v **types.CloudWatchMetricsDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3958,7 +3419,7 @@ func awsRestjson1_deserializeDocumentCloudWatchMetricsDetail(v **types.CloudWatc for key, value := range shape { switch key { case "Dimensions": - if err := awsRestjson1_deserializeDocument__listOfCloudWatchMetricsDimension(&sv.Dimensions, value); err != nil { + if err := awsRestjson1_deserializeDocumentCloudWatchMetricsDimensions(&sv.Dimensions, value); err != nil { return err } @@ -3966,7 +3427,7 @@ func awsRestjson1_deserializeDocumentCloudWatchMetricsDetail(v **types.CloudWatc if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected CloudWatchMetricsMetricName to be of type string, got %T instead", value) } sv.MetricName = ptr.String(jtv) } @@ -3975,7 +3436,7 @@ func awsRestjson1_deserializeDocumentCloudWatchMetricsDetail(v **types.CloudWatc if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected CloudWatchMetricsNamespace to be of type string, got %T instead", value) } sv.Namespace = ptr.String(jtv) } @@ -3984,7 +3445,7 @@ func awsRestjson1_deserializeDocumentCloudWatchMetricsDetail(v **types.CloudWatc if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) + return fmt.Errorf("expected CloudWatchMetricsPeriod to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { @@ -4006,7 +3467,7 @@ func awsRestjson1_deserializeDocumentCloudWatchMetricsDetail(v **types.CloudWatc if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected CloudWatchMetricsUnit to be of type string, got %T instead", value) } sv.Unit = ptr.String(jtv) } @@ -4020,6 +3481,40 @@ func awsRestjson1_deserializeDocumentCloudWatchMetricsDetail(v **types.CloudWatc return nil } +func awsRestjson1_deserializeDocumentCloudWatchMetricsDetails(v *[]types.CloudWatchMetricsDetail, 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.CloudWatchMetricsDetail + if *v == nil { + cv = []types.CloudWatchMetricsDetail{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CloudWatchMetricsDetail + destAddr := &col + if err := awsRestjson1_deserializeDocumentCloudWatchMetricsDetail(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentCloudWatchMetricsDimension(v **types.CloudWatchMetricsDimension, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4046,7 +3541,7 @@ func awsRestjson1_deserializeDocumentCloudWatchMetricsDimension(v **types.CloudW if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected CloudWatchMetricsDimensionName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } @@ -4055,7 +3550,7 @@ func awsRestjson1_deserializeDocumentCloudWatchMetricsDimension(v **types.CloudW if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected CloudWatchMetricsDimensionValue to be of type string, got %T instead", value) } sv.Value = ptr.String(jtv) } @@ -4069,6 +3564,40 @@ func awsRestjson1_deserializeDocumentCloudWatchMetricsDimension(v **types.CloudW return nil } +func awsRestjson1_deserializeDocumentCloudWatchMetricsDimensions(v *[]types.CloudWatchMetricsDimension, 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.CloudWatchMetricsDimension + if *v == nil { + cv = []types.CloudWatchMetricsDimension{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CloudWatchMetricsDimension + destAddr := &col + if err := awsRestjson1_deserializeDocumentCloudWatchMetricsDimension(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4095,7 +3624,7 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessageString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } @@ -4104,7 +3633,7 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } @@ -4113,7 +3642,7 @@ func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictExcepti if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected ResourceIdType to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } @@ -4171,7 +3700,7 @@ func awsRestjson1_deserializeDocumentEvent(v **types.Event, value interface{}) e if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin10Max50PatternAZAZ09AmazonawsComAwsEvents to be of type string, got %T instead", value) + return fmt.Errorf("expected EventSource to be of type string, got %T instead", value) } sv.EventSource = ptr.String(jtv) } @@ -4180,7 +3709,7 @@ func awsRestjson1_deserializeDocumentEvent(v **types.Event, value interface{}) e if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected EventId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } @@ -4189,7 +3718,7 @@ func awsRestjson1_deserializeDocumentEvent(v **types.Event, value interface{}) e if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin0Max50 to be of type string, got %T instead", value) + return fmt.Errorf("expected EventName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } @@ -4200,7 +3729,7 @@ func awsRestjson1_deserializeDocumentEvent(v **types.Event, value interface{}) e } case "Resources": - if err := awsRestjson1_deserializeDocument__listOfEventResource(&sv.Resources, value); err != nil { + if err := awsRestjson1_deserializeDocumentEventResources(&sv.Resources, value); err != nil { return err } @@ -4208,7 +3737,7 @@ func awsRestjson1_deserializeDocumentEvent(v **types.Event, value interface{}) e if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __timestampUnix to be json.Number, got %T instead", value) + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) } f64, err := jtv.Float64() if err != nil { @@ -4222,11 +3751,103 @@ func awsRestjson1_deserializeDocumentEvent(v **types.Event, value interface{}) e } } - *v = sv + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEventResource(v **types.EventResource, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EventResource + if *v == nil { + sv = &types.EventResource{} + } 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 EventResourceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventResourceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventResourceType to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEventResources(v *[]types.EventResource, 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.EventResource + if *v == nil { + cv = []types.EventResource{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EventResource + destAddr := &col + if err := awsRestjson1_deserializeDocumentEventResource(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv return nil } -func awsRestjson1_deserializeDocumentEventResource(v **types.EventResource, value interface{}) error { +func awsRestjson1_deserializeDocumentEvents(v *[]types.Event, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4234,53 +3855,29 @@ func awsRestjson1_deserializeDocumentEventResource(v **types.EventResource, valu return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.EventResource + var cv []types.Event if *v == nil { - sv = &types.EventResource{} + cv = []types.Event{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "Arn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __stringMin36Max2048PatternArnAwsAZAZ09AZ09D12 to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __stringMin0Max2048Pattern to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "Type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected __stringMin0Max2048Pattern to be of type string, got %T instead", value) - } - sv.Type = ptr.String(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.Event + destAddr := &col + if err := awsRestjson1_deserializeDocumentEvent(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } @@ -4310,20 +3907,20 @@ func awsRestjson1_deserializeDocumentInsightHealth(v **types.InsightHealth, valu if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __long to be json.Number, got %T instead", value) + return fmt.Errorf("expected MeanTimeToRecoverInMilliseconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.MeanTimeToRecoverInMilliseconds = i64 + sv.MeanTimeToRecoverInMilliseconds = ptr.Int64(i64) } case "OpenProactiveInsights": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) + return fmt.Errorf("expected NumOpenProactiveInsights to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { @@ -4336,7 +3933,7 @@ func awsRestjson1_deserializeDocumentInsightHealth(v **types.InsightHealth, valu if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __integer to be json.Number, got %T instead", value) + return fmt.Errorf("expected NumOpenReactiveInsights to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { @@ -4380,7 +3977,7 @@ func awsRestjson1_deserializeDocumentInsightTimeRange(v **types.InsightTimeRange if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __timestampUnix to be json.Number, got %T instead", value) + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) } f64, err := jtv.Float64() if err != nil { @@ -4393,7 +3990,7 @@ func awsRestjson1_deserializeDocumentInsightTimeRange(v **types.InsightTimeRange if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __timestampUnix to be json.Number, got %T instead", value) + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) } f64, err := jtv.Float64() if err != nil { @@ -4437,11 +4034,24 @@ func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalS if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessageString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } + case "RetryAfterSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RetryAfterSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RetryAfterSeconds = int32(i64) + } + default: _, _ = key, value @@ -4482,7 +4092,7 @@ func awsRestjson1_deserializeDocumentNotificationChannel(v **types.NotificationC if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin36Max36PatternAF098AF094AF094AF094AF0912 to be of type string, got %T instead", value) + return fmt.Errorf("expected NotificationChannelId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } @@ -4598,7 +4208,7 @@ func awsRestjson1_deserializeDocumentPredictionTimeRange(v **types.PredictionTim if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __timestampUnix to be json.Number, got %T instead", value) + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) } f64, err := jtv.Float64() if err != nil { @@ -4611,7 +4221,7 @@ func awsRestjson1_deserializeDocumentPredictionTimeRange(v **types.PredictionTim if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __timestampUnix to be json.Number, got %T instead", value) + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) } f64, err := jtv.Float64() if err != nil { @@ -4629,6 +4239,40 @@ func awsRestjson1_deserializeDocumentPredictionTimeRange(v **types.PredictionTim return nil } +func awsRestjson1_deserializeDocumentProactiveAnomalies(v *[]types.ProactiveAnomalySummary, 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.ProactiveAnomalySummary + if *v == nil { + cv = []types.ProactiveAnomalySummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ProactiveAnomalySummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentProactiveAnomalySummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentProactiveAnomaly(v **types.ProactiveAnomaly, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4660,7 +4304,7 @@ func awsRestjson1_deserializeDocumentProactiveAnomaly(v **types.ProactiveAnomaly if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin1Max100PatternW to be of type string, got %T instead", value) + return fmt.Errorf("expected InsightId to be of type string, got %T instead", value) } sv.AssociatedInsightId = ptr.String(jtv) } @@ -4669,7 +4313,7 @@ func awsRestjson1_deserializeDocumentProactiveAnomaly(v **types.ProactiveAnomaly if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin1Max100PatternW to be of type string, got %T instead", value) + return fmt.Errorf("expected AnomalyId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } @@ -4678,13 +4322,13 @@ func awsRestjson1_deserializeDocumentProactiveAnomaly(v **types.ProactiveAnomaly if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __double to be json.Number, got %T instead", value) + return fmt.Errorf("expected AnomalyLimit to be json.Number, got %T instead", value) } f64, err := jtv.Float64() if err != nil { return err } - sv.Limit = f64 + sv.Limit = ptr.Float64(f64) } case "PredictionTimeRange": @@ -4724,7 +4368,7 @@ func awsRestjson1_deserializeDocumentProactiveAnomaly(v **types.ProactiveAnomaly if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __timestampUnix to be json.Number, got %T instead", value) + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) } f64, err := jtv.Float64() if err != nil { @@ -4773,7 +4417,7 @@ func awsRestjson1_deserializeDocumentProactiveAnomalySummary(v **types.Proactive if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin1Max100PatternW to be of type string, got %T instead", value) + return fmt.Errorf("expected InsightId to be of type string, got %T instead", value) } sv.AssociatedInsightId = ptr.String(jtv) } @@ -4782,7 +4426,7 @@ func awsRestjson1_deserializeDocumentProactiveAnomalySummary(v **types.Proactive if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin1Max100PatternW to be of type string, got %T instead", value) + return fmt.Errorf("expected AnomalyId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } @@ -4791,13 +4435,13 @@ func awsRestjson1_deserializeDocumentProactiveAnomalySummary(v **types.Proactive if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __double to be json.Number, got %T instead", value) + return fmt.Errorf("expected AnomalyLimit to be json.Number, got %T instead", value) } f64, err := jtv.Float64() if err != nil { return err } - sv.Limit = f64 + sv.Limit = ptr.Float64(f64) } case "PredictionTimeRange": @@ -4837,7 +4481,7 @@ func awsRestjson1_deserializeDocumentProactiveAnomalySummary(v **types.Proactive if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected __timestampUnix to be json.Number, got %T instead", value) + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) } f64, err := jtv.Float64() if err != nil { @@ -4881,7 +4525,7 @@ func awsRestjson1_deserializeDocumentProactiveInsight(v **types.ProactiveInsight if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin1Max100PatternW to be of type string, got %T instead", value) + return fmt.Errorf("expected InsightId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } @@ -4895,7 +4539,7 @@ func awsRestjson1_deserializeDocumentProactiveInsight(v **types.ProactiveInsight if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin1Max530PatternSS to be of type string, got %T instead", value) + return fmt.Errorf("expected InsightName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } @@ -4923,7 +4567,7 @@ func awsRestjson1_deserializeDocumentProactiveInsight(v **types.ProactiveInsight if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin1Max100Pattern to be of type string, got %T instead", value) + return fmt.Errorf("expected SsmOpsItemId to be of type string, got %T instead", value) } sv.SsmOpsItemId = ptr.String(jtv) } @@ -4946,6 +4590,40 @@ func awsRestjson1_deserializeDocumentProactiveInsight(v **types.ProactiveInsight return nil } +func awsRestjson1_deserializeDocumentProactiveInsights(v *[]types.ProactiveInsightSummary, 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.ProactiveInsightSummary + if *v == nil { + cv = []types.ProactiveInsightSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ProactiveInsightSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentProactiveInsightSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentProactiveInsightSummary(v **types.ProactiveInsightSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4972,7 +4650,7 @@ func awsRestjson1_deserializeDocumentProactiveInsightSummary(v **types.Proactive if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin1Max100PatternW to be of type string, got %T instead", value) + return fmt.Errorf("expected InsightId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } @@ -4986,7 +4664,7 @@ func awsRestjson1_deserializeDocumentProactiveInsightSummary(v **types.Proactive if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin1Max530PatternSS to be of type string, got %T instead", value) + return fmt.Errorf("expected InsightName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } @@ -5028,6 +4706,40 @@ func awsRestjson1_deserializeDocumentProactiveInsightSummary(v **types.Proactive return nil } +func awsRestjson1_deserializeDocumentReactiveAnomalies(v *[]types.ReactiveAnomalySummary, 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.ReactiveAnomalySummary + if *v == nil { + cv = []types.ReactiveAnomalySummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ReactiveAnomalySummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentReactiveAnomalySummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentReactiveAnomaly(v **types.ReactiveAnomaly, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5059,7 +4771,7 @@ func awsRestjson1_deserializeDocumentReactiveAnomaly(v **types.ReactiveAnomaly, if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin1Max100PatternW to be of type string, got %T instead", value) + return fmt.Errorf("expected InsightId to be of type string, got %T instead", value) } sv.AssociatedInsightId = ptr.String(jtv) } @@ -5068,7 +4780,7 @@ func awsRestjson1_deserializeDocumentReactiveAnomaly(v **types.ReactiveAnomaly, if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin1Max100PatternW to be of type string, got %T instead", value) + return fmt.Errorf("expected AnomalyId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } @@ -5141,7 +4853,7 @@ func awsRestjson1_deserializeDocumentReactiveAnomalySummary(v **types.ReactiveAn if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin1Max100PatternW to be of type string, got %T instead", value) + return fmt.Errorf("expected InsightId to be of type string, got %T instead", value) } sv.AssociatedInsightId = ptr.String(jtv) } @@ -5150,7 +4862,7 @@ func awsRestjson1_deserializeDocumentReactiveAnomalySummary(v **types.ReactiveAn if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin1Max100PatternW to be of type string, got %T instead", value) + return fmt.Errorf("expected AnomalyId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } @@ -5218,7 +4930,7 @@ func awsRestjson1_deserializeDocumentReactiveInsight(v **types.ReactiveInsight, if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin1Max100PatternW to be of type string, got %T instead", value) + return fmt.Errorf("expected InsightId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } @@ -5232,7 +4944,7 @@ func awsRestjson1_deserializeDocumentReactiveInsight(v **types.ReactiveInsight, if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin1Max530PatternSS to be of type string, got %T instead", value) + return fmt.Errorf("expected InsightName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } @@ -5255,7 +4967,7 @@ func awsRestjson1_deserializeDocumentReactiveInsight(v **types.ReactiveInsight, if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin1Max100Pattern to be of type string, got %T instead", value) + return fmt.Errorf("expected SsmOpsItemId to be of type string, got %T instead", value) } sv.SsmOpsItemId = ptr.String(jtv) } @@ -5278,6 +4990,40 @@ func awsRestjson1_deserializeDocumentReactiveInsight(v **types.ReactiveInsight, return nil } +func awsRestjson1_deserializeDocumentReactiveInsights(v *[]types.ReactiveInsightSummary, 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.ReactiveInsightSummary + if *v == nil { + cv = []types.ReactiveInsightSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ReactiveInsightSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentReactiveInsightSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentReactiveInsightSummary(v **types.ReactiveInsightSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5304,7 +5050,7 @@ func awsRestjson1_deserializeDocumentReactiveInsightSummary(v **types.ReactiveIn if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin1Max100PatternW to be of type string, got %T instead", value) + return fmt.Errorf("expected InsightId to be of type string, got %T instead", value) } sv.Id = ptr.String(jtv) } @@ -5318,7 +5064,7 @@ func awsRestjson1_deserializeDocumentReactiveInsightSummary(v **types.ReactiveIn if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin1Max530PatternSS to be of type string, got %T instead", value) + return fmt.Errorf("expected InsightName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } @@ -5381,7 +5127,7 @@ func awsRestjson1_deserializeDocumentRecommendation(v **types.Recommendation, va if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected RecommendationDescription to be of type string, got %T instead", value) } sv.Description = ptr.String(jtv) } @@ -5390,7 +5136,7 @@ func awsRestjson1_deserializeDocumentRecommendation(v **types.Recommendation, va if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected RecommendationLink to be of type string, got %T instead", value) } sv.Link = ptr.String(jtv) } @@ -5399,7 +5145,7 @@ func awsRestjson1_deserializeDocumentRecommendation(v **types.Recommendation, va if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected RecommendationName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } @@ -5408,18 +5154,18 @@ func awsRestjson1_deserializeDocumentRecommendation(v **types.Recommendation, va if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected RecommendationReason to be of type string, got %T instead", value) } sv.Reason = ptr.String(jtv) } case "RelatedAnomalies": - if err := awsRestjson1_deserializeDocument__listOfRecommendationRelatedAnomaly(&sv.RelatedAnomalies, value); err != nil { + if err := awsRestjson1_deserializeDocumentRecommendationRelatedAnomalies(&sv.RelatedAnomalies, value); err != nil { return err } case "RelatedEvents": - if err := awsRestjson1_deserializeDocument__listOfRecommendationRelatedEvent(&sv.RelatedEvents, value); err != nil { + if err := awsRestjson1_deserializeDocumentRecommendationRelatedEvents(&sv.RelatedEvents, value); err != nil { return err } @@ -5432,6 +5178,40 @@ func awsRestjson1_deserializeDocumentRecommendation(v **types.Recommendation, va return nil } +func awsRestjson1_deserializeDocumentRecommendationRelatedAnomalies(v *[]types.RecommendationRelatedAnomaly, 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.RecommendationRelatedAnomaly + if *v == nil { + cv = []types.RecommendationRelatedAnomaly{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RecommendationRelatedAnomaly + destAddr := &col + if err := awsRestjson1_deserializeDocumentRecommendationRelatedAnomaly(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentRecommendationRelatedAnomaly(v **types.RecommendationRelatedAnomaly, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5455,12 +5235,12 @@ func awsRestjson1_deserializeDocumentRecommendationRelatedAnomaly(v **types.Reco for key, value := range shape { switch key { case "Resources": - if err := awsRestjson1_deserializeDocument__listOfRecommendationRelatedAnomalyResource(&sv.Resources, value); err != nil { + if err := awsRestjson1_deserializeDocumentRecommendationRelatedAnomalyResources(&sv.Resources, value); err != nil { return err } case "SourceDetails": - if err := awsRestjson1_deserializeDocument__listOfRecommendationRelatedAnomalySourceDetail(&sv.SourceDetails, value); err != nil { + if err := awsRestjson1_deserializeDocumentRelatedAnomalySourceDetails(&sv.SourceDetails, value); err != nil { return err } @@ -5499,7 +5279,7 @@ func awsRestjson1_deserializeDocumentRecommendationRelatedAnomalyResource(v **ty if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected RecommendationRelatedAnomalyResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } @@ -5508,7 +5288,7 @@ func awsRestjson1_deserializeDocumentRecommendationRelatedAnomalyResource(v **ty if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected RecommendationRelatedAnomalyResourceType to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } @@ -5518,7 +5298,41 @@ func awsRestjson1_deserializeDocumentRecommendationRelatedAnomalyResource(v **ty } } - *v = sv + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRecommendationRelatedAnomalyResources(v *[]types.RecommendationRelatedAnomalyResource, 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.RecommendationRelatedAnomalyResource + if *v == nil { + cv = []types.RecommendationRelatedAnomalyResource{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RecommendationRelatedAnomalyResource + destAddr := &col + if err := awsRestjson1_deserializeDocumentRecommendationRelatedAnomalyResource(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv return nil } @@ -5545,7 +5359,7 @@ func awsRestjson1_deserializeDocumentRecommendationRelatedAnomalySourceDetail(v for key, value := range shape { switch key { case "CloudWatchMetrics": - if err := awsRestjson1_deserializeDocument__listOfRecommendationRelatedCloudWatchMetricsSourceDetail(&sv.CloudWatchMetrics, value); err != nil { + if err := awsRestjson1_deserializeDocumentRecommendationRelatedCloudWatchMetricsSourceDetails(&sv.CloudWatchMetrics, value); err != nil { return err } @@ -5584,7 +5398,7 @@ func awsRestjson1_deserializeDocumentRecommendationRelatedCloudWatchMetricsSourc if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected RecommendationRelatedCloudWatchMetricsSourceMetricName to be of type string, got %T instead", value) } sv.MetricName = ptr.String(jtv) } @@ -5593,7 +5407,7 @@ func awsRestjson1_deserializeDocumentRecommendationRelatedCloudWatchMetricsSourc if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected RecommendationRelatedCloudWatchMetricsSourceNamespace to be of type string, got %T instead", value) } sv.Namespace = ptr.String(jtv) } @@ -5607,6 +5421,40 @@ func awsRestjson1_deserializeDocumentRecommendationRelatedCloudWatchMetricsSourc return nil } +func awsRestjson1_deserializeDocumentRecommendationRelatedCloudWatchMetricsSourceDetails(v *[]types.RecommendationRelatedCloudWatchMetricsSourceDetail, 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.RecommendationRelatedCloudWatchMetricsSourceDetail + if *v == nil { + cv = []types.RecommendationRelatedCloudWatchMetricsSourceDetail{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RecommendationRelatedCloudWatchMetricsSourceDetail + destAddr := &col + if err := awsRestjson1_deserializeDocumentRecommendationRelatedCloudWatchMetricsSourceDetail(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentRecommendationRelatedEvent(v **types.RecommendationRelatedEvent, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5633,13 +5481,13 @@ func awsRestjson1_deserializeDocumentRecommendationRelatedEvent(v **types.Recomm if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected RecommendationRelatedEventName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } case "Resources": - if err := awsRestjson1_deserializeDocument__listOfRecommendationRelatedEventResource(&sv.Resources, value); err != nil { + if err := awsRestjson1_deserializeDocumentRecommendationRelatedEventResources(&sv.Resources, value); err != nil { return err } @@ -5678,7 +5526,7 @@ func awsRestjson1_deserializeDocumentRecommendationRelatedEventResource(v **type if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected RecommendationRelatedEventResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } @@ -5687,7 +5535,7 @@ func awsRestjson1_deserializeDocumentRecommendationRelatedEventResource(v **type if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected RecommendationRelatedEventResourceType to be of type string, got %T instead", value) } sv.Type = ptr.String(jtv) } @@ -5701,6 +5549,142 @@ func awsRestjson1_deserializeDocumentRecommendationRelatedEventResource(v **type return nil } +func awsRestjson1_deserializeDocumentRecommendationRelatedEventResources(v *[]types.RecommendationRelatedEventResource, 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.RecommendationRelatedEventResource + if *v == nil { + cv = []types.RecommendationRelatedEventResource{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RecommendationRelatedEventResource + destAddr := &col + if err := awsRestjson1_deserializeDocumentRecommendationRelatedEventResource(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRecommendationRelatedEvents(v *[]types.RecommendationRelatedEvent, 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.RecommendationRelatedEvent + if *v == nil { + cv = []types.RecommendationRelatedEvent{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RecommendationRelatedEvent + destAddr := &col + if err := awsRestjson1_deserializeDocumentRecommendationRelatedEvent(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRecommendations(v *[]types.Recommendation, 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.Recommendation + if *v == nil { + cv = []types.Recommendation{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Recommendation + destAddr := &col + if err := awsRestjson1_deserializeDocumentRecommendation(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRelatedAnomalySourceDetails(v *[]types.RecommendationRelatedAnomalySourceDetail, 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.RecommendationRelatedAnomalySourceDetail + if *v == nil { + cv = []types.RecommendationRelatedAnomalySourceDetail{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RecommendationRelatedAnomalySourceDetail + destAddr := &col + if err := awsRestjson1_deserializeDocumentRecommendationRelatedAnomalySourceDetail(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentResourceCollection(v **types.ResourceCollection, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5799,7 +5783,7 @@ func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.Resourc if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessageString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } @@ -5808,7 +5792,7 @@ func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.Resourc if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected ResourceIdString to be of type string, got %T instead", value) } sv.ResourceId = ptr.String(jtv) } @@ -5817,7 +5801,7 @@ func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.Resourc if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected ResourceIdType to be of type string, got %T instead", value) } sv.ResourceType = ptr.String(jtv) } @@ -5893,7 +5877,7 @@ func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.Ser if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessageString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } @@ -5933,7 +5917,7 @@ func awsRestjson1_deserializeDocumentSnsChannelConfig(v **types.SnsChannelConfig if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __stringMin36Max1024PatternArnAwsAZ09SnsAZ09D12 to be of type string, got %T instead", value) + return fmt.Errorf("expected TopicArn to be of type string, got %T instead", value) } sv.TopicArn = ptr.String(jtv) } @@ -5947,6 +5931,42 @@ func awsRestjson1_deserializeDocumentSnsChannelConfig(v **types.SnsChannelConfig return nil } +func awsRestjson1_deserializeDocumentStackNames(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 StackName to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5973,7 +5993,7 @@ func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingExc if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessageString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } @@ -5982,16 +6002,29 @@ func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingExc if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorQuotaCodeString to be of type string, got %T instead", value) } sv.QuotaCode = ptr.String(jtv) } + case "RetryAfterSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RetryAfterSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RetryAfterSeconds = int32(i64) + } + case "ServiceCode": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorServiceCodeString to be of type string, got %T instead", value) } sv.ServiceCode = ptr.String(jtv) } @@ -6028,7 +6061,7 @@ func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationExc for key, value := range shape { switch key { case "Fields": - if err := awsRestjson1_deserializeDocument__listOfValidationExceptionField(&sv.Fields, value); err != nil { + if err := awsRestjson1_deserializeDocumentValidationExceptionFields(&sv.Fields, value); err != nil { return err } @@ -6036,7 +6069,7 @@ func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationExc if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessageString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } @@ -6085,7 +6118,7 @@ func awsRestjson1_deserializeDocumentValidationExceptionField(v **types.Validati if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessageString to be of type string, got %T instead", value) } sv.Message = ptr.String(jtv) } @@ -6094,7 +6127,7 @@ func awsRestjson1_deserializeDocumentValidationExceptionField(v **types.Validati if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected __string to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorNameString to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } @@ -6107,3 +6140,37 @@ func awsRestjson1_deserializeDocumentValidationExceptionField(v **types.Validati *v = sv return nil } + +func awsRestjson1_deserializeDocumentValidationExceptionFields(v *[]types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.ValidationExceptionField + if *v == nil { + cv = []types.ValidationExceptionField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ValidationExceptionField + destAddr := &col + if err := awsRestjson1_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} diff --git a/service/devopsguru/doc.go b/service/devopsguru/doc.go index 387832f84c4..b9e02db9d6f 100644 --- a/service/devopsguru/doc.go +++ b/service/devopsguru/doc.go @@ -3,4 +3,20 @@ // Package devopsguru provides the API client, operations, and parameter types for // Amazon DevOps Guru. // +// Amazon DevOps Guru is a fully managed service that helps you identify anomalous +// behavior in business critical operational applications. You specify the AWS +// resources that you want DevOps Guru to cover, then the Amazon CloudWatch metrics +// and AWS CloudTrail events related to those resources are analyzed. When +// anomalous behavior is detected, DevOps Guru creates an insight that includes +// recommendations, related events, and related metrics that can help you improve +// your operational applications. For more information, see What is Amazon DevOps +// Guru (https://docs.aws.amazon.com/devops-guru/latest/userguide/welcome.html). +// You can specify 1 or 2 Amazon Simple Notification Service topics so you are +// notified every time a new insight is created. You can also enable DevOps Guru to +// generate an OpsItem in AWS Systems Manager for each insight to help you manage +// and track your work addressing insights. To learn about the DevOps Guru +// workflow, see How DevOps Guru works +// (https://docs.aws.amazon.com/devops-guru/latest/userguide/welcome.html#how-it-works). +// To learn about DevOps Guru concepts, see Concepts in DevOps Guru +// (https://docs.aws.amazon.com/devops-guru/latest/userguide/concepts.html). package devopsguru diff --git a/service/devopsguru/serializers.go b/service/devopsguru/serializers.go index 56156f796c8..61b84c1f5b6 100644 --- a/service/devopsguru/serializers.go +++ b/service/devopsguru/serializers.go @@ -399,11 +399,11 @@ func awsRestjson1_serializeOpHttpBindingsDescribeResourceCollectionHealthInput(v encoder.SetQuery("NextToken").String(*v.NextToken) } - if v.ResourceCollectionType == nil || len(*v.ResourceCollectionType) == 0 { + if len(v.ResourceCollectionType) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceCollectionType must not be empty")} } - if v.ResourceCollectionType != nil { - if err := encoder.SetURI("ResourceCollectionType").String(*v.ResourceCollectionType); err != nil { + if len(v.ResourceCollectionType) > 0 { + if err := encoder.SetURI("ResourceCollectionType").String(string(v.ResourceCollectionType)); err != nil { return err } } @@ -516,11 +516,11 @@ func awsRestjson1_serializeOpHttpBindingsGetResourceCollectionInput(v *GetResour encoder.SetQuery("NextToken").String(*v.NextToken) } - if v.ResourceCollectionType == nil || len(*v.ResourceCollectionType) == 0 { + if len(v.ResourceCollectionType) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceCollectionType must not be empty")} } - if v.ResourceCollectionType != nil { - if err := encoder.SetURI("ResourceCollectionType").String(*v.ResourceCollectionType); err != nil { + if len(v.ResourceCollectionType) > 0 { + if err := encoder.SetURI("ResourceCollectionType").String(string(v.ResourceCollectionType)); err != nil { return err } } @@ -606,9 +606,9 @@ func awsRestjson1_serializeOpDocumentListAnomaliesForInsightInput(v *ListAnomali object := value.Object() defer object.Close() - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -698,9 +698,9 @@ func awsRestjson1_serializeOpDocumentListEventsInput(v *ListEventsInput, value s } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -776,9 +776,9 @@ func awsRestjson1_serializeOpDocumentListInsightsInput(v *ListInsightsInput, val object := value.Object() defer object.Close() - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -1157,9 +1157,9 @@ func awsRestjson1_serializeOpDocumentSearchInsightsInput(v *SearchInsightsInput, } } - if v.MaxResults != 0 { + if v.MaxResults != nil { ok := object.Key("MaxResults") - ok.Integer(v.MaxResults) + ok.Integer(*v.MaxResults) } if v.NextToken != nil { @@ -1337,46 +1337,13 @@ func awsRestjson1_serializeOpDocumentUpdateServiceIntegrationInput(v *UpdateServ return nil } -func awsRestjson1_serializeDocument__listOf__stringMin1Max128PatternAZAZAZAZ09(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_serializeDocument__listOfInsightSeverity(v []types.InsightSeverity, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - -func awsRestjson1_serializeDocument__listOfInsightStatus(v []types.InsightStatus, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - av.String(string(v[i])) - } - return nil -} - func awsRestjson1_serializeDocumentCloudFormationCollection(v *types.CloudFormationCollection, value smithyjson.Value) error { object := value.Object() defer object.Close() if v.StackNames != nil { ok := object.Key("StackNames") - if err := awsRestjson1_serializeDocument__listOf__stringMin1Max128PatternAZAZAZAZ09(v.StackNames, ok); err != nil { + if err := awsRestjson1_serializeDocumentStackNames(v.StackNames, ok); err != nil { return err } } @@ -1435,6 +1402,28 @@ func awsRestjson1_serializeDocumentInsightFeedback(v *types.InsightFeedback, val return nil } +func awsRestjson1_serializeDocumentInsightSeverities(v []types.InsightSeverity, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentInsightStatuses(v []types.InsightStatus, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + func awsRestjson1_serializeDocumentListEventsFilters(v *types.ListEventsFilters, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1607,14 +1596,14 @@ func awsRestjson1_serializeDocumentSearchInsightsFilters(v *types.SearchInsights if v.Severities != nil { ok := object.Key("Severities") - if err := awsRestjson1_serializeDocument__listOfInsightSeverity(v.Severities, ok); err != nil { + if err := awsRestjson1_serializeDocumentInsightSeverities(v.Severities, ok); err != nil { return err } } if v.Statuses != nil { ok := object.Key("Statuses") - if err := awsRestjson1_serializeDocument__listOfInsightStatus(v.Statuses, ok); err != nil { + if err := awsRestjson1_serializeDocumentInsightStatuses(v.Statuses, ok); err != nil { return err } } @@ -1634,6 +1623,17 @@ func awsRestjson1_serializeDocumentSnsChannelConfig(v *types.SnsChannelConfig, v return nil } +func awsRestjson1_serializeDocumentStackNames(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_serializeDocumentStartTimeRange(v *types.StartTimeRange, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1657,7 +1657,7 @@ func awsRestjson1_serializeDocumentUpdateCloudFormationCollectionFilter(v *types if v.StackNames != nil { ok := object.Key("StackNames") - if err := awsRestjson1_serializeDocument__listOf__stringMin1Max128PatternAZAZAZAZ09(v.StackNames, ok); err != nil { + if err := awsRestjson1_serializeDocumentUpdateStackNames(v.StackNames, ok); err != nil { return err } } @@ -1692,3 +1692,14 @@ func awsRestjson1_serializeDocumentUpdateServiceIntegrationConfig(v *types.Updat return nil } + +func awsRestjson1_serializeDocumentUpdateStackNames(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 +} diff --git a/service/devopsguru/types/enums.go b/service/devopsguru/types/enums.go index 52c4e9dfefa..7e3535aef90 100644 --- a/service/devopsguru/types/enums.go +++ b/service/devopsguru/types/enums.go @@ -46,7 +46,7 @@ type CloudWatchMetricsStat string const ( CloudWatchMetricsStatSum CloudWatchMetricsStat = "Sum" CloudWatchMetricsStatAverage CloudWatchMetricsStat = "Average" - CloudWatchMetricsStatSamplecount CloudWatchMetricsStat = "SampleCount" + CloudWatchMetricsStatSampleCount CloudWatchMetricsStat = "SampleCount" CloudWatchMetricsStatMinimum CloudWatchMetricsStat = "Minimum" CloudWatchMetricsStatMaximum CloudWatchMetricsStat = "Maximum" CloudWatchMetricsStatP99 CloudWatchMetricsStat = "p99" @@ -210,6 +210,22 @@ func (OptInStatus) Values() []OptInStatus { } } +type ResourceCollectionType string + +// Enum values for ResourceCollectionType +const ( + ResourceCollectionTypeAwsCloudFormation ResourceCollectionType = "AWS_CLOUD_FORMATION" +) + +// Values returns all known values for ResourceCollectionType. 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 (ResourceCollectionType) Values() []ResourceCollectionType { + return []ResourceCollectionType{ + "AWS_CLOUD_FORMATION", + } +} + type UpdateResourceCollectionAction string // Enum values for UpdateResourceCollectionAction diff --git a/service/devopsguru/types/errors.go b/service/devopsguru/types/errors.go index 7a32b47012e..6a78867dc54 100644 --- a/service/devopsguru/types/errors.go +++ b/service/devopsguru/types/errors.go @@ -7,6 +7,11 @@ import ( smithy "github.com/aws/smithy-go" ) +// You don't have permissions to perform the requested operation. The user or role +// that is making the request must have at least one IAM permissions policy +// attached that grants the required permissions. For more information, see Access +// Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) in the +// IAM User Guide. type AccessDeniedException struct { Message *string } @@ -23,6 +28,7 @@ func (e *AccessDeniedException) ErrorMessage() string { func (e *AccessDeniedException) ErrorCode() string { return "AccessDeniedException" } func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// An exception that is thrown when a conflict occurs. type ConflictException struct { Message *string @@ -42,8 +48,11 @@ func (e *ConflictException) ErrorMessage() string { func (e *ConflictException) ErrorCode() string { return "ConflictException" } func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// An internal failure in an Amazon service occurred. type InternalServerException struct { Message *string + + RetryAfterSeconds int32 } func (e *InternalServerException) Error() string { @@ -58,6 +67,7 @@ func (e *InternalServerException) ErrorMessage() string { func (e *InternalServerException) ErrorCode() string { return "InternalServerException" } func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } +// A requested resource could not be found type ResourceNotFoundException struct { Message *string @@ -77,6 +87,7 @@ func (e *ResourceNotFoundException) ErrorMessage() string { func (e *ResourceNotFoundException) ErrorCode() string { return "ResourceNotFoundException" } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The request contains a value that exceeds a maximum quota. type ServiceQuotaExceededException struct { Message *string } @@ -93,11 +104,13 @@ func (e *ServiceQuotaExceededException) ErrorMessage() string { func (e *ServiceQuotaExceededException) ErrorCode() string { return "ServiceQuotaExceededException" } func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The request was denied due to a request throttling. type ThrottlingException struct { Message *string - QuotaCode *string - ServiceCode *string + QuotaCode *string + ServiceCode *string + RetryAfterSeconds int32 } func (e *ThrottlingException) Error() string { @@ -112,11 +125,13 @@ func (e *ThrottlingException) ErrorMessage() string { func (e *ThrottlingException) ErrorCode() string { return "ThrottlingException" } func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// Contains information about data passed in to a field during a request that is +// not valid. type ValidationException struct { Message *string - Fields []ValidationExceptionField Reason ValidationExceptionReason + Fields []ValidationExceptionField } func (e *ValidationException) Error() string { diff --git a/service/devopsguru/types/types.go b/service/devopsguru/types/types.go index 1d04efb53c5..ce6d4c54721 100644 --- a/service/devopsguru/types/types.go +++ b/service/devopsguru/types/types.go @@ -6,424 +6,834 @@ import ( "time" ) +// Details about the source of the anomalous operational data that triggered the +// anomaly. The one supported source is Amazon CloudWatch metrics. type AnomalySourceDetails struct { + + // An array of CloudWatchMetricsDetail object that contains information about the + // analyzed metrics that displayed anomalous behavior. CloudWatchMetrics []CloudWatchMetricsDetail } +// A time range that specifies when the observed unusual behavior in an anomaly +// started and ended. type AnomalyTimeRange struct { + // The time when the anomalous behavior started. + // // This member is required. StartTime *time.Time + // The time when the anomalous behavior ended. EndTime *time.Time } +// Information about AWS CloudFormation stacks. You can use stacks to specify which +// AWS resources in your account to analyze. For more information, see Stacks +// (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacks.html) in +// the AWS CloudFormation User Guide. type CloudFormationCollection struct { + + // An array of CloudFormation stack names. StackNames []string } +// Information about AWS CloudFormation stacks. You can use stacks to specify which +// AWS resources in your account to analyze. For more information, see Stacks +// (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacks.html) in +// the AWS CloudFormation User Guide. type CloudFormationCollectionFilter struct { + + // An array of CloudFormation stack names. StackNames []string } +// Information about the health of AWS resources in your account that are specified +// by an AWS CloudFormation stack. type CloudFormationHealth struct { + + // Information about the health of the AWS resources in your account that are + // specified by an AWS CloudFormation stack, including the number of open + // proactive, open reactive insights, and the Mean Time to Recover (MTTR) of closed + // insights. Insight *InsightHealth + // The name of the CloudFormation stack. StackName *string } +// Information about an Amazon CloudWatch metric. type CloudWatchMetricsDetail struct { + + // An array of CloudWatch dimensions associated with Dimensions []CloudWatchMetricsDimension + // The name of the CloudWatch metric. MetricName *string + // The namespace of the CloudWatch metric. A namespace is a container for + // CloudWatch metrics. Namespace *string + // The length of time associated with the CloudWatch metric in number of seconds. Period int32 + // The type of statistic associated with the CloudWatch metric. For more + // information, see Statistics + // (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Statistic) + // in the Amazon CloudWatch User Guide. Stat CloudWatchMetricsStat + // The unit of measure used for the CloudWatch metric. For example, Bytes, Seconds, + // Count, and Percent. Unit *string } +// The dimension of a Amazon CloudWatch metric that is used when DevOps Guru +// analyzes the resources in your account for operational problems and anomalous +// behaviour. A dimension is a name/value pair that is part of the identity of a +// metric. A metric can have up to 10 dimensions. For more information, see +// Dimensions +// (https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Dimension) +// in the Amazon CloudWatch User Guide. type CloudWatchMetricsDimension struct { + + // The name of the CloudWatch dimension. Name *string + // The value of the CloudWatch dimension. Value *string } +// A range of time that specifies when anomalous behavior in an anomaly or insight +// ended. type EndTimeRange struct { + + // The earliest end time in the time range. FromTime *time.Time + // The latest end time in the time range. ToTime *time.Time } +// An AWS resource event. AWS resource events and metrics are analyzed by DevOps +// Guru to find anomalous behavior and provide recommendations to improve your +// operational solutions. type Event struct { + + // The source, AWS_CLOUD_TRAIL or AWS_CODE_DEPLOY, where DevOps Guru analysis found + // the event. DataSource EventDataSource + // The class of the event. The class specifies what the event is related to, such + // as an infrastructure change, a deployment, or a schema change. EventClass EventClass + // The AWS source that emitted the event. EventSource *string + // The ID of the event. Id *string + // The name of the event. Name *string + // A collection of AWS resources supported by DevOps Guru. The one type of AWS + // resource collection supported is AWS CloudFormation stacks. DevOps Guru can be + // configured to analyze only the AWS resources that are defined in the stacks. ResourceCollection *ResourceCollection + // An EventResource object that contains information about the resource that + // emitted the event. Resources []EventResource + // A Timestamp that specifies the time the event occurred. Time *time.Time } +// The AWS resource that emitted an event. AWS resource events and metrics are +// analyzed by DevOps Guru to find anomalous behavior and provide recommendations +// to improve your operational solutions. type EventResource struct { + + // The Amazon Resource Name (ARN) of the resource that emitted an event. Arn *string + // The name of the resource that emitted an event. Name *string + // The type of resource that emitted an event. Type *string } +// The time range during which an AWS event occurred. AWS resource events and +// metrics are analyzed by DevOps Guru to find anomalous behavior and provide +// recommendations to improve your operational solutions. type EventTimeRange struct { + // The time when the event started. + // // This member is required. FromTime *time.Time + // The time when the event ended. + // // This member is required. ToTime *time.Time } +// Information about insight feedback received from a customer. type InsightFeedback struct { + + // The feedback provided by the customer. Feedback InsightFeedbackOption + // The insight feedback ID. Id *string } +// Information about the number of open reactive and proactive insights that can be +// used to gauge the health of your system. type InsightHealth struct { - MeanTimeToRecoverInMilliseconds int64 + // The Meant Time to Recover (MTTR) for the insight. + MeanTimeToRecoverInMilliseconds *int64 + + // The number of open proactive insights. OpenProactiveInsights int32 + // The number of open reactive insights. OpenReactiveInsights int32 } +// A time ranged that specifies when the observed behavior in an insight started +// and ended. type InsightTimeRange struct { + // The time when the behavior described in an insight started. + // // This member is required. StartTime *time.Time + // The time when the behavior described in an insight ended. EndTime *time.Time } +// Filters you can use to specify which events are returned when ListEvents is +// called. type ListEventsFilters struct { + + // The source, AWS_CLOUD_TRAIL or AWS_CODE_DEPLOY, of the events you want returned. DataSource EventDataSource + // The class of the events you want to filter for, such as an infrastructure + // change, a deployment, or a schema change. EventClass EventClass + // The AWS source that emitted the events you want to filter for. EventSource *string + // A time range during which you want the filtered events to have occurred. EventTimeRange *EventTimeRange + // An ID of an insight that is related to the events you want to filter for. InsightId *string + // A collection of AWS resources supported by DevOps Guru. The one type of AWS + // resource collection supported is AWS CloudFormation stacks. DevOps Guru can be + // configured to analyze only the AWS resources that are defined in the stacks. ResourceCollection *ResourceCollection } +// Used to filter for insights that have any status. type ListInsightsAnyStatusFilter struct { + // A time range used to specify when the behavior of the filtered insights started. + // // This member is required. StartTimeRange *StartTimeRange + // Use to filter for either REACTIVE or PROACTIVE insights. + // // This member is required. Type InsightType } +// Used to filter for insights that have the status CLOSED. type ListInsightsClosedStatusFilter struct { + // A time range used to specify when the behavior of the filtered insights ended. + // // This member is required. EndTimeRange *EndTimeRange + // Use to filter for either REACTIVE or PROACTIVE insights. + // // This member is required. Type InsightType } +// Used to filter for insights that have the status ONGOING. type ListInsightsOngoingStatusFilter struct { + // Use to filter for either REACTIVE or PROACTIVE insights. + // // This member is required. Type InsightType } +// A filter used by ListInsights to specify which insights to return. type ListInsightsStatusFilter struct { + + // A ListInsightsAnyStatusFilter that specifies insights of any status that are + // either REACTIVE or PROACTIVE. Any *ListInsightsAnyStatusFilter + // A ListInsightsClosedStatusFilter that specifies closed insights that are either + // REACTIVE or PROACTIVE. Closed *ListInsightsClosedStatusFilter + // A ListInsightsAnyStatusFilter that specifies ongoing insights that are either + // REACTIVE or PROACTIVE. Ongoing *ListInsightsOngoingStatusFilter } +// Information about a notification channel. A notification channel is used to +// notify you when DevOps Guru creates an insight. The one supported notification +// channel is Amazon Simple Notification Service (Amazon SNS). If you use an Amazon +// SNS topic in another account, you must attach a policy to it that grants DevOps +// Guru permission to it notifications. DevOps Guru adds the required policy on +// your behalf to send notifications using Amazon SNS in your account. For more +// information, see Permissions for cross account Amazon SNS topics +// (https://docs.aws.amazon.com/devops-guru/latest/userguide/sns-required-permissions.html). +// If you use an Amazon SNS topic that is encrypted by an AWS Key Management +// Service customer-managed key (CMK), then you must add permissions to the CMK. +// For more information, see Permissions for AWS KMS–encrypted Amazon SNS topics +// (https://docs.aws.amazon.com/devops-guru/latest/userguide/sns-kms-permissions.html). type NotificationChannel struct { + + // A NotificationChannelConfig object that contains information about configured + // notification channels. Config *NotificationChannelConfig + // The ID of a notification channel. Id *string } +// Information about notification channels you have configured with DevOps Guru. +// The one supported notification channel is Amazon Simple Notification Service +// (Amazon SNS). type NotificationChannelConfig struct { + // Information about a notification channel configured in DevOps Guru to send + // notifications when insights are created. If you use an Amazon SNS topic in + // another account, you must attach a policy to it that grants DevOps Guru + // permission to it notifications. DevOps Guru adds the required policy on your + // behalf to send notifications using Amazon SNS in your account. For more + // information, see Permissions for cross account Amazon SNS topics + // (https://docs.aws.amazon.com/devops-guru/latest/userguide/sns-required-permissions.html). + // If you use an Amazon SNS topic that is encrypted by an AWS Key Management + // Service customer-managed key (CMK), then you must add permissions to the CMK. + // For more information, see Permissions for AWS KMS–encrypted Amazon SNS topics + // (https://docs.aws.amazon.com/devops-guru/latest/userguide/sns-kms-permissions.html). + // // This member is required. Sns *SnsChannelConfig } +// Information about whether DevOps Guru is configured to create an OpsItem in AWS +// Systems Manager OpsCenter for each created insight. type OpsCenterIntegration struct { + + // Specifies if DevOps Guru is enabled to create an AWS Systems Manager OpsItem for + // each created insight. OptInStatus OptInStatus } +// Information about whether DevOps Guru is configured to create an OpsItem in AWS +// Systems Manager OpsCenter for each created insight. type OpsCenterIntegrationConfig struct { + + // Specifies if DevOps Guru is enabled to create an AWS Systems Manager OpsItem for + // each created insight. OptInStatus OptInStatus } +// The time range during which anomalous behavior in a proactive anomaly or an +// insight is expected to occur. type PredictionTimeRange struct { + // The time range during which a metric limit is expected to be exceeded. This + // applies to proactive insights only. + // // This member is required. StartTime *time.Time + // The time when the behavior in a proactive insight is expected to end. EndTime *time.Time } +// Information about an anomaly. This object is returned by ListAnomalies. type ProactiveAnomaly struct { + + // A time range that specifies when the observed unusual behavior in an anomaly + // started and ended. AnomalyTimeRange *AnomalyTimeRange + // The ID of the insight that contains this anomaly. An insight is composed of + // related anomalies. AssociatedInsightId *string + // The ID of a proactive anomaly. Id *string - Limit float64 + // A threshold that was exceeded by behavior in analyzed resources. Exceeding this + // threshold is related to the anomalous behavior that generated this anomaly. + Limit *float64 + // The time range during which anomalous behavior in a proactive anomaly or an + // insight is expected to occur. PredictionTimeRange *PredictionTimeRange + // A collection of AWS resources supported by DevOps Guru. The one type of AWS + // resource collection supported is AWS CloudFormation stacks. DevOps Guru can be + // configured to analyze only the AWS resources that are defined in the stacks. ResourceCollection *ResourceCollection + // The severity of a proactive anomaly. Severity AnomalySeverity + // Details about the source of the analyzed operational data that triggered the + // anomaly. The one supported source is Amazon CloudWatch metrics. SourceDetails *AnomalySourceDetails + // The status of a proactive anomaly. Status AnomalyStatus + // The time of the anomaly's most recent update. UpdateTime *time.Time } +// Details about a proactive anomaly. This object is returned by DescribeAnomaly. type ProactiveAnomalySummary struct { + + // A time range that specifies when the observed unusual behavior in an anomaly + // started and ended. AnomalyTimeRange *AnomalyTimeRange + // The ID of the insight that contains this anomaly. An insight is composed of + // related anomalies. AssociatedInsightId *string + // The ID of the anomaly. Id *string - Limit float64 + // A threshold that was exceeded by behavior in analyzed resources. Exceeding this + // threshold is related to the anomalous behavior that generated this anomaly. + Limit *float64 + // The time range during which anomalous behavior in a proactive anomaly or an + // insight is expected to occur. PredictionTimeRange *PredictionTimeRange + // A collection of AWS resources supported by DevOps Guru. The one type of AWS + // resource collection supported is AWS CloudFormation stacks. DevOps Guru can be + // configured to analyze only the AWS resources that are defined in the stacks. ResourceCollection *ResourceCollection + // The severity of the anomaly. Severity AnomalySeverity + // Details about the source of the analyzed operational data that triggered the + // anomaly. The one supported source is Amazon CloudWatch metrics. SourceDetails *AnomalySourceDetails + // The status of the anomaly. Status AnomalyStatus + // The time of the anomaly's most recent update. UpdateTime *time.Time } +// Details about a proactive insight. This object is returned by ListInsights. type ProactiveInsight struct { + + // The ID of the proactive insight. Id *string + // A time ranged that specifies when the observed behavior in an insight started + // and ended. InsightTimeRange *InsightTimeRange + // The name of the proactive insight. Name *string + // The time range during which anomalous behavior in a proactive anomaly or an + // insight is expected to occur. PredictionTimeRange *PredictionTimeRange + // A collection of AWS resources supported by DevOps Guru. The one type of AWS + // resource collection supported is AWS CloudFormation stacks. DevOps Guru can be + // configured to analyze only the AWS resources that are defined in the stacks. ResourceCollection *ResourceCollection + // The severity of the proactive insight. Severity InsightSeverity + // The ID of the AWS System Manager OpsItem created for this insight. You must + // enable the creation of OpstItems insights before they are created for each + // insight. SsmOpsItemId *string + // The status of the proactive insight. Status InsightStatus } +// Details about a proactive insight. This object is returned by DescribeInsight. type ProactiveInsightSummary struct { + + // The ID of the proactive insight. Id *string + // A time ranged that specifies when the observed behavior in an insight started + // and ended. InsightTimeRange *InsightTimeRange + // The name of the proactive insight. Name *string + // The time range during which anomalous behavior in a proactive anomaly or an + // insight is expected to occur. PredictionTimeRange *PredictionTimeRange + // A collection of AWS resources supported by DevOps Guru. The one type of AWS + // resource collection supported is AWS CloudFormation stacks. DevOps Guru can be + // configured to analyze only the AWS resources that are defined in the stacks. ResourceCollection *ResourceCollection + // The severity of the proactive insight. Severity InsightSeverity + // The status of the proactive insight. Status InsightStatus } +// Details about a reactive anomaly. This object is returned by ListAnomalies. type ReactiveAnomaly struct { + + // A time range that specifies when the observed unusual behavior in an anomaly + // started and ended. AnomalyTimeRange *AnomalyTimeRange + // The ID of the insight that contains this anomaly. An insight is composed of + // related anomalies. AssociatedInsightId *string + // The ID of the reactive anomaly. Id *string + // A collection of AWS resources supported by DevOps Guru. The one type of AWS + // resource collection supported is AWS CloudFormation stacks. DevOps Guru can be + // configured to analyze only the AWS resources that are defined in the stacks. ResourceCollection *ResourceCollection + // The severity of the anomaly. Severity AnomalySeverity + // Details about the source of the analyzed operational data that triggered the + // anomaly. The one supported source is Amazon CloudWatch metrics. SourceDetails *AnomalySourceDetails + // The status of the anomaly. Status AnomalyStatus } +// Details about a reactive anomaly. This object is returned by DescribeAnomaly. type ReactiveAnomalySummary struct { + + // A time range that specifies when the observed unusual behavior in an anomaly + // started and ended. AnomalyTimeRange *AnomalyTimeRange + // The ID of the insight that contains this anomaly. An insight is composed of + // related anomalies. AssociatedInsightId *string + // The ID of the reactive anomaly. Id *string + // A collection of AWS resources supported by DevOps Guru. The one type of AWS + // resource collection supported is AWS CloudFormation stacks. DevOps Guru can be + // configured to analyze only the AWS resources that are defined in the stacks. ResourceCollection *ResourceCollection + // The severity of the reactive anomaly. Severity AnomalySeverity + // Details about the source of the analyzed operational data that triggered the + // anomaly. The one supported source is Amazon CloudWatch metrics. SourceDetails *AnomalySourceDetails + // The status of the reactive anomaly. Status AnomalyStatus } +// Information about a reactive insight. This object is returned by ListInsights. type ReactiveInsight struct { + + // The ID of a reactive insight. Id *string + // A time ranged that specifies when the observed behavior in an insight started + // and ended. InsightTimeRange *InsightTimeRange + // The name of a reactive insight. Name *string + // A collection of AWS resources supported by DevOps Guru. The one type of AWS + // resource collection supported is AWS CloudFormation stacks. DevOps Guru can be + // configured to analyze only the AWS resources that are defined in the stacks. ResourceCollection *ResourceCollection + // The severity of a reactive insight. Severity InsightSeverity + // The ID of the AWS System Manager OpsItem created for this insight. You must + // enable the creation of OpstItems insights before they are created for each + // insight. SsmOpsItemId *string + // The status of a reactive insight. Status InsightStatus } +// Information about a reactive insight. This object is returned by +// DescribeInsight. type ReactiveInsightSummary struct { + + // The ID of a reactive summary. Id *string + // A time ranged that specifies when the observed behavior in an insight started + // and ended. InsightTimeRange *InsightTimeRange + // The name of a reactive insight. Name *string + // A collection of AWS resources supported by DevOps Guru. The one type of AWS + // resource collection supported is AWS CloudFormation stacks. DevOps Guru can be + // configured to analyze only the AWS resources that are defined in the stacks. ResourceCollection *ResourceCollection + // The severity of a reactive insight. Severity InsightSeverity + // The status of a reactive insight. Status InsightStatus } +// Recommendation information to help you remediate detected anomalous behavior +// that generated an insight. type Recommendation struct { + + // A description of the problem. Description *string + // A hyperlink to information to help you address the problem. Link *string + // The name of the recommendation. Name *string + // The reason DevOps Guru flagged the anomalous behavior as a problem. Reason *string + // Anomalies that are related to the problem. Use these Anomalies to learn more + // about what's happening and to help address the issue. RelatedAnomalies []RecommendationRelatedAnomaly + // Events that are related to the problem. Use these events to learn more about + // what's happening and to help address the issue. RelatedEvents []RecommendationRelatedEvent } +// Information about an anomaly that is related to a recommendation. type RecommendationRelatedAnomaly struct { + + // An array of objects that represent resources in which DevOps Guru detected + // anomalous behavior. Each object contains the name and type of the resource. Resources []RecommendationRelatedAnomalyResource + // Information about where the anomalous behavior related the recommendation was + // found. For example, details in Amazon CloudWatch metrics. SourceDetails []RecommendationRelatedAnomalySourceDetail } +// Information about a resource in which DevOps Guru detected anomalous behavior. type RecommendationRelatedAnomalyResource struct { + + // The name of the resource. Name *string + // The type of the resource. Type *string } +// Contains an array of RecommendationRelatedCloudWatchMetricsSourceDetail objects +// that contain the name and namespace of an Amazon CloudWatch metric. type RecommendationRelatedAnomalySourceDetail struct { + + // An array of CloudWatchMetricsDetail objects that contains information about the + // analyzed metrics that displayed anomalous behavior. CloudWatchMetrics []RecommendationRelatedCloudWatchMetricsSourceDetail } +// Information about an Amazon CloudWatch metric that is analyzed by DevOps Guru. +// It is one of many analyzed metrics that are used to generate insights. type RecommendationRelatedCloudWatchMetricsSourceDetail struct { + + // The name of the CloudWatch metric. MetricName *string + // The namespace of the CloudWatch metric. A namespace is a container for + // CloudWatch metrics. Namespace *string } +// Information about an event that is related to a recommendation. type RecommendationRelatedEvent struct { + + // The name of the event. This corresponds to the Name field in an Event object. Name *string + // A ResourceCollection object that contains arrays of the names of AWS + // CloudFormation stacks. Resources []RecommendationRelatedEventResource } +// Information about an AWS resource that emitted and event that is related to a +// recommendation in an insight. type RecommendationRelatedEventResource struct { + + // The name of the resource that emitted the event. This corresponds to the Name + // field in an EventResource object. Name *string + // The type of the resource that emitted the event. This corresponds to the Type + // field in an EventResource object. Type *string } +// A collection of AWS resources supported by DevOps Guru. The one type of AWS +// resource collection supported is AWS CloudFormation stacks. DevOps Guru can be +// configured to analyze only the AWS resources that are defined in the stacks. type ResourceCollection struct { + + // An array of the names of AWS CloudFormation stacks. The stacks define AWS + // resources that DevOps Guru analyzes. CloudFormation *CloudFormationCollection } +// Information about a filter used to specify which AWS resources are analyzed for +// anomalous behavior by DevOps Guru. type ResourceCollectionFilter struct { + + // Information about AWS CloudFormation stacks. You can use stacks to specify which + // AWS resources in your account to analyze. For more information, see Stacks + // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/stacks.html) in + // the AWS CloudFormation User Guide. CloudFormation *CloudFormationCollectionFilter } +// Specifies one or more severity values and one or more status values that are +// used to search for insights. type SearchInsightsFilters struct { + + // A collection of AWS resources supported by DevOps Guru. The one type of AWS + // resource collection supported is AWS CloudFormation stacks. DevOps Guru can be + // configured to analyze only the AWS resources that are defined in the stacks. ResourceCollection *ResourceCollection + // An array of severity values used to search for insights. Severities []InsightSeverity + // An array of status values used to search for insights. Statuses []InsightStatus } +// Information about the integration of DevOps Guru with another AWS service, such +// as AWS Systems Manager. type ServiceIntegrationConfig struct { + + // Information about whether DevOps Guru is configured to create an OpsItem in AWS + // Systems Manager OpsCenter for each created insight. OpsCenter *OpsCenterIntegration } +// Contains the Amazon Resource Name (ARN) of an Amazon Simple Notification Service +// topic. If you use an Amazon SNS topic in another account, you must attach a +// policy to it that grants DevOps Guru permission to it notifications. DevOps Guru +// adds the required policy on your behalf to send notifications using Amazon SNS +// in your account. For more information, see Permissions for cross account Amazon +// SNS topics +// (https://docs.aws.amazon.com/devops-guru/latest/userguide/sns-required-permissions.html). +// If you use an Amazon SNS topic that is encrypted by an AWS Key Management +// Service customer-managed key (CMK), then you must add permissions to the CMK. +// For more information, see Permissions for AWS KMS–encrypted Amazon SNS topics +// (https://docs.aws.amazon.com/devops-guru/latest/userguide/sns-kms-permissions.html). type SnsChannelConfig struct { + + // The Amazon Resource Name (ARN) of an Amazon Simple Notification Service topic. TopicArn *string } +// A time range used to specify when the behavior of an insight or anomaly started. type StartTimeRange struct { + + // The start time of the time range. FromTime *time.Time + // The end time of the time range. ToTime *time.Time } +// Contains the names of AWS CloudFormation stacks used to update a collection of +// stacks. type UpdateCloudFormationCollectionFilter struct { + + // An array of the name of stacks to update. StackNames []string } +// Contains information used to update a collection of AWS resources. type UpdateResourceCollectionFilter struct { + + // An collection of AWS CloudFormation stacks. CloudFormation *UpdateCloudFormationCollectionFilter } +// Information about updating the integration status of an AWS service, such as AWS +// Systems Manager, with DevOps Guru. type UpdateServiceIntegrationConfig struct { + + // Information about whether DevOps Guru is configured to create an OpsItem in AWS + // Systems Manager OpsCenter for each created insight. OpsCenter *OpsCenterIntegrationConfig } +// The field associated with the validation exception. type ValidationExceptionField struct { + // The message associated with the validation exception with information to help + // determine its cause. + // // This member is required. Message *string + // The name of the field. + // // This member is required. Name *string } diff --git a/service/devopsguru/validators.go b/service/devopsguru/validators.go index 7d1425a7d89..7926b942fe2 100644 --- a/service/devopsguru/validators.go +++ b/service/devopsguru/validators.go @@ -386,12 +386,12 @@ func validateListInsightsAnyStatusFilter(v *types.ListInsightsAnyStatusFilter) e return nil } invalidParams := smithy.InvalidParamsError{Context: "ListInsightsAnyStatusFilter"} - if v.StartTimeRange == nil { - invalidParams.Add(smithy.NewErrParamRequired("StartTimeRange")) - } if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } + if v.StartTimeRange == nil { + invalidParams.Add(smithy.NewErrParamRequired("StartTimeRange")) + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -404,12 +404,12 @@ func validateListInsightsClosedStatusFilter(v *types.ListInsightsClosedStatusFil return nil } invalidParams := smithy.InvalidParamsError{Context: "ListInsightsClosedStatusFilter"} - if v.EndTimeRange == nil { - invalidParams.Add(smithy.NewErrParamRequired("EndTimeRange")) - } if len(v.Type) == 0 { invalidParams.Add(smithy.NewErrParamRequired("Type")) } + if v.EndTimeRange == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndTimeRange")) + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -437,9 +437,9 @@ func validateListInsightsStatusFilter(v *types.ListInsightsStatusFilter) error { return nil } invalidParams := smithy.InvalidParamsError{Context: "ListInsightsStatusFilter"} - if v.Any != nil { - if err := validateListInsightsAnyStatusFilter(v.Any); err != nil { - invalidParams.AddNested("Any", err.(smithy.InvalidParamsError)) + if v.Ongoing != nil { + if err := validateListInsightsOngoingStatusFilter(v.Ongoing); err != nil { + invalidParams.AddNested("Ongoing", err.(smithy.InvalidParamsError)) } } if v.Closed != nil { @@ -447,9 +447,9 @@ func validateListInsightsStatusFilter(v *types.ListInsightsStatusFilter) error { invalidParams.AddNested("Closed", err.(smithy.InvalidParamsError)) } } - if v.Ongoing != nil { - if err := validateListInsightsOngoingStatusFilter(v.Ongoing); err != nil { - invalidParams.AddNested("Ongoing", err.(smithy.InvalidParamsError)) + if v.Any != nil { + if err := validateListInsightsAnyStatusFilter(v.Any); err != nil { + invalidParams.AddNested("Any", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { @@ -543,7 +543,7 @@ func validateOpDescribeResourceCollectionHealthInput(v *DescribeResourceCollecti return nil } invalidParams := smithy.InvalidParamsError{Context: "DescribeResourceCollectionHealthInput"} - if v.ResourceCollectionType == nil { + if len(v.ResourceCollectionType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("ResourceCollectionType")) } if invalidParams.Len() > 0 { @@ -558,7 +558,7 @@ func validateOpGetResourceCollectionInput(v *GetResourceCollectionInput) error { return nil } invalidParams := smithy.InvalidParamsError{Context: "GetResourceCollectionInput"} - if v.ResourceCollectionType == nil { + if len(v.ResourceCollectionType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("ResourceCollectionType")) } if invalidParams.Len() > 0 { diff --git a/service/directconnect/types/enums.go b/service/directconnect/types/enums.go index 03ffc8d857c..c2b6c627df3 100644 --- a/service/directconnect/types/enums.go +++ b/service/directconnect/types/enums.go @@ -66,6 +66,19 @@ func (BGPStatus) Values() []BGPStatus { type ConnectionState string +// Enum values for ConnectionState +const ( + ConnectionStateOrdering ConnectionState = "ordering" + ConnectionStateRequested ConnectionState = "requested" + ConnectionStatePending ConnectionState = "pending" + ConnectionStateAvailable ConnectionState = "available" + ConnectionStateDown ConnectionState = "down" + ConnectionStateDeleting ConnectionState = "deleting" + ConnectionStateDeleted ConnectionState = "deleted" + ConnectionStateRejected ConnectionState = "rejected" + ConnectionStateUnknown ConnectionState = "unknown" +) + // Values returns all known values for ConnectionState. 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. @@ -85,6 +98,13 @@ func (ConnectionState) Values() []ConnectionState { type DirectConnectGatewayAssociationProposalState string +// Enum values for DirectConnectGatewayAssociationProposalState +const ( + DirectConnectGatewayAssociationProposalStateRequested DirectConnectGatewayAssociationProposalState = "requested" + DirectConnectGatewayAssociationProposalStateAccepted DirectConnectGatewayAssociationProposalState = "accepted" + DirectConnectGatewayAssociationProposalStateDeleted DirectConnectGatewayAssociationProposalState = "deleted" +) + // Values returns all known values for // DirectConnectGatewayAssociationProposalState. 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 @@ -99,6 +119,15 @@ func (DirectConnectGatewayAssociationProposalState) Values() []DirectConnectGate type DirectConnectGatewayAssociationState string +// Enum values for DirectConnectGatewayAssociationState +const ( + DirectConnectGatewayAssociationStateAssociating DirectConnectGatewayAssociationState = "associating" + DirectConnectGatewayAssociationStateAssociated DirectConnectGatewayAssociationState = "associated" + DirectConnectGatewayAssociationStateDisassociating DirectConnectGatewayAssociationState = "disassociating" + DirectConnectGatewayAssociationStateDisassociated DirectConnectGatewayAssociationState = "disassociated" + DirectConnectGatewayAssociationStateUpdating DirectConnectGatewayAssociationState = "updating" +) + // Values returns all known values for DirectConnectGatewayAssociationState. 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 @@ -115,6 +144,14 @@ func (DirectConnectGatewayAssociationState) Values() []DirectConnectGatewayAssoc type DirectConnectGatewayAttachmentState string +// Enum values for DirectConnectGatewayAttachmentState +const ( + DirectConnectGatewayAttachmentStateAttaching DirectConnectGatewayAttachmentState = "attaching" + DirectConnectGatewayAttachmentStateAttached DirectConnectGatewayAttachmentState = "attached" + DirectConnectGatewayAttachmentStateDetaching DirectConnectGatewayAttachmentState = "detaching" + DirectConnectGatewayAttachmentStateDetached DirectConnectGatewayAttachmentState = "detached" +) + // Values returns all known values for DirectConnectGatewayAttachmentState. 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 @@ -130,6 +167,12 @@ func (DirectConnectGatewayAttachmentState) Values() []DirectConnectGatewayAttach type DirectConnectGatewayAttachmentType string +// Enum values for DirectConnectGatewayAttachmentType +const ( + DirectConnectGatewayAttachmentTypeTransitvirtualinterface DirectConnectGatewayAttachmentType = "TransitVirtualInterface" + DirectConnectGatewayAttachmentTypePrivatevirtualinterface DirectConnectGatewayAttachmentType = "PrivateVirtualInterface" +) + // Values returns all known values for DirectConnectGatewayAttachmentType. 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 @@ -143,6 +186,14 @@ func (DirectConnectGatewayAttachmentType) Values() []DirectConnectGatewayAttachm type DirectConnectGatewayState string +// Enum values for DirectConnectGatewayState +const ( + DirectConnectGatewayStatePending DirectConnectGatewayState = "pending" + DirectConnectGatewayStateAvailable DirectConnectGatewayState = "available" + DirectConnectGatewayStateDeleting DirectConnectGatewayState = "deleting" + DirectConnectGatewayStateDeleted DirectConnectGatewayState = "deleted" +) + // Values returns all known values for DirectConnectGatewayState. 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. @@ -195,6 +246,17 @@ func (HasLogicalRedundancy) Values() []HasLogicalRedundancy { type InterconnectState string +// Enum values for InterconnectState +const ( + InterconnectStateRequested InterconnectState = "requested" + InterconnectStatePending InterconnectState = "pending" + InterconnectStateAvailable InterconnectState = "available" + InterconnectStateDown InterconnectState = "down" + InterconnectStateDeleting InterconnectState = "deleting" + InterconnectStateDeleted InterconnectState = "deleted" + InterconnectStateUnknown InterconnectState = "unknown" +) + // Values returns all known values for InterconnectState. 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. @@ -212,6 +274,17 @@ func (InterconnectState) Values() []InterconnectState { type LagState string +// Enum values for LagState +const ( + LagStateRequested LagState = "requested" + LagStatePending LagState = "pending" + LagStateAvailable LagState = "available" + LagStateDown LagState = "down" + LagStateDeleting LagState = "deleting" + LagStateDeleted LagState = "deleted" + LagStateUnknown LagState = "unknown" +) + // Values returns all known values for LagState. 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. @@ -245,6 +318,19 @@ func (LoaContentType) Values() []LoaContentType { type VirtualInterfaceState string +// Enum values for VirtualInterfaceState +const ( + VirtualInterfaceStateConfirming VirtualInterfaceState = "confirming" + VirtualInterfaceStateVerifying VirtualInterfaceState = "verifying" + VirtualInterfaceStatePending VirtualInterfaceState = "pending" + VirtualInterfaceStateAvailable VirtualInterfaceState = "available" + VirtualInterfaceStateDown VirtualInterfaceState = "down" + VirtualInterfaceStateDeleting VirtualInterfaceState = "deleting" + VirtualInterfaceStateDeleted VirtualInterfaceState = "deleted" + VirtualInterfaceStateRejected VirtualInterfaceState = "rejected" + VirtualInterfaceStateUnknown VirtualInterfaceState = "unknown" +) + // Values returns all known values for VirtualInterfaceState. 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. diff --git a/service/dlm/deserializers.go b/service/dlm/deserializers.go index 1de301b1897..2ab0e18d84e 100644 --- a/service/dlm/deserializers.go +++ b/service/dlm/deserializers.go @@ -1141,6 +1141,85 @@ func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp return output } +func awsRestjson1_deserializeDocumentAction(v **types.Action, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Action + if *v == nil { + sv = &types.Action{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CrossRegionCopy": + if err := awsRestjson1_deserializeDocumentCrossRegionCopyActionList(&sv.CrossRegionCopy, value); err != nil { + return err + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ActionName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentActionList(v *[]types.Action, 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.Action + if *v == nil { + cv = []types.Action{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Action + destAddr := &col + if err := awsRestjson1_deserializeDocumentAction(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentAvailabilityZoneList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -1244,6 +1323,90 @@ func awsRestjson1_deserializeDocumentCreateRule(v **types.CreateRule, value inte return nil } +func awsRestjson1_deserializeDocumentCrossRegionCopyAction(v **types.CrossRegionCopyAction, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CrossRegionCopyAction + if *v == nil { + sv = &types.CrossRegionCopyAction{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EncryptionConfiguration": + if err := awsRestjson1_deserializeDocumentEncryptionConfiguration(&sv.EncryptionConfiguration, value); err != nil { + return err + } + + case "RetainRule": + if err := awsRestjson1_deserializeDocumentCrossRegionCopyRetainRule(&sv.RetainRule, value); err != nil { + return err + } + + case "Target": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Target to be of type string, got %T instead", value) + } + sv.Target = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCrossRegionCopyActionList(v *[]types.CrossRegionCopyAction, 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.CrossRegionCopyAction + if *v == nil { + cv = []types.CrossRegionCopyAction{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CrossRegionCopyAction + destAddr := &col + if err := awsRestjson1_deserializeDocumentCrossRegionCopyAction(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentCrossRegionCopyRetainRule(v **types.CrossRegionCopyRetainRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -1403,6 +1566,154 @@ func awsRestjson1_deserializeDocumentCrossRegionCopyRules(v *[]types.CrossRegion return nil } +func awsRestjson1_deserializeDocumentEncryptionConfiguration(v **types.EncryptionConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EncryptionConfiguration + if *v == nil { + sv = &types.EncryptionConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CmkArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CmkArn to be of type string, got %T instead", value) + } + sv.CmkArn = ptr.String(jtv) + } + + case "Encrypted": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Encrypted to be of type *bool, got %T instead", value) + } + sv.Encrypted = jtv + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEventParameters(v **types.EventParameters, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EventParameters + if *v == nil { + sv = &types.EventParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DescriptionRegex": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DescriptionRegex to be of type string, got %T instead", value) + } + sv.DescriptionRegex = ptr.String(jtv) + } + + case "EventType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventTypeValues to be of type string, got %T instead", value) + } + sv.EventType = types.EventTypeValues(jtv) + } + + case "SnapshotOwner": + if err := awsRestjson1_deserializeDocumentSnapshotOwnerList(&sv.SnapshotOwner, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEventSource(v **types.EventSource, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EventSource + if *v == nil { + sv = &types.EventSource{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Parameters": + if err := awsRestjson1_deserializeDocumentEventParameters(&sv.Parameters, value); err != nil { + return err + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventSourceValues to be of type string, got %T instead", value) + } + sv.Type = types.EventSourceValues(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentFastRestoreRule(v **types.FastRestoreRule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -1974,6 +2285,16 @@ func awsRestjson1_deserializeDocumentPolicyDetails(v **types.PolicyDetails, valu for key, value := range shape { switch key { + case "Actions": + if err := awsRestjson1_deserializeDocumentActionList(&sv.Actions, value); err != nil { + return err + } + + case "EventSource": + if err := awsRestjson1_deserializeDocumentEventSource(&sv.EventSource, value); err != nil { + return err + } + case "Parameters": if err := awsRestjson1_deserializeDocumentParameters(&sv.Parameters, value); err != nil { return err @@ -2273,6 +2594,11 @@ func awsRestjson1_deserializeDocumentSchedule(v **types.Schedule, value interfac return err } + case "ShareRules": + if err := awsRestjson1_deserializeDocumentShareRules(&sv.ShareRules, value); err != nil { + return err + } + case "TagsToAdd": if err := awsRestjson1_deserializeDocumentTagsToAddList(&sv.TagsToAdd, value); err != nil { return err @@ -2326,6 +2652,170 @@ func awsRestjson1_deserializeDocumentScheduleList(v *[]types.Schedule, value int return nil } +func awsRestjson1_deserializeDocumentShareRule(v **types.ShareRule, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ShareRule + if *v == nil { + sv = &types.ShareRule{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "TargetAccounts": + if err := awsRestjson1_deserializeDocumentShareTargetAccountList(&sv.TargetAccounts, value); err != nil { + return err + } + + case "UnshareInterval": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Interval to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.UnshareInterval = int32(i64) + } + + case "UnshareIntervalUnit": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RetentionIntervalUnitValues to be of type string, got %T instead", value) + } + sv.UnshareIntervalUnit = types.RetentionIntervalUnitValues(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentShareRules(v *[]types.ShareRule, 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.ShareRule + if *v == nil { + cv = []types.ShareRule{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ShareRule + destAddr := &col + if err := awsRestjson1_deserializeDocumentShareRule(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentShareTargetAccountList(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 AwsAccountId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSnapshotOwnerList(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 AwsAccountId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentTag(v **types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/dlm/serializers.go b/service/dlm/serializers.go index f127e73d50d..ab90f24facc 100644 --- a/service/dlm/serializers.go +++ b/service/dlm/serializers.go @@ -642,6 +642,38 @@ func awsRestjson1_serializeOpDocumentUpdateLifecyclePolicyInput(v *UpdateLifecyc return nil } +func awsRestjson1_serializeDocumentAction(v *types.Action, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CrossRegionCopy != nil { + ok := object.Key("CrossRegionCopy") + if err := awsRestjson1_serializeDocumentCrossRegionCopyActionList(v.CrossRegionCopy, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + return nil +} + +func awsRestjson1_serializeDocumentActionList(v []types.Action, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAction(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentAvailabilityZoneList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -682,6 +714,45 @@ func awsRestjson1_serializeDocumentCreateRule(v *types.CreateRule, value smithyj return nil } +func awsRestjson1_serializeDocumentCrossRegionCopyAction(v *types.CrossRegionCopyAction, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EncryptionConfiguration != nil { + ok := object.Key("EncryptionConfiguration") + if err := awsRestjson1_serializeDocumentEncryptionConfiguration(v.EncryptionConfiguration, ok); err != nil { + return err + } + } + + if v.RetainRule != nil { + ok := object.Key("RetainRule") + if err := awsRestjson1_serializeDocumentCrossRegionCopyRetainRule(v.RetainRule, ok); err != nil { + return err + } + } + + if v.Target != nil { + ok := object.Key("Target") + ok.String(*v.Target) + } + + return nil +} + +func awsRestjson1_serializeDocumentCrossRegionCopyActionList(v []types.CrossRegionCopyAction, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCrossRegionCopyAction(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentCrossRegionCopyRetainRule(v *types.CrossRegionCopyRetainRule, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -746,6 +817,66 @@ func awsRestjson1_serializeDocumentCrossRegionCopyRules(v []types.CrossRegionCop return nil } +func awsRestjson1_serializeDocumentEncryptionConfiguration(v *types.EncryptionConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CmkArn != nil { + ok := object.Key("CmkArn") + ok.String(*v.CmkArn) + } + + if v.Encrypted { + ok := object.Key("Encrypted") + ok.Boolean(v.Encrypted) + } + + return nil +} + +func awsRestjson1_serializeDocumentEventParameters(v *types.EventParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DescriptionRegex != nil { + ok := object.Key("DescriptionRegex") + ok.String(*v.DescriptionRegex) + } + + if len(v.EventType) > 0 { + ok := object.Key("EventType") + ok.String(string(v.EventType)) + } + + if v.SnapshotOwner != nil { + ok := object.Key("SnapshotOwner") + if err := awsRestjson1_serializeDocumentSnapshotOwnerList(v.SnapshotOwner, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentEventSource(v *types.EventSource, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Parameters != nil { + ok := object.Key("Parameters") + if err := awsRestjson1_serializeDocumentEventParameters(v.Parameters, ok); err != nil { + return err + } + } + + if len(v.Type) > 0 { + ok := object.Key("Type") + ok.String(string(v.Type)) + } + + return nil +} + func awsRestjson1_serializeDocumentFastRestoreRule(v *types.FastRestoreRule, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -796,6 +927,20 @@ func awsRestjson1_serializeDocumentPolicyDetails(v *types.PolicyDetails, value s object := value.Object() defer object.Close() + if v.Actions != nil { + ok := object.Key("Actions") + if err := awsRestjson1_serializeDocumentActionList(v.Actions, ok); err != nil { + return err + } + } + + if v.EventSource != nil { + ok := object.Key("EventSource") + if err := awsRestjson1_serializeDocumentEventSource(v.EventSource, ok); err != nil { + return err + } + } + if v.Parameters != nil { ok := object.Key("Parameters") if err := awsRestjson1_serializeDocumentParameters(v.Parameters, ok); err != nil { @@ -907,6 +1052,13 @@ func awsRestjson1_serializeDocumentSchedule(v *types.Schedule, value smithyjson. } } + if v.ShareRules != nil { + ok := object.Key("ShareRules") + if err := awsRestjson1_serializeDocumentShareRules(v.ShareRules, ok); err != nil { + return err + } + } + if v.TagsToAdd != nil { ok := object.Key("TagsToAdd") if err := awsRestjson1_serializeDocumentTagsToAddList(v.TagsToAdd, ok); err != nil { @@ -937,6 +1089,65 @@ func awsRestjson1_serializeDocumentScheduleList(v []types.Schedule, value smithy return nil } +func awsRestjson1_serializeDocumentShareRule(v *types.ShareRule, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TargetAccounts != nil { + ok := object.Key("TargetAccounts") + if err := awsRestjson1_serializeDocumentShareTargetAccountList(v.TargetAccounts, ok); err != nil { + return err + } + } + + if v.UnshareInterval != 0 { + ok := object.Key("UnshareInterval") + ok.Integer(v.UnshareInterval) + } + + if len(v.UnshareIntervalUnit) > 0 { + ok := object.Key("UnshareIntervalUnit") + ok.String(string(v.UnshareIntervalUnit)) + } + + return nil +} + +func awsRestjson1_serializeDocumentShareRules(v []types.ShareRule, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentShareRule(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentShareTargetAccountList(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_serializeDocumentSnapshotOwnerList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsRestjson1_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/dlm/types/enums.go b/service/dlm/types/enums.go index 4680181cdbc..431f04325f4 100644 --- a/service/dlm/types/enums.go +++ b/service/dlm/types/enums.go @@ -2,6 +2,38 @@ package types +type EventSourceValues string + +// Enum values for EventSourceValues +const ( + EventSourceValuesManagedCwe EventSourceValues = "MANAGED_CWE" +) + +// Values returns all known values for EventSourceValues. 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 (EventSourceValues) Values() []EventSourceValues { + return []EventSourceValues{ + "MANAGED_CWE", + } +} + +type EventTypeValues string + +// Enum values for EventTypeValues +const ( + EventTypeValuesSharesnapshot EventTypeValues = "shareSnapshot" +) + +// Values returns all known values for EventTypeValues. 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 (EventTypeValues) Values() []EventTypeValues { + return []EventTypeValues{ + "shareSnapshot", + } +} + type GettablePolicyStateValues string // Enum values for GettablePolicyStateValues @@ -44,6 +76,7 @@ type PolicyTypeValues string const ( PolicyTypeValuesEbsSnapshotManagement PolicyTypeValues = "EBS_SNAPSHOT_MANAGEMENT" PolicyTypeValuesImageManagement PolicyTypeValues = "IMAGE_MANAGEMENT" + PolicyTypeValuesEventBasedPolicy PolicyTypeValues = "EVENT_BASED_POLICY" ) // Values returns all known values for PolicyTypeValues. Note that this can be @@ -53,6 +86,7 @@ func (PolicyTypeValues) Values() []PolicyTypeValues { return []PolicyTypeValues{ "EBS_SNAPSHOT_MANAGEMENT", "IMAGE_MANAGEMENT", + "EVENT_BASED_POLICY", } } diff --git a/service/dlm/types/types.go b/service/dlm/types/types.go index 1752a1ff14e..1c5e81568ff 100644 --- a/service/dlm/types/types.go +++ b/service/dlm/types/types.go @@ -6,6 +6,20 @@ import ( "time" ) +// Specifies an action for an event-based policy. +type Action struct { + + // The rule for copying shared snapshots across Regions. + // + // This member is required. + CrossRegionCopy []CrossRegionCopyAction + + // A descriptive name for the action. + // + // This member is required. + Name *string +} + // Specifies when to create snapshots of EBS volumes. You must specify either a // Cron expression or an interval, interval unit, and start time. You cannot // specify both. @@ -30,6 +44,23 @@ type CreateRule struct { Times []string } +// Specifies a rule for copying shared snapshots across Regions. +type CrossRegionCopyAction struct { + + // The encryption settings for the copied snapshot. + // + // This member is required. + EncryptionConfiguration *EncryptionConfiguration + + // The target Region. + // + // This member is required. + Target *string + + // Specifies the retention rule for cross-Region snapshot copies. + RetainRule *CrossRegionCopyRetainRule +} + // Specifies the retention rule for cross-Region snapshot copies. type CrossRegionCopyRetainRule struct { @@ -69,6 +100,63 @@ type CrossRegionCopyRule struct { RetainRule *CrossRegionCopyRetainRule } +// Specifies the encryption settings for shared snapshots that are copied across +// Regions. +type EncryptionConfiguration struct { + + // To encrypt a copy of an unencrypted snapshot when encryption by default is not + // enabled, enable encryption using this parameter. Copies of encrypted snapshots + // are encrypted, even if this parameter is false or when encryption by default is + // not enabled. + // + // This member is required. + Encrypted bool + + // The Amazon Resource Name (ARN) of the AWS KMS customer master key (CMK) to use + // for EBS encryption. If this parameter is not specified, your AWS managed CMK for + // EBS is used. + CmkArn *string +} + +// Specifies an event that triggers an event-based policy. +type EventParameters struct { + + // The snapshot description that can trigger the policy. The description pattern is + // specified using a regular expression. The policy runs only if a snapshot with a + // description that matches the specified pattern is shared with your account. For + // example, specifying ^.*Created for policy: policy-1234567890abcdef0.*$ + // configures the policy to run only if snapshots created by policy + // policy-1234567890abcdef0 are shared with your account. + // + // This member is required. + DescriptionRegex *string + + // The type of event. Currently, only snapshot sharing events are supported. + // + // This member is required. + EventType EventTypeValues + + // The IDs of the AWS accounts that can trigger policy by sharing snapshots with + // your account. The policy only runs if one of the specified AWS accounts shares a + // snapshot with your account. + // + // This member is required. + SnapshotOwner []string +} + +// Specifies an event that triggers an event-based policy. +type EventSource struct { + + // The source of the event. Currently only managed AWS CloudWatch Events rules are + // supported. + // + // This member is required. + Type EventSourceValues + + // Information about the event. + Parameters *EventParameters +} + // Specifies a rule for enabling fast snapshot restore. You can enable fast // snapshot restore based on either a count or a time interval. type FastRestoreRule struct { @@ -158,32 +246,53 @@ type Parameters struct { // Applies to AMI lifecycle policies only. Indicates whether targeted instances are // rebooted when the lifecycle policy runs. true indicates that targeted instances // are not rebooted when the policy runs. false indicates that target instances are - // rebooted when the policy runs. The default is true (instance are not rebooted). + // rebooted when the policy runs. The default is true (instances are not rebooted). NoReboot bool } // Specifies the configuration of a lifecycle policy. type PolicyDetails struct { - // A set of optional parameters for the policy. + // The actions to be performed when the event-based policy is triggered. You can + // specify only one action per policy. This parameter is required for event-based + // policies only. If you are creating a snapshot or AMI policy, omit this + // parameter. + Actions []Action + + // The event that triggers the event-based policy. This parameter is required for + // event-based policies only. If you are creating a snapshot or AMI policy, omit + // this parameter. + EventSource *EventSource + + // A set of optional parameters for snapshot and AMI lifecycle policies. This + // parameter is required for snapshot and AMI policies only. If you are creating an + // event-based policy, omit this parameter. Parameters *Parameters // The valid target resource types and actions a policy can manage. Specify // EBS_SNAPSHOT_MANAGEMENT to create a lifecycle policy that manages the lifecycle // of Amazon EBS snapshots. Specify IMAGE_MANAGEMENT to create a lifecycle policy - // that manages the lifecycle of EBS-backed AMIs. The default is - // EBS_SNAPSHOT_MANAGEMENT. + // that manages the lifecycle of EBS-backed AMIs. Specify EVENT_BASED_POLICY to + // create an event-based policy that performs specific actions when a defined event + // occurs in your AWS account. The default is EBS_SNAPSHOT_MANAGEMENT. PolicyType PolicyTypeValues - // The resource type. Use VOLUME to create snapshots of individual volumes or use - // INSTANCE to create multi-volume snapshots from the volumes for an instance. + // The target resource type for snapshot and AMI lifecycle policies. Use VOLUME to + // create snapshots of individual volumes or use INSTANCE to create multi-volume + // snapshots from the volumes for an instance. This parameter is required for + // snapshot and AMI policies only. If you are creating an event-based policy, omit + // this parameter. ResourceTypes []ResourceTypeValues - // The schedules of policy-defined actions. A policy can have up to four schedules - // - one mandatory schedule and up to three optional schedules. + // The schedules of policy-defined actions for snapshot and AMI lifecycle policies. + // A policy can have up to four schedules—one mandatory schedule and up to three + // optional schedules. This parameter is required for snapshot and AMI policies + // only. If you are creating an event-based policy, omit this parameter. Schedules []Schedule - // The single tag that identifies targeted resources for this policy. + // The single tag that identifies targeted resources for this policy. This + // parameter is required for snapshot and AMI policies only. If you are creating an + // event-based policy, omit this parameter. TargetTags []Tag } @@ -202,7 +311,7 @@ type RetainRule struct { IntervalUnit RetentionIntervalUnitValues } -// Specifies a backup schedule. +// Specifies a backup schedule for a snapshot or AMI lifecycle policy. type Schedule struct { // Copy all user-defined tags on a source volume to snapshots of the volume created @@ -224,6 +333,9 @@ type Schedule struct { // The retention rule. RetainRule *RetainRule + // The rule for sharing snapshots with other AWS accounts. + ShareRules []ShareRule + // The tags to apply to policy-created resources. These user-defined tags are in // addition to the AWS-added lifecycle tags. TagsToAdd []Tag @@ -235,6 +347,22 @@ type Schedule struct { VariableTags []Tag } +// Specifies a rule for sharing snapshots across AWS accounts. +type ShareRule struct { + + // The IDs of the AWS accounts with which to share the snapshots. + // + // This member is required. + TargetAccounts []string + + // The period after which snapshots that are shared with other AWS accounts are + // automatically unshared. + UnshareInterval int32 + + // The unit of time for the automatic unsharing interval. + UnshareIntervalUnit RetentionIntervalUnitValues +} + // Specifies a tag for a resource. type Tag struct { diff --git a/service/dlm/validators.go b/service/dlm/validators.go index 69b867c2771..cd5b58479e1 100644 --- a/service/dlm/validators.go +++ b/service/dlm/validators.go @@ -178,6 +178,84 @@ func addOpUpdateLifecyclePolicyValidationMiddleware(stack *middleware.Stack) err return stack.Initialize.Add(&validateOpUpdateLifecyclePolicy{}, middleware.After) } +func validateAction(v *types.Action) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Action"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.CrossRegionCopy == nil { + invalidParams.Add(smithy.NewErrParamRequired("CrossRegionCopy")) + } else if v.CrossRegionCopy != nil { + if err := validateCrossRegionCopyActionList(v.CrossRegionCopy); err != nil { + invalidParams.AddNested("CrossRegionCopy", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateActionList(v []types.Action) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ActionList"} + for i := range v { + if err := validateAction(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCrossRegionCopyAction(v *types.CrossRegionCopyAction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CrossRegionCopyAction"} + if v.Target == nil { + invalidParams.Add(smithy.NewErrParamRequired("Target")) + } + if v.EncryptionConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("EncryptionConfiguration")) + } else if v.EncryptionConfiguration != nil { + if err := validateEncryptionConfiguration(v.EncryptionConfiguration); err != nil { + invalidParams.AddNested("EncryptionConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCrossRegionCopyActionList(v []types.CrossRegionCopyAction) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CrossRegionCopyActionList"} + for i := range v { + if err := validateCrossRegionCopyAction(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateCrossRegionCopyRule(v *types.CrossRegionCopyRule) error { if v == nil { return nil @@ -210,6 +288,59 @@ func validateCrossRegionCopyRules(v []types.CrossRegionCopyRule) error { } } +func validateEncryptionConfiguration(v *types.EncryptionConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EncryptionConfiguration"} + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEventParameters(v *types.EventParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EventParameters"} + if len(v.EventType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("EventType")) + } + if v.SnapshotOwner == nil { + invalidParams.Add(smithy.NewErrParamRequired("SnapshotOwner")) + } + if v.DescriptionRegex == nil { + invalidParams.Add(smithy.NewErrParamRequired("DescriptionRegex")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEventSource(v *types.EventSource) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EventSource"} + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.Parameters != nil { + if err := validateEventParameters(v.Parameters); err != nil { + invalidParams.AddNested("Parameters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateFastRestoreRule(v *types.FastRestoreRule) error { if v == nil { return nil @@ -240,6 +371,16 @@ func validatePolicyDetails(v *types.PolicyDetails) error { invalidParams.AddNested("Schedules", err.(smithy.InvalidParamsError)) } } + if v.EventSource != nil { + if err := validateEventSource(v.EventSource); err != nil { + invalidParams.AddNested("EventSource", err.(smithy.InvalidParamsError)) + } + } + if v.Actions != nil { + if err := validateActionList(v.Actions); err != nil { + invalidParams.AddNested("Actions", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -272,6 +413,11 @@ func validateSchedule(v *types.Schedule) error { invalidParams.AddNested("CrossRegionCopyRules", err.(smithy.InvalidParamsError)) } } + if v.ShareRules != nil { + if err := validateShareRules(v.ShareRules); err != nil { + invalidParams.AddNested("ShareRules", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -296,6 +442,38 @@ func validateScheduleList(v []types.Schedule) error { } } +func validateShareRule(v *types.ShareRule) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ShareRule"} + if v.TargetAccounts == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetAccounts")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateShareRules(v []types.ShareRule) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ShareRules"} + for i := range v { + if err := validateShareRule(&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 diff --git a/service/docdb/types/enums.go b/service/docdb/types/enums.go index 646c5ec14c9..91e91f9f84c 100644 --- a/service/docdb/types/enums.go +++ b/service/docdb/types/enums.go @@ -4,6 +4,12 @@ package types type ApplyMethod string +// Enum values for ApplyMethod +const ( + ApplyMethodImmediate ApplyMethod = "immediate" + ApplyMethodPendingReboot ApplyMethod = "pending-reboot" +) + // Values returns all known values for ApplyMethod. 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. @@ -16,6 +22,16 @@ func (ApplyMethod) Values() []ApplyMethod { type SourceType string +// Enum values for SourceType +const ( + SourceTypeDbInstance SourceType = "db-instance" + SourceTypeDbParameterGroup SourceType = "db-parameter-group" + SourceTypeDbSecurityGroup SourceType = "db-security-group" + SourceTypeDbSnapshot SourceType = "db-snapshot" + SourceTypeDbCluster SourceType = "db-cluster" + SourceTypeDbClusterSnapshot SourceType = "db-cluster-snapshot" +) + // Values returns all known values for SourceType. 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. diff --git a/service/dynamodb/types/enums.go b/service/dynamodb/types/enums.go index 09893241c39..029bcb69371 100644 --- a/service/dynamodb/types/enums.go +++ b/service/dynamodb/types/enums.go @@ -4,6 +4,13 @@ package types type AttributeAction string +// Enum values for AttributeAction +const ( + AttributeActionAdd AttributeAction = "ADD" + AttributeActionPut AttributeAction = "PUT" + AttributeActionDelete AttributeAction = "DELETE" +) + // Values returns all known values for AttributeAction. 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. @@ -17,6 +24,13 @@ func (AttributeAction) Values() []AttributeAction { type BackupStatus string +// Enum values for BackupStatus +const ( + BackupStatusCreating BackupStatus = "CREATING" + BackupStatusDeleted BackupStatus = "DELETED" + BackupStatusAvailable BackupStatus = "AVAILABLE" +) + // Values returns all known values for BackupStatus. 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. @@ -108,6 +122,12 @@ func (BatchStatementErrorCodeEnum) Values() []BatchStatementErrorCodeEnum { type BillingMode string +// Enum values for BillingMode +const ( + BillingModeProvisioned BillingMode = "PROVISIONED" + BillingModePayPerRequest BillingMode = "PAY_PER_REQUEST" +) + // Values returns all known values for BillingMode. 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. @@ -120,6 +140,23 @@ func (BillingMode) Values() []BillingMode { type ComparisonOperator string +// Enum values for ComparisonOperator +const ( + ComparisonOperatorEq ComparisonOperator = "EQ" + ComparisonOperatorNe ComparisonOperator = "NE" + ComparisonOperatorIn ComparisonOperator = "IN" + ComparisonOperatorLe ComparisonOperator = "LE" + ComparisonOperatorLt ComparisonOperator = "LT" + ComparisonOperatorGe ComparisonOperator = "GE" + ComparisonOperatorGt ComparisonOperator = "GT" + ComparisonOperatorBetween ComparisonOperator = "BETWEEN" + ComparisonOperatorNotNull ComparisonOperator = "NOT_NULL" + ComparisonOperatorNull ComparisonOperator = "NULL" + ComparisonOperatorContains ComparisonOperator = "CONTAINS" + ComparisonOperatorNotContains ComparisonOperator = "NOT_CONTAINS" + ComparisonOperatorBeginsWith ComparisonOperator = "BEGINS_WITH" +) + // Values returns all known values for ComparisonOperator. 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. @@ -143,6 +180,12 @@ func (ComparisonOperator) Values() []ComparisonOperator { type ConditionalOperator string +// Enum values for ConditionalOperator +const ( + ConditionalOperatorAnd ConditionalOperator = "AND" + ConditionalOperatorOr ConditionalOperator = "OR" +) + // Values returns all known values for ConditionalOperator. 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. @@ -155,6 +198,12 @@ func (ConditionalOperator) Values() []ConditionalOperator { type ContinuousBackupsStatus string +// Enum values for ContinuousBackupsStatus +const ( + ContinuousBackupsStatusEnabled ContinuousBackupsStatus = "ENABLED" + ContinuousBackupsStatusDisabled ContinuousBackupsStatus = "DISABLED" +) + // Values returns all known values for ContinuousBackupsStatus. 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. @@ -167,6 +216,12 @@ func (ContinuousBackupsStatus) Values() []ContinuousBackupsStatus { type ContributorInsightsAction string +// Enum values for ContributorInsightsAction +const ( + ContributorInsightsActionEnable ContributorInsightsAction = "ENABLE" + ContributorInsightsActionDisable ContributorInsightsAction = "DISABLE" +) + // Values returns all known values for ContributorInsightsAction. 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. @@ -179,6 +234,15 @@ func (ContributorInsightsAction) Values() []ContributorInsightsAction { type ContributorInsightsStatus string +// Enum values for ContributorInsightsStatus +const ( + ContributorInsightsStatusEnabling ContributorInsightsStatus = "ENABLING" + ContributorInsightsStatusEnabled ContributorInsightsStatus = "ENABLED" + ContributorInsightsStatusDisabling ContributorInsightsStatus = "DISABLING" + ContributorInsightsStatusDisabled ContributorInsightsStatus = "DISABLED" + ContributorInsightsStatusFailed ContributorInsightsStatus = "FAILED" +) + // Values returns all known values for ContributorInsightsStatus. 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. @@ -194,6 +258,15 @@ func (ContributorInsightsStatus) Values() []ContributorInsightsStatus { type DestinationStatus string +// Enum values for DestinationStatus +const ( + DestinationStatusEnabling DestinationStatus = "ENABLING" + DestinationStatusActive DestinationStatus = "ACTIVE" + DestinationStatusDisabling DestinationStatus = "DISABLING" + DestinationStatusDisabled DestinationStatus = "DISABLED" + DestinationStatusEnableFailed DestinationStatus = "ENABLE_FAILED" +) + // Values returns all known values for DestinationStatus. 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. @@ -247,6 +320,14 @@ func (ExportStatus) Values() []ExportStatus { type GlobalTableStatus string +// Enum values for GlobalTableStatus +const ( + GlobalTableStatusCreating GlobalTableStatus = "CREATING" + GlobalTableStatusActive GlobalTableStatus = "ACTIVE" + GlobalTableStatusDeleting GlobalTableStatus = "DELETING" + GlobalTableStatusUpdating GlobalTableStatus = "UPDATING" +) + // Values returns all known values for GlobalTableStatus. 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. @@ -261,6 +342,14 @@ func (GlobalTableStatus) Values() []GlobalTableStatus { type IndexStatus string +// Enum values for IndexStatus +const ( + IndexStatusCreating IndexStatus = "CREATING" + IndexStatusUpdating IndexStatus = "UPDATING" + IndexStatusDeleting IndexStatus = "DELETING" + IndexStatusActive IndexStatus = "ACTIVE" +) + // Values returns all known values for IndexStatus. 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. @@ -275,6 +364,12 @@ func (IndexStatus) Values() []IndexStatus { type KeyType string +// Enum values for KeyType +const ( + KeyTypeHash KeyType = "HASH" + KeyTypeRange KeyType = "RANGE" +) + // Values returns all known values for KeyType. 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. @@ -287,6 +382,12 @@ func (KeyType) Values() []KeyType { type PointInTimeRecoveryStatus string +// Enum values for PointInTimeRecoveryStatus +const ( + PointInTimeRecoveryStatusEnabled PointInTimeRecoveryStatus = "ENABLED" + PointInTimeRecoveryStatusDisabled PointInTimeRecoveryStatus = "DISABLED" +) + // Values returns all known values for PointInTimeRecoveryStatus. 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. @@ -299,6 +400,13 @@ func (PointInTimeRecoveryStatus) Values() []PointInTimeRecoveryStatus { type ProjectionType string +// Enum values for ProjectionType +const ( + ProjectionTypeAll ProjectionType = "ALL" + ProjectionTypeKeysOnly ProjectionType = "KEYS_ONLY" + ProjectionTypeInclude ProjectionType = "INCLUDE" +) + // Values returns all known values for ProjectionType. 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. @@ -312,6 +420,17 @@ func (ProjectionType) Values() []ProjectionType { type ReplicaStatus string +// Enum values for ReplicaStatus +const ( + ReplicaStatusCreating ReplicaStatus = "CREATING" + ReplicaStatusCreationFailed ReplicaStatus = "CREATION_FAILED" + ReplicaStatusUpdating ReplicaStatus = "UPDATING" + ReplicaStatusDeleting ReplicaStatus = "DELETING" + ReplicaStatusActive ReplicaStatus = "ACTIVE" + ReplicaStatusRegionDisabled ReplicaStatus = "REGION_DISABLED" + ReplicaStatusInaccessibleEncryptionCredentials ReplicaStatus = "INACCESSIBLE_ENCRYPTION_CREDENTIALS" +) + // Values returns all known values for ReplicaStatus. 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. @@ -329,6 +448,13 @@ func (ReplicaStatus) Values() []ReplicaStatus { type ReturnConsumedCapacity string +// Enum values for ReturnConsumedCapacity +const ( + ReturnConsumedCapacityIndexes ReturnConsumedCapacity = "INDEXES" + ReturnConsumedCapacityTotal ReturnConsumedCapacity = "TOTAL" + ReturnConsumedCapacityNone ReturnConsumedCapacity = "NONE" +) + // Values returns all known values for ReturnConsumedCapacity. 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. @@ -342,6 +468,12 @@ func (ReturnConsumedCapacity) Values() []ReturnConsumedCapacity { type ReturnItemCollectionMetrics string +// Enum values for ReturnItemCollectionMetrics +const ( + ReturnItemCollectionMetricsSize ReturnItemCollectionMetrics = "SIZE" + ReturnItemCollectionMetricsNone ReturnItemCollectionMetrics = "NONE" +) + // Values returns all known values for ReturnItemCollectionMetrics. 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. @@ -354,6 +486,15 @@ func (ReturnItemCollectionMetrics) Values() []ReturnItemCollectionMetrics { type ReturnValue string +// Enum values for ReturnValue +const ( + ReturnValueNone ReturnValue = "NONE" + ReturnValueAllOld ReturnValue = "ALL_OLD" + ReturnValueUpdatedOld ReturnValue = "UPDATED_OLD" + ReturnValueAllNew ReturnValue = "ALL_NEW" + ReturnValueUpdatedNew ReturnValue = "UPDATED_NEW" +) + // Values returns all known values for ReturnValue. 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. @@ -369,6 +510,12 @@ func (ReturnValue) Values() []ReturnValue { type ReturnValuesOnConditionCheckFailure string +// Enum values for ReturnValuesOnConditionCheckFailure +const ( + ReturnValuesOnConditionCheckFailureAllOld ReturnValuesOnConditionCheckFailure = "ALL_OLD" + ReturnValuesOnConditionCheckFailureNone ReturnValuesOnConditionCheckFailure = "NONE" +) + // Values returns all known values for ReturnValuesOnConditionCheckFailure. 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 @@ -382,6 +529,12 @@ func (ReturnValuesOnConditionCheckFailure) Values() []ReturnValuesOnConditionChe type S3SseAlgorithm string +// Enum values for S3SseAlgorithm +const ( + S3SseAlgorithmAes256 S3SseAlgorithm = "AES256" + S3SseAlgorithmKms S3SseAlgorithm = "KMS" +) + // Values returns all known values for S3SseAlgorithm. 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. @@ -394,6 +547,13 @@ func (S3SseAlgorithm) Values() []S3SseAlgorithm { type ScalarAttributeType string +// Enum values for ScalarAttributeType +const ( + ScalarAttributeTypeS ScalarAttributeType = "S" + ScalarAttributeTypeN ScalarAttributeType = "N" + ScalarAttributeTypeB ScalarAttributeType = "B" +) + // Values returns all known values for ScalarAttributeType. 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. @@ -407,6 +567,14 @@ func (ScalarAttributeType) Values() []ScalarAttributeType { type Select string +// Enum values for Select +const ( + SelectAllAttributes Select = "ALL_ATTRIBUTES" + SelectAllProjectedAttributes Select = "ALL_PROJECTED_ATTRIBUTES" + SelectSpecificAttributes Select = "SPECIFIC_ATTRIBUTES" + SelectCount Select = "COUNT" +) + // Values returns all known values for Select. 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. @@ -421,6 +589,15 @@ func (Select) Values() []Select { type SSEStatus string +// Enum values for SSEStatus +const ( + SSEStatusEnabling SSEStatus = "ENABLING" + SSEStatusEnabled SSEStatus = "ENABLED" + SSEStatusDisabling SSEStatus = "DISABLING" + SSEStatusDisabled SSEStatus = "DISABLED" + SSEStatusUpdating SSEStatus = "UPDATING" +) + // Values returns all known values for SSEStatus. 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. @@ -436,6 +613,12 @@ func (SSEStatus) Values() []SSEStatus { type SSEType string +// Enum values for SSEType +const ( + SSETypeAes256 SSEType = "AES256" + SSETypeKms SSEType = "KMS" +) + // Values returns all known values for SSEType. 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. @@ -448,6 +631,14 @@ func (SSEType) Values() []SSEType { type StreamViewType string +// Enum values for StreamViewType +const ( + StreamViewTypeNewImage StreamViewType = "NEW_IMAGE" + StreamViewTypeOldImage StreamViewType = "OLD_IMAGE" + StreamViewTypeNewAndOldImages StreamViewType = "NEW_AND_OLD_IMAGES" + StreamViewTypeKeysOnly StreamViewType = "KEYS_ONLY" +) + // Values returns all known values for StreamViewType. 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. @@ -462,6 +653,17 @@ func (StreamViewType) Values() []StreamViewType { type TableStatus string +// Enum values for TableStatus +const ( + TableStatusCreating TableStatus = "CREATING" + TableStatusUpdating TableStatus = "UPDATING" + TableStatusDeleting TableStatus = "DELETING" + TableStatusActive TableStatus = "ACTIVE" + TableStatusInaccessibleEncryptionCredentials TableStatus = "INACCESSIBLE_ENCRYPTION_CREDENTIALS" + TableStatusArchiving TableStatus = "ARCHIVING" + TableStatusArchived TableStatus = "ARCHIVED" +) + // Values returns all known values for TableStatus. 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. @@ -479,6 +681,14 @@ func (TableStatus) Values() []TableStatus { type TimeToLiveStatus string +// Enum values for TimeToLiveStatus +const ( + TimeToLiveStatusEnabling TimeToLiveStatus = "ENABLING" + TimeToLiveStatusDisabling TimeToLiveStatus = "DISABLING" + TimeToLiveStatusEnabled TimeToLiveStatus = "ENABLED" + TimeToLiveStatusDisabled TimeToLiveStatus = "DISABLED" +) + // Values returns all known values for TimeToLiveStatus. 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. diff --git a/service/dynamodbstreams/types/enums.go b/service/dynamodbstreams/types/enums.go index 7574fee6812..02d35c61637 100644 --- a/service/dynamodbstreams/types/enums.go +++ b/service/dynamodbstreams/types/enums.go @@ -4,6 +4,12 @@ package types type KeyType string +// Enum values for KeyType +const ( + KeyTypeHash KeyType = "HASH" + KeyTypeRange KeyType = "RANGE" +) + // Values returns all known values for KeyType. 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. @@ -16,6 +22,13 @@ func (KeyType) Values() []KeyType { type OperationType string +// Enum values for OperationType +const ( + OperationTypeInsert OperationType = "INSERT" + OperationTypeModify OperationType = "MODIFY" + OperationTypeRemove OperationType = "REMOVE" +) + // Values returns all known values for OperationType. 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. @@ -29,6 +42,14 @@ func (OperationType) Values() []OperationType { type ShardIteratorType string +// Enum values for ShardIteratorType +const ( + ShardIteratorTypeTrimHorizon ShardIteratorType = "TRIM_HORIZON" + ShardIteratorTypeLatest ShardIteratorType = "LATEST" + ShardIteratorTypeAtSequenceNumber ShardIteratorType = "AT_SEQUENCE_NUMBER" + ShardIteratorTypeAfterSequenceNumber ShardIteratorType = "AFTER_SEQUENCE_NUMBER" +) + // Values returns all known values for ShardIteratorType. 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. @@ -43,6 +64,14 @@ func (ShardIteratorType) Values() []ShardIteratorType { type StreamStatus string +// Enum values for StreamStatus +const ( + StreamStatusEnabling StreamStatus = "ENABLING" + StreamStatusEnabled StreamStatus = "ENABLED" + StreamStatusDisabling StreamStatus = "DISABLING" + StreamStatusDisabled StreamStatus = "DISABLED" +) + // Values returns all known values for StreamStatus. 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. @@ -57,6 +86,14 @@ func (StreamStatus) Values() []StreamStatus { type StreamViewType string +// Enum values for StreamViewType +const ( + StreamViewTypeNewImage StreamViewType = "NEW_IMAGE" + StreamViewTypeOldImage StreamViewType = "OLD_IMAGE" + StreamViewTypeNewAndOldImages StreamViewType = "NEW_AND_OLD_IMAGES" + StreamViewTypeKeysOnly StreamViewType = "KEYS_ONLY" +) + // Values returns all known values for StreamViewType. 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. diff --git a/service/ec2/api_op_AllocateAddress.go b/service/ec2/api_op_AllocateAddress.go index 5bfba1d8bdf..2fb084470e9 100644 --- a/service/ec2/api_op_AllocateAddress.go +++ b/service/ec2/api_op_AllocateAddress.go @@ -86,6 +86,9 @@ type AllocateAddressInput struct { // select an address from the address pool. To specify a specific address from the // address pool, use the Address parameter instead. PublicIpv4Pool *string + + // The tags to assign to the Elastic IP address. + TagSpecifications []types.TagSpecification } type AllocateAddressOutput struct { diff --git a/service/ec2/api_op_CopyImage.go b/service/ec2/api_op_CopyImage.go index f7c4e9162aa..ef280899cd5 100644 --- a/service/ec2/api_op_CopyImage.go +++ b/service/ec2/api_op_CopyImage.go @@ -61,6 +61,8 @@ type CopyImageInput struct { // A description for the new AMI in the destination Region. Description *string + DestinationOutpostArn *string + // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have the // required permissions, the error response is DryRunOperation. Otherwise, it is diff --git a/service/ec2/api_op_CreateImage.go b/service/ec2/api_op_CreateImage.go index d93781d20cf..903eec362a4 100644 --- a/service/ec2/api_op_CreateImage.go +++ b/service/ec2/api_op_CreateImage.go @@ -69,6 +69,8 @@ type CreateImageInput struct { // integrity on the created image can't be guaranteed. NoReboot bool + OutpostArn *string + // The tags to apply to the AMI and snapshots on creation. You can tag the AMI, the // snapshots, or both. // diff --git a/service/ec2/api_op_CreateVolume.go b/service/ec2/api_op_CreateVolume.go index 4a2212f61c3..ebfc35a9c6f 100644 --- a/service/ec2/api_op_CreateVolume.go +++ b/service/ec2/api_op_CreateVolume.go @@ -113,8 +113,8 @@ type CreateVolumeInput struct { // Indicates whether to enable Amazon EBS Multi-Attach. If you enable Multi-Attach, // you can attach the volume to up to 16 Instances built on the Nitro System // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances) - // in the same Availability Zone. This parameter is supported with io1 volumes - // only. For more information, see Amazon EBS Multi-Attach + // in the same Availability Zone. This parameter is supported with io1 and io2 + // volumes only. For more information, see Amazon EBS Multi-Attach // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volumes-multi.html) in // the Amazon Elastic Compute Cloud User Guide. MultiAttachEnabled bool diff --git a/service/ec2/api_op_ModifyVolume.go b/service/ec2/api_op_ModifyVolume.go index bbbee6e7f8b..d0d93c1fb20 100644 --- a/service/ec2/api_op_ModifyVolume.go +++ b/service/ec2/api_op_ModifyVolume.go @@ -87,6 +87,13 @@ type ModifyVolumeInput struct { // If no IOPS value is specified, the existing value is retained. Iops int32 + // Specifies whether to enable Amazon EBS Multi-Attach. If you enable Multi-Attach, + // you can attach the volume to up to 16 Nitro-based instances + // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances) + // in the same Availability Zone. This parameter is supported with io1 and io2 + // volumes only. For more information, see Amazon EBS Multi-Attach + // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-volumes-multi.html) in + // the Amazon Elastic Compute Cloud User Guide. MultiAttachEnabled bool // The target size of the volume, in GiB. The target volume size must be greater diff --git a/service/ec2/deserializers.go b/service/ec2/deserializers.go index 1898ff2e98c..ef82b361a6f 100644 --- a/service/ec2/deserializers.go +++ b/service/ec2/deserializers.go @@ -51510,6 +51510,19 @@ func awsEc2query_deserializeDocumentEbsBlockDevice(v **types.EbsBlockDevice, dec sv.KmsKeyId = ptr.String(xtv) } + case strings.EqualFold("outpostArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OutpostArn = ptr.String(xtv) + } + case strings.EqualFold("snapshotId", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -60702,6 +60715,19 @@ func awsEc2query_deserializeDocumentInstance(v **types.Instance, decoder smithyx return err } + case strings.EqualFold("bootMode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.BootMode = types.BootModeValues(xtv) + } + case strings.EqualFold("capacityReservationId", t.Name.Local): val, err := decoder.Value() if err != nil { diff --git a/service/ec2/serializers.go b/service/ec2/serializers.go index 440f56eda49..4f8c57e815d 100644 --- a/service/ec2/serializers.go +++ b/service/ec2/serializers.go @@ -25082,6 +25082,11 @@ func awsEc2query_serializeDocumentEbsBlockDevice(v *types.EbsBlockDevice, value objectKey.String(*v.KmsKeyId) } + if v.OutpostArn != nil { + objectKey := object.Key("OutpostArn") + objectKey.String(*v.OutpostArn) + } + if v.SnapshotId != nil { objectKey := object.Key("SnapshotId") objectKey.String(*v.SnapshotId) @@ -30963,6 +30968,13 @@ func awsEc2query_serializeOpDocumentAllocateAddressInput(v *AllocateAddressInput objectKey.String(*v.PublicIpv4Pool) } + if v.TagSpecifications != nil { + objectKey := object.FlatKey("TagSpecification") + if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { + return err + } + } + return nil } @@ -31890,6 +31902,11 @@ func awsEc2query_serializeOpDocumentCopyImageInput(v *CopyImageInput, value quer objectKey.String(*v.Description) } + if v.DestinationOutpostArn != nil { + objectKey := object.Key("DestinationOutpostArn") + objectKey.String(*v.DestinationOutpostArn) + } + if v.DryRun { objectKey := object.Key("DryRun") objectKey.Boolean(v.DryRun) @@ -32586,6 +32603,11 @@ func awsEc2query_serializeOpDocumentCreateImageInput(v *CreateImageInput, value objectKey.Boolean(v.NoReboot) } + if v.OutpostArn != nil { + objectKey := object.Key("OutpostArn") + objectKey.String(*v.OutpostArn) + } + if v.TagSpecifications != nil { objectKey := object.FlatKey("TagSpecification") if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { diff --git a/service/ec2/types/enums.go b/service/ec2/types/enums.go index 40478d1fc3e..fcde761ebc8 100644 --- a/service/ec2/types/enums.go +++ b/service/ec2/types/enums.go @@ -4,6 +4,12 @@ package types type AccountAttributeName string +// Enum values for AccountAttributeName +const ( + AccountAttributeNameSupportedPlatforms AccountAttributeName = "supported-platforms" + AccountAttributeNameDefaultVpc AccountAttributeName = "default-vpc" +) + // Values returns all known values for AccountAttributeName. 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. @@ -38,6 +44,11 @@ func (ActivityStatus) Values() []ActivityStatus { type AddressAttributeName string +// Enum values for AddressAttributeName +const ( + AddressAttributeNameDomainName AddressAttributeName = "domain-name" +) + // Values returns all known values for AddressAttributeName. 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. @@ -49,6 +60,12 @@ func (AddressAttributeName) Values() []AddressAttributeName { type Affinity string +// Enum values for Affinity +const ( + AffinityDefault Affinity = "default" + AffinityHost Affinity = "host" +) + // Values returns all known values for Affinity. 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. @@ -61,6 +78,16 @@ func (Affinity) Values() []Affinity { type AllocationState string +// Enum values for AllocationState +const ( + AllocationStateAvailable AllocationState = "available" + AllocationStateUnderAssessment AllocationState = "under-assessment" + AllocationStatePermanentFailure AllocationState = "permanent-failure" + AllocationStateReleased AllocationState = "released" + AllocationStateReleasedPermanentFailure AllocationState = "released-permanent-failure" + AllocationStatePending AllocationState = "pending" +) + // Values returns all known values for AllocationState. 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. @@ -97,6 +124,12 @@ func (AllocationStrategy) Values() []AllocationStrategy { type AllowsMultipleInstanceTypes string +// Enum values for AllowsMultipleInstanceTypes +const ( + AllowsMultipleInstanceTypesOn AllowsMultipleInstanceTypes = "on" + AllowsMultipleInstanceTypesOff AllowsMultipleInstanceTypes = "off" +) + // Values returns all known values for AllowsMultipleInstanceTypes. 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. @@ -109,6 +142,13 @@ func (AllowsMultipleInstanceTypes) Values() []AllowsMultipleInstanceTypes { type AnalysisStatus string +// Enum values for AnalysisStatus +const ( + AnalysisStatusRunning AnalysisStatus = "running" + AnalysisStatusSucceeded AnalysisStatus = "succeeded" + AnalysisStatusFailed AnalysisStatus = "failed" +) + // Values returns all known values for AnalysisStatus. 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. @@ -122,6 +162,12 @@ func (AnalysisStatus) Values() []AnalysisStatus { type ApplianceModeSupportValue string +// Enum values for ApplianceModeSupportValue +const ( + ApplianceModeSupportValueEnable ApplianceModeSupportValue = "enable" + ApplianceModeSupportValueDisable ApplianceModeSupportValue = "disable" +) + // Values returns all known values for ApplianceModeSupportValue. 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. @@ -134,6 +180,13 @@ func (ApplianceModeSupportValue) Values() []ApplianceModeSupportValue { type ArchitectureType string +// Enum values for ArchitectureType +const ( + ArchitectureTypeI386 ArchitectureType = "i386" + ArchitectureTypeX8664 ArchitectureType = "x86_64" + ArchitectureTypeArm64 ArchitectureType = "arm64" +) + // Values returns all known values for ArchitectureType. 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. @@ -147,6 +200,13 @@ func (ArchitectureType) Values() []ArchitectureType { type ArchitectureValues string +// Enum values for ArchitectureValues +const ( + ArchitectureValuesI386 ArchitectureValues = "i386" + ArchitectureValuesX8664 ArchitectureValues = "x86_64" + ArchitectureValuesArm64 ArchitectureValues = "arm64" +) + // Values returns all known values for ArchitectureValues. 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. @@ -160,6 +220,11 @@ func (ArchitectureValues) Values() []ArchitectureValues { type AssociatedNetworkType string +// Enum values for AssociatedNetworkType +const ( + AssociatedNetworkTypeVpc AssociatedNetworkType = "vpc" +) + // Values returns all known values for AssociatedNetworkType. 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. @@ -171,6 +236,15 @@ func (AssociatedNetworkType) Values() []AssociatedNetworkType { type AssociationStatusCode string +// Enum values for AssociationStatusCode +const ( + AssociationStatusCodeAssociating AssociationStatusCode = "associating" + AssociationStatusCodeAssociated AssociationStatusCode = "associated" + AssociationStatusCodeAssociationFailed AssociationStatusCode = "association-failed" + AssociationStatusCodeDisassociating AssociationStatusCode = "disassociating" + AssociationStatusCodeDisassociated AssociationStatusCode = "disassociated" +) + // Values returns all known values for AssociationStatusCode. 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. @@ -186,6 +260,14 @@ func (AssociationStatusCode) Values() []AssociationStatusCode { type AttachmentStatus string +// Enum values for AttachmentStatus +const ( + AttachmentStatusAttaching AttachmentStatus = "attaching" + AttachmentStatusAttached AttachmentStatus = "attached" + AttachmentStatusDetaching AttachmentStatus = "detaching" + AttachmentStatusDetached AttachmentStatus = "detached" +) + // Values returns all known values for AttachmentStatus. 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. @@ -200,6 +282,12 @@ func (AttachmentStatus) Values() []AttachmentStatus { type AutoAcceptSharedAssociationsValue string +// Enum values for AutoAcceptSharedAssociationsValue +const ( + AutoAcceptSharedAssociationsValueEnable AutoAcceptSharedAssociationsValue = "enable" + AutoAcceptSharedAssociationsValueDisable AutoAcceptSharedAssociationsValue = "disable" +) + // Values returns all known values for AutoAcceptSharedAssociationsValue. 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 @@ -213,6 +301,12 @@ func (AutoAcceptSharedAssociationsValue) Values() []AutoAcceptSharedAssociations type AutoAcceptSharedAttachmentsValue string +// Enum values for AutoAcceptSharedAttachmentsValue +const ( + AutoAcceptSharedAttachmentsValueEnable AutoAcceptSharedAttachmentsValue = "enable" + AutoAcceptSharedAttachmentsValueDisable AutoAcceptSharedAttachmentsValue = "disable" +) + // Values returns all known values for AutoAcceptSharedAttachmentsValue. 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 @@ -226,6 +320,12 @@ func (AutoAcceptSharedAttachmentsValue) Values() []AutoAcceptSharedAttachmentsVa type AutoPlacement string +// Enum values for AutoPlacement +const ( + AutoPlacementOn AutoPlacement = "on" + AutoPlacementOff AutoPlacement = "off" +) + // Values returns all known values for AutoPlacement. 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. @@ -238,6 +338,13 @@ func (AutoPlacement) Values() []AutoPlacement { type AvailabilityZoneOptInStatus string +// Enum values for AvailabilityZoneOptInStatus +const ( + AvailabilityZoneOptInStatusOptInNotRequired AvailabilityZoneOptInStatus = "opt-in-not-required" + AvailabilityZoneOptInStatusOptedIn AvailabilityZoneOptInStatus = "opted-in" + AvailabilityZoneOptInStatusNotOptedIn AvailabilityZoneOptInStatus = "not-opted-in" +) + // Values returns all known values for AvailabilityZoneOptInStatus. 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. @@ -251,6 +358,14 @@ func (AvailabilityZoneOptInStatus) Values() []AvailabilityZoneOptInStatus { type AvailabilityZoneState string +// Enum values for AvailabilityZoneState +const ( + AvailabilityZoneStateAvailable AvailabilityZoneState = "available" + AvailabilityZoneStateInformation AvailabilityZoneState = "information" + AvailabilityZoneStateImpaired AvailabilityZoneState = "impaired" + AvailabilityZoneStateUnavailable AvailabilityZoneState = "unavailable" +) + // Values returns all known values for AvailabilityZoneState. 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. @@ -293,6 +408,12 @@ func (BatchState) Values() []BatchState { type BgpStatus string +// Enum values for BgpStatus +const ( + BgpStatusUp BgpStatus = "up" + BgpStatusDown BgpStatus = "down" +) + // Values returns all known values for BgpStatus. 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. @@ -305,6 +426,12 @@ func (BgpStatus) Values() []BgpStatus { type BootModeType string +// Enum values for BootModeType +const ( + BootModeTypeLegacyBios BootModeType = "legacy-bios" + BootModeTypeUefi BootModeType = "uefi" +) + // Values returns all known values for BootModeType. 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. @@ -317,6 +444,12 @@ func (BootModeType) Values() []BootModeType { type BootModeValues string +// Enum values for BootModeValues +const ( + BootModeValuesLegacyBios BootModeValues = "legacy-bios" + BootModeValuesUefi BootModeValues = "uefi" +) + // Values returns all known values for BootModeValues. 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. @@ -329,6 +462,17 @@ func (BootModeValues) Values() []BootModeValues { type BundleTaskState string +// Enum values for BundleTaskState +const ( + BundleTaskStatePending BundleTaskState = "pending" + BundleTaskStateWaitingForShutdown BundleTaskState = "waiting-for-shutdown" + BundleTaskStateBundling BundleTaskState = "bundling" + BundleTaskStateStoring BundleTaskState = "storing" + BundleTaskStateCancelling BundleTaskState = "cancelling" + BundleTaskStateComplete BundleTaskState = "complete" + BundleTaskStateFailed BundleTaskState = "failed" +) + // Values returns all known values for BundleTaskState. 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. @@ -346,6 +490,18 @@ func (BundleTaskState) Values() []BundleTaskState { type ByoipCidrState string +// Enum values for ByoipCidrState +const ( + ByoipCidrStateAdvertised ByoipCidrState = "advertised" + ByoipCidrStateDeprovisioned ByoipCidrState = "deprovisioned" + ByoipCidrStateFailedDeprovision ByoipCidrState = "failed-deprovision" + ByoipCidrStateFailedProvision ByoipCidrState = "failed-provision" + ByoipCidrStatePendingDeprovision ByoipCidrState = "pending-deprovision" + ByoipCidrStatePendingProvision ByoipCidrState = "pending-provision" + ByoipCidrStateProvisioned ByoipCidrState = "provisioned" + ByoipCidrStateProvisionedNotPubliclyAdvertisable ByoipCidrState = "provisioned-not-publicly-advertisable" +) + // Values returns all known values for ByoipCidrState. 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. @@ -386,6 +542,15 @@ func (CancelBatchErrorCode) Values() []CancelBatchErrorCode { type CancelSpotInstanceRequestState string +// Enum values for CancelSpotInstanceRequestState +const ( + CancelSpotInstanceRequestStateActive CancelSpotInstanceRequestState = "active" + CancelSpotInstanceRequestStateOpen CancelSpotInstanceRequestState = "open" + CancelSpotInstanceRequestStateClosed CancelSpotInstanceRequestState = "closed" + CancelSpotInstanceRequestStateCancelled CancelSpotInstanceRequestState = "cancelled" + CancelSpotInstanceRequestStateCompleted CancelSpotInstanceRequestState = "completed" +) + // Values returns all known values for CancelSpotInstanceRequestState. 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 @@ -439,6 +604,12 @@ func (CapacityReservationInstancePlatform) Values() []CapacityReservationInstanc type CapacityReservationPreference string +// Enum values for CapacityReservationPreference +const ( + CapacityReservationPreferenceOpen CapacityReservationPreference = "open" + CapacityReservationPreferenceNone CapacityReservationPreference = "none" +) + // Values returns all known values for CapacityReservationPreference. 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 @@ -452,6 +623,15 @@ func (CapacityReservationPreference) Values() []CapacityReservationPreference { type CapacityReservationState string +// Enum values for CapacityReservationState +const ( + CapacityReservationStateActive CapacityReservationState = "active" + CapacityReservationStateExpired CapacityReservationState = "expired" + CapacityReservationStateCancelled CapacityReservationState = "cancelled" + CapacityReservationStatePending CapacityReservationState = "pending" + CapacityReservationStateFailed CapacityReservationState = "failed" +) + // Values returns all known values for CapacityReservationState. 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. @@ -467,6 +647,12 @@ func (CapacityReservationState) Values() []CapacityReservationState { type CapacityReservationTenancy string +// Enum values for CapacityReservationTenancy +const ( + CapacityReservationTenancyDefault CapacityReservationTenancy = "default" + CapacityReservationTenancyDedicated CapacityReservationTenancy = "dedicated" +) + // Values returns all known values for CapacityReservationTenancy. 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. @@ -479,6 +665,14 @@ func (CapacityReservationTenancy) Values() []CapacityReservationTenancy { type CarrierGatewayState string +// Enum values for CarrierGatewayState +const ( + CarrierGatewayStatePending CarrierGatewayState = "pending" + CarrierGatewayStateAvailable CarrierGatewayState = "available" + CarrierGatewayStateDeleting CarrierGatewayState = "deleting" + CarrierGatewayStateDeleted CarrierGatewayState = "deleted" +) + // Values returns all known values for CarrierGatewayState. 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. @@ -493,6 +687,12 @@ func (CarrierGatewayState) Values() []CarrierGatewayState { type ClientCertificateRevocationListStatusCode string +// Enum values for ClientCertificateRevocationListStatusCode +const ( + ClientCertificateRevocationListStatusCodePending ClientCertificateRevocationListStatusCode = "pending" + ClientCertificateRevocationListStatusCodeActive ClientCertificateRevocationListStatusCode = "active" +) + // Values returns all known values for ClientCertificateRevocationListStatusCode. // 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 @@ -506,6 +706,13 @@ func (ClientCertificateRevocationListStatusCode) Values() []ClientCertificateRev type ClientVpnAuthenticationType string +// Enum values for ClientVpnAuthenticationType +const ( + ClientVpnAuthenticationTypeCertificateAuthentication ClientVpnAuthenticationType = "certificate-authentication" + ClientVpnAuthenticationTypeDirectoryServiceAuthentication ClientVpnAuthenticationType = "directory-service-authentication" + ClientVpnAuthenticationTypeFederatedAuthentication ClientVpnAuthenticationType = "federated-authentication" +) + // Values returns all known values for ClientVpnAuthenticationType. 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. @@ -519,6 +726,14 @@ func (ClientVpnAuthenticationType) Values() []ClientVpnAuthenticationType { type ClientVpnAuthorizationRuleStatusCode string +// Enum values for ClientVpnAuthorizationRuleStatusCode +const ( + ClientVpnAuthorizationRuleStatusCodeAuthorizing ClientVpnAuthorizationRuleStatusCode = "authorizing" + ClientVpnAuthorizationRuleStatusCodeActive ClientVpnAuthorizationRuleStatusCode = "active" + ClientVpnAuthorizationRuleStatusCodeFailed ClientVpnAuthorizationRuleStatusCode = "failed" + ClientVpnAuthorizationRuleStatusCodeRevoking ClientVpnAuthorizationRuleStatusCode = "revoking" +) + // Values returns all known values for ClientVpnAuthorizationRuleStatusCode. 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 @@ -534,6 +749,14 @@ func (ClientVpnAuthorizationRuleStatusCode) Values() []ClientVpnAuthorizationRul type ClientVpnConnectionStatusCode string +// Enum values for ClientVpnConnectionStatusCode +const ( + ClientVpnConnectionStatusCodeActive ClientVpnConnectionStatusCode = "active" + ClientVpnConnectionStatusCodeFailedToTerminate ClientVpnConnectionStatusCode = "failed-to-terminate" + ClientVpnConnectionStatusCodeTerminating ClientVpnConnectionStatusCode = "terminating" + ClientVpnConnectionStatusCodeTerminated ClientVpnConnectionStatusCode = "terminated" +) + // Values returns all known values for ClientVpnConnectionStatusCode. 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 @@ -549,6 +772,12 @@ func (ClientVpnConnectionStatusCode) Values() []ClientVpnConnectionStatusCode { type ClientVpnEndpointAttributeStatusCode string +// Enum values for ClientVpnEndpointAttributeStatusCode +const ( + ClientVpnEndpointAttributeStatusCodeApplying ClientVpnEndpointAttributeStatusCode = "applying" + ClientVpnEndpointAttributeStatusCodeApplied ClientVpnEndpointAttributeStatusCode = "applied" +) + // Values returns all known values for ClientVpnEndpointAttributeStatusCode. 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 @@ -562,6 +791,14 @@ func (ClientVpnEndpointAttributeStatusCode) Values() []ClientVpnEndpointAttribut type ClientVpnEndpointStatusCode string +// Enum values for ClientVpnEndpointStatusCode +const ( + ClientVpnEndpointStatusCodePendingAssociate ClientVpnEndpointStatusCode = "pending-associate" + ClientVpnEndpointStatusCodeAvailable ClientVpnEndpointStatusCode = "available" + ClientVpnEndpointStatusCodeDeleting ClientVpnEndpointStatusCode = "deleting" + ClientVpnEndpointStatusCodeDeleted ClientVpnEndpointStatusCode = "deleted" +) + // Values returns all known values for ClientVpnEndpointStatusCode. 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. @@ -576,6 +813,14 @@ func (ClientVpnEndpointStatusCode) Values() []ClientVpnEndpointStatusCode { type ClientVpnRouteStatusCode string +// Enum values for ClientVpnRouteStatusCode +const ( + ClientVpnRouteStatusCodeCreating ClientVpnRouteStatusCode = "creating" + ClientVpnRouteStatusCodeActive ClientVpnRouteStatusCode = "active" + ClientVpnRouteStatusCodeFailed ClientVpnRouteStatusCode = "failed" + ClientVpnRouteStatusCodeDeleting ClientVpnRouteStatusCode = "deleting" +) + // Values returns all known values for ClientVpnRouteStatusCode. 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. @@ -624,6 +869,11 @@ func (ConnectionNotificationType) Values() []ConnectionNotificationType { type ContainerFormat string +// Enum values for ContainerFormat +const ( + ContainerFormatOva ContainerFormat = "ova" +) + // Values returns all known values for ContainerFormat. 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. @@ -635,6 +885,14 @@ func (ContainerFormat) Values() []ContainerFormat { type ConversionTaskState string +// Enum values for ConversionTaskState +const ( + ConversionTaskStateActive ConversionTaskState = "active" + ConversionTaskStateCancelling ConversionTaskState = "cancelling" + ConversionTaskStateCancelled ConversionTaskState = "cancelled" + ConversionTaskStateCompleted ConversionTaskState = "completed" +) + // Values returns all known values for ConversionTaskState. 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. @@ -649,6 +907,11 @@ func (ConversionTaskState) Values() []ConversionTaskState { type CopyTagsFromSource string +// Enum values for CopyTagsFromSource +const ( + CopyTagsFromSourceVolume CopyTagsFromSource = "volume" +) + // Values returns all known values for CopyTagsFromSource. 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. @@ -660,6 +923,11 @@ func (CopyTagsFromSource) Values() []CopyTagsFromSource { type CurrencyCodeValues string +// Enum values for CurrencyCodeValues +const ( + CurrencyCodeValuesUsd CurrencyCodeValues = "USD" +) + // Values returns all known values for CurrencyCodeValues. 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. @@ -671,6 +939,12 @@ func (CurrencyCodeValues) Values() []CurrencyCodeValues { type DatafeedSubscriptionState string +// Enum values for DatafeedSubscriptionState +const ( + DatafeedSubscriptionStateActive DatafeedSubscriptionState = "Active" + DatafeedSubscriptionStateInactive DatafeedSubscriptionState = "Inactive" +) + // Values returns all known values for DatafeedSubscriptionState. 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. @@ -683,6 +957,12 @@ func (DatafeedSubscriptionState) Values() []DatafeedSubscriptionState { type DefaultRouteTableAssociationValue string +// Enum values for DefaultRouteTableAssociationValue +const ( + DefaultRouteTableAssociationValueEnable DefaultRouteTableAssociationValue = "enable" + DefaultRouteTableAssociationValueDisable DefaultRouteTableAssociationValue = "disable" +) + // Values returns all known values for DefaultRouteTableAssociationValue. 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 @@ -696,6 +976,12 @@ func (DefaultRouteTableAssociationValue) Values() []DefaultRouteTableAssociation type DefaultRouteTablePropagationValue string +// Enum values for DefaultRouteTablePropagationValue +const ( + DefaultRouteTablePropagationValueEnable DefaultRouteTablePropagationValue = "enable" + DefaultRouteTablePropagationValueDisable DefaultRouteTablePropagationValue = "disable" +) + // Values returns all known values for DefaultRouteTablePropagationValue. 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 @@ -770,6 +1056,12 @@ func (DeleteQueuedReservedInstancesErrorCode) Values() []DeleteQueuedReservedIns type DeviceType string +// Enum values for DeviceType +const ( + DeviceTypeEbs DeviceType = "ebs" + DeviceTypeInstanceStore DeviceType = "instance-store" +) + // Values returns all known values for DeviceType. 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. @@ -782,6 +1074,13 @@ func (DeviceType) Values() []DeviceType { type DiskImageFormat string +// Enum values for DiskImageFormat +const ( + DiskImageFormatVmdk DiskImageFormat = "VMDK" + DiskImageFormatRaw DiskImageFormat = "RAW" + DiskImageFormatVhd DiskImageFormat = "VHD" +) + // Values returns all known values for DiskImageFormat. 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. @@ -795,6 +1094,12 @@ func (DiskImageFormat) Values() []DiskImageFormat { type DiskType string +// Enum values for DiskType +const ( + DiskTypeHdd DiskType = "hdd" + DiskTypeSsd DiskType = "ssd" +) + // Values returns all known values for DiskType. 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. @@ -827,6 +1132,12 @@ func (DnsNameState) Values() []DnsNameState { type DnsSupportValue string +// Enum values for DnsSupportValue +const ( + DnsSupportValueEnable DnsSupportValue = "enable" + DnsSupportValueDisable DnsSupportValue = "disable" +) + // Values returns all known values for DnsSupportValue. 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. @@ -839,6 +1150,12 @@ func (DnsSupportValue) Values() []DnsSupportValue { type DomainType string +// Enum values for DomainType +const ( + DomainTypeVpc DomainType = "vpc" + DomainTypeStandard DomainType = "standard" +) + // Values returns all known values for DomainType. 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. @@ -851,6 +1168,12 @@ func (DomainType) Values() []DomainType { type EbsEncryptionSupport string +// Enum values for EbsEncryptionSupport +const ( + EbsEncryptionSupportUnsupported EbsEncryptionSupport = "unsupported" + EbsEncryptionSupportSupported EbsEncryptionSupport = "supported" +) + // Values returns all known values for EbsEncryptionSupport. 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. @@ -883,6 +1206,13 @@ func (EbsNvmeSupport) Values() []EbsNvmeSupport { type EbsOptimizedSupport string +// Enum values for EbsOptimizedSupport +const ( + EbsOptimizedSupportUnsupported EbsOptimizedSupport = "unsupported" + EbsOptimizedSupportSupported EbsOptimizedSupport = "supported" + EbsOptimizedSupportDefault EbsOptimizedSupport = "default" +) + // Values returns all known values for EbsOptimizedSupport. 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. @@ -930,6 +1260,13 @@ func (ElasticGpuStatus) Values() []ElasticGpuStatus { type EnaSupport string +// Enum values for EnaSupport +const ( + EnaSupportUnsupported EnaSupport = "unsupported" + EnaSupportSupported EnaSupport = "supported" + EnaSupportRequired EnaSupport = "required" +) + // Values returns all known values for EnaSupport. 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. @@ -943,6 +1280,12 @@ func (EnaSupport) Values() []EnaSupport { type EndDateType string +// Enum values for EndDateType +const ( + EndDateTypeUnlimited EndDateType = "unlimited" + EndDateTypeLimited EndDateType = "limited" +) + // Values returns all known values for EndDateType. 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. @@ -975,6 +1318,15 @@ func (EphemeralNvmeSupport) Values() []EphemeralNvmeSupport { type EventCode string +// Enum values for EventCode +const ( + EventCodeInstanceReboot EventCode = "instance-reboot" + EventCodeSystemReboot EventCode = "system-reboot" + EventCodeSystemMaintenance EventCode = "system-maintenance" + EventCodeInstanceRetirement EventCode = "instance-retirement" + EventCodeInstanceStop EventCode = "instance-stop" +) + // Values returns all known values for EventCode. 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. @@ -1031,6 +1383,13 @@ func (ExcessCapacityTerminationPolicy) Values() []ExcessCapacityTerminationPolic type ExportEnvironment string +// Enum values for ExportEnvironment +const ( + ExportEnvironmentCitrix ExportEnvironment = "citrix" + ExportEnvironmentVmware ExportEnvironment = "vmware" + ExportEnvironmentMicrosoft ExportEnvironment = "microsoft" +) + // Values returns all known values for ExportEnvironment. 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. @@ -1044,6 +1403,14 @@ func (ExportEnvironment) Values() []ExportEnvironment { type ExportTaskState string +// Enum values for ExportTaskState +const ( + ExportTaskStateActive ExportTaskState = "active" + ExportTaskStateCancelling ExportTaskState = "cancelling" + ExportTaskStateCancelled ExportTaskState = "cancelled" + ExportTaskStateCompleted ExportTaskState = "completed" +) + // Values returns all known values for ExportTaskState. 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. @@ -1058,6 +1425,15 @@ func (ExportTaskState) Values() []ExportTaskState { type FastSnapshotRestoreStateCode string +// Enum values for FastSnapshotRestoreStateCode +const ( + FastSnapshotRestoreStateCodeEnabling FastSnapshotRestoreStateCode = "enabling" + FastSnapshotRestoreStateCodeOptimizing FastSnapshotRestoreStateCode = "optimizing" + FastSnapshotRestoreStateCodeEnabled FastSnapshotRestoreStateCode = "enabled" + FastSnapshotRestoreStateCodeDisabling FastSnapshotRestoreStateCode = "disabling" + FastSnapshotRestoreStateCodeDisabled FastSnapshotRestoreStateCode = "disabled" +) + // Values returns all known values for FastSnapshotRestoreStateCode. 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. @@ -1234,6 +1610,13 @@ func (FleetType) Values() []FleetType { type FlowLogsResourceType string +// Enum values for FlowLogsResourceType +const ( + FlowLogsResourceTypeVpc FlowLogsResourceType = "VPC" + FlowLogsResourceTypeSubnet FlowLogsResourceType = "Subnet" + FlowLogsResourceTypeNetworkinterface FlowLogsResourceType = "NetworkInterface" +) + // Values returns all known values for FlowLogsResourceType. 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. @@ -1247,6 +1630,14 @@ func (FlowLogsResourceType) Values() []FlowLogsResourceType { type FpgaImageAttributeName string +// Enum values for FpgaImageAttributeName +const ( + FpgaImageAttributeNameDescription FpgaImageAttributeName = "description" + FpgaImageAttributeNameName FpgaImageAttributeName = "name" + FpgaImageAttributeNameLoadpermission FpgaImageAttributeName = "loadPermission" + FpgaImageAttributeNameProductcodes FpgaImageAttributeName = "productCodes" +) + // Values returns all known values for FpgaImageAttributeName. 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. @@ -1261,6 +1652,14 @@ func (FpgaImageAttributeName) Values() []FpgaImageAttributeName { type FpgaImageStateCode string +// Enum values for FpgaImageStateCode +const ( + FpgaImageStateCodePending FpgaImageStateCode = "pending" + FpgaImageStateCodeFailed FpgaImageStateCode = "failed" + FpgaImageStateCodeAvailable FpgaImageStateCode = "available" + FpgaImageStateCodeUnavailable FpgaImageStateCode = "unavailable" +) + // Values returns all known values for FpgaImageStateCode. 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. @@ -1275,6 +1674,11 @@ func (FpgaImageStateCode) Values() []FpgaImageStateCode { type GatewayType string +// Enum values for GatewayType +const ( + GatewayTypeIpsec1 GatewayType = "ipsec.1" +) + // Values returns all known values for GatewayType. 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. @@ -1286,6 +1690,12 @@ func (GatewayType) Values() []GatewayType { type HostRecovery string +// Enum values for HostRecovery +const ( + HostRecoveryOn HostRecovery = "on" + HostRecoveryOff HostRecovery = "off" +) + // Values returns all known values for HostRecovery. 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. @@ -1298,6 +1708,12 @@ func (HostRecovery) Values() []HostRecovery { type HostTenancy string +// Enum values for HostTenancy +const ( + HostTenancyDedicated HostTenancy = "dedicated" + HostTenancyHost HostTenancy = "host" +) + // Values returns all known values for HostTenancy. 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. @@ -1328,6 +1744,12 @@ func (HttpTokensState) Values() []HttpTokensState { type HypervisorType string +// Enum values for HypervisorType +const ( + HypervisorTypeOvm HypervisorType = "ovm" + HypervisorTypeXen HypervisorType = "xen" +) + // Values returns all known values for HypervisorType. 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. @@ -1363,6 +1785,12 @@ func (IamInstanceProfileAssociationState) Values() []IamInstanceProfileAssociati type Igmpv2SupportValue string +// Enum values for Igmpv2SupportValue +const ( + Igmpv2SupportValueEnable Igmpv2SupportValue = "enable" + Igmpv2SupportValueDisable Igmpv2SupportValue = "disable" +) + // Values returns all known values for Igmpv2SupportValue. 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. @@ -1375,6 +1803,18 @@ func (Igmpv2SupportValue) Values() []Igmpv2SupportValue { type ImageAttributeName string +// Enum values for ImageAttributeName +const ( + ImageAttributeNameDescription ImageAttributeName = "description" + ImageAttributeNameKernel ImageAttributeName = "kernel" + ImageAttributeNameRamdisk ImageAttributeName = "ramdisk" + ImageAttributeNameLaunchpermission ImageAttributeName = "launchPermission" + ImageAttributeNameProductcodes ImageAttributeName = "productCodes" + ImageAttributeNameBlockdevicemapping ImageAttributeName = "blockDeviceMapping" + ImageAttributeNameSriovnetsupport ImageAttributeName = "sriovNetSupport" + ImageAttributeNameBootmode ImageAttributeName = "bootMode" +) + // Values returns all known values for ImageAttributeName. 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. @@ -1393,6 +1833,17 @@ func (ImageAttributeName) Values() []ImageAttributeName { type ImageState string +// Enum values for ImageState +const ( + ImageStatePending ImageState = "pending" + ImageStateAvailable ImageState = "available" + ImageStateInvalid ImageState = "invalid" + ImageStateDeregistered ImageState = "deregistered" + ImageStateTransient ImageState = "transient" + ImageStateFailed ImageState = "failed" + ImageStateError ImageState = "error" +) + // Values returns all known values for ImageState. 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. @@ -1410,6 +1861,13 @@ func (ImageState) Values() []ImageState { type ImageTypeValues string +// Enum values for ImageTypeValues +const ( + ImageTypeValuesMachine ImageTypeValues = "machine" + ImageTypeValuesKernel ImageTypeValues = "kernel" + ImageTypeValuesRamdisk ImageTypeValues = "ramdisk" +) + // Values returns all known values for ImageTypeValues. 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. @@ -1423,6 +1881,25 @@ func (ImageTypeValues) Values() []ImageTypeValues { type InstanceAttributeName string +// Enum values for InstanceAttributeName +const ( + InstanceAttributeNameInstancetype InstanceAttributeName = "instanceType" + InstanceAttributeNameKernel InstanceAttributeName = "kernel" + InstanceAttributeNameRamdisk InstanceAttributeName = "ramdisk" + InstanceAttributeNameUserdata InstanceAttributeName = "userData" + InstanceAttributeNameDisableapitermination InstanceAttributeName = "disableApiTermination" + InstanceAttributeNameInstanceinitiatedshutdownbehavior InstanceAttributeName = "instanceInitiatedShutdownBehavior" + InstanceAttributeNameRootdevicename InstanceAttributeName = "rootDeviceName" + InstanceAttributeNameBlockdevicemapping InstanceAttributeName = "blockDeviceMapping" + InstanceAttributeNameProductcodes InstanceAttributeName = "productCodes" + InstanceAttributeNameSourcedestcheck InstanceAttributeName = "sourceDestCheck" + InstanceAttributeNameGroupset InstanceAttributeName = "groupSet" + InstanceAttributeNameEbsoptimized InstanceAttributeName = "ebsOptimized" + InstanceAttributeNameSriovnetsupport InstanceAttributeName = "sriovNetSupport" + InstanceAttributeNameEnasupport InstanceAttributeName = "enaSupport" + InstanceAttributeNameEnclaveoptions InstanceAttributeName = "enclaveOptions" +) + // Values returns all known values for InstanceAttributeName. 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. @@ -1466,6 +1943,13 @@ func (InstanceHealthStatus) Values() []InstanceHealthStatus { type InstanceInterruptionBehavior string +// Enum values for InstanceInterruptionBehavior +const ( + InstanceInterruptionBehaviorHibernate InstanceInterruptionBehavior = "hibernate" + InstanceInterruptionBehaviorStop InstanceInterruptionBehavior = "stop" + InstanceInterruptionBehaviorTerminate InstanceInterruptionBehavior = "terminate" +) + // Values returns all known values for InstanceInterruptionBehavior. 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. @@ -1497,6 +1981,12 @@ func (InstanceLifecycle) Values() []InstanceLifecycle { type InstanceLifecycleType string +// Enum values for InstanceLifecycleType +const ( + InstanceLifecycleTypeSpot InstanceLifecycleType = "spot" + InstanceLifecycleTypeScheduled InstanceLifecycleType = "scheduled" +) + // Values returns all known values for InstanceLifecycleType. 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. @@ -1509,6 +1999,12 @@ func (InstanceLifecycleType) Values() []InstanceLifecycleType { type InstanceMatchCriteria string +// Enum values for InstanceMatchCriteria +const ( + InstanceMatchCriteriaOpen InstanceMatchCriteria = "open" + InstanceMatchCriteriaTargeted InstanceMatchCriteria = "targeted" +) + // Values returns all known values for InstanceMatchCriteria. 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. @@ -1521,6 +2017,12 @@ func (InstanceMatchCriteria) Values() []InstanceMatchCriteria { type InstanceMetadataEndpointState string +// Enum values for InstanceMetadataEndpointState +const ( + InstanceMetadataEndpointStateDisabled InstanceMetadataEndpointState = "disabled" + InstanceMetadataEndpointStateEnabled InstanceMetadataEndpointState = "enabled" +) + // Values returns all known values for InstanceMetadataEndpointState. 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 @@ -1534,6 +2036,12 @@ func (InstanceMetadataEndpointState) Values() []InstanceMetadataEndpointState { type InstanceMetadataOptionsState string +// Enum values for InstanceMetadataOptionsState +const ( + InstanceMetadataOptionsStatePending InstanceMetadataOptionsState = "pending" + InstanceMetadataOptionsStateApplied InstanceMetadataOptionsState = "applied" +) + // Values returns all known values for InstanceMetadataOptionsState. 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. @@ -1546,6 +2054,16 @@ func (InstanceMetadataOptionsState) Values() []InstanceMetadataOptionsState { type InstanceStateName string +// Enum values for InstanceStateName +const ( + InstanceStateNamePending InstanceStateName = "pending" + InstanceStateNameRunning InstanceStateName = "running" + InstanceStateNameShuttingDown InstanceStateName = "shutting-down" + InstanceStateNameTerminated InstanceStateName = "terminated" + InstanceStateNameStopping InstanceStateName = "stopping" + InstanceStateNameStopped InstanceStateName = "stopped" +) + // Values returns all known values for InstanceStateName. 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. @@ -1562,6 +2080,406 @@ func (InstanceStateName) Values() []InstanceStateName { type InstanceType string +// Enum values for InstanceType +const ( + InstanceTypeT1Micro InstanceType = "t1.micro" + InstanceTypeT2Nano InstanceType = "t2.nano" + InstanceTypeT2Micro InstanceType = "t2.micro" + InstanceTypeT2Small InstanceType = "t2.small" + InstanceTypeT2Medium InstanceType = "t2.medium" + InstanceTypeT2Large InstanceType = "t2.large" + InstanceTypeT2Xlarge InstanceType = "t2.xlarge" + InstanceTypeT22xlarge InstanceType = "t2.2xlarge" + InstanceTypeT3Nano InstanceType = "t3.nano" + InstanceTypeT3Micro InstanceType = "t3.micro" + InstanceTypeT3Small InstanceType = "t3.small" + InstanceTypeT3Medium InstanceType = "t3.medium" + InstanceTypeT3Large InstanceType = "t3.large" + InstanceTypeT3Xlarge InstanceType = "t3.xlarge" + InstanceTypeT32xlarge InstanceType = "t3.2xlarge" + InstanceTypeT3aNano InstanceType = "t3a.nano" + InstanceTypeT3aMicro InstanceType = "t3a.micro" + InstanceTypeT3aSmall InstanceType = "t3a.small" + InstanceTypeT3aMedium InstanceType = "t3a.medium" + InstanceTypeT3aLarge InstanceType = "t3a.large" + InstanceTypeT3aXlarge InstanceType = "t3a.xlarge" + InstanceTypeT3a2xlarge InstanceType = "t3a.2xlarge" + InstanceTypeT4gNano InstanceType = "t4g.nano" + InstanceTypeT4gMicro InstanceType = "t4g.micro" + InstanceTypeT4gSmall InstanceType = "t4g.small" + InstanceTypeT4gMedium InstanceType = "t4g.medium" + InstanceTypeT4gLarge InstanceType = "t4g.large" + InstanceTypeT4gXlarge InstanceType = "t4g.xlarge" + InstanceTypeT4g2xlarge InstanceType = "t4g.2xlarge" + InstanceTypeM1Small InstanceType = "m1.small" + InstanceTypeM1Medium InstanceType = "m1.medium" + InstanceTypeM1Large InstanceType = "m1.large" + InstanceTypeM1Xlarge InstanceType = "m1.xlarge" + InstanceTypeM3Medium InstanceType = "m3.medium" + InstanceTypeM3Large InstanceType = "m3.large" + InstanceTypeM3Xlarge InstanceType = "m3.xlarge" + InstanceTypeM32xlarge InstanceType = "m3.2xlarge" + InstanceTypeM4Large InstanceType = "m4.large" + InstanceTypeM4Xlarge InstanceType = "m4.xlarge" + InstanceTypeM42xlarge InstanceType = "m4.2xlarge" + InstanceTypeM44xlarge InstanceType = "m4.4xlarge" + InstanceTypeM410xlarge InstanceType = "m4.10xlarge" + InstanceTypeM416xlarge InstanceType = "m4.16xlarge" + InstanceTypeM2Xlarge InstanceType = "m2.xlarge" + InstanceTypeM22xlarge InstanceType = "m2.2xlarge" + InstanceTypeM24xlarge InstanceType = "m2.4xlarge" + InstanceTypeCr18xlarge InstanceType = "cr1.8xlarge" + InstanceTypeR3Large InstanceType = "r3.large" + InstanceTypeR3Xlarge InstanceType = "r3.xlarge" + InstanceTypeR32xlarge InstanceType = "r3.2xlarge" + InstanceTypeR34xlarge InstanceType = "r3.4xlarge" + InstanceTypeR38xlarge InstanceType = "r3.8xlarge" + InstanceTypeR4Large InstanceType = "r4.large" + InstanceTypeR4Xlarge InstanceType = "r4.xlarge" + InstanceTypeR42xlarge InstanceType = "r4.2xlarge" + InstanceTypeR44xlarge InstanceType = "r4.4xlarge" + InstanceTypeR48xlarge InstanceType = "r4.8xlarge" + InstanceTypeR416xlarge InstanceType = "r4.16xlarge" + InstanceTypeR5Large InstanceType = "r5.large" + InstanceTypeR5Xlarge InstanceType = "r5.xlarge" + InstanceTypeR52xlarge InstanceType = "r5.2xlarge" + InstanceTypeR54xlarge InstanceType = "r5.4xlarge" + InstanceTypeR58xlarge InstanceType = "r5.8xlarge" + InstanceTypeR512xlarge InstanceType = "r5.12xlarge" + InstanceTypeR516xlarge InstanceType = "r5.16xlarge" + InstanceTypeR524xlarge InstanceType = "r5.24xlarge" + InstanceTypeR5Metal InstanceType = "r5.metal" + InstanceTypeR5aLarge InstanceType = "r5a.large" + InstanceTypeR5aXlarge InstanceType = "r5a.xlarge" + InstanceTypeR5a2xlarge InstanceType = "r5a.2xlarge" + InstanceTypeR5a4xlarge InstanceType = "r5a.4xlarge" + InstanceTypeR5a8xlarge InstanceType = "r5a.8xlarge" + InstanceTypeR5a12xlarge InstanceType = "r5a.12xlarge" + InstanceTypeR5a16xlarge InstanceType = "r5a.16xlarge" + InstanceTypeR5a24xlarge InstanceType = "r5a.24xlarge" + InstanceTypeR5bLarge InstanceType = "r5b.large" + InstanceTypeR5bXlarge InstanceType = "r5b.xlarge" + InstanceTypeR5b2xlarge InstanceType = "r5b.2xlarge" + InstanceTypeR5b4xlarge InstanceType = "r5b.4xlarge" + InstanceTypeR5b8xlarge InstanceType = "r5b.8xlarge" + InstanceTypeR5b12xlarge InstanceType = "r5b.12xlarge" + InstanceTypeR5b16xlarge InstanceType = "r5b.16xlarge" + InstanceTypeR5b24xlarge InstanceType = "r5b.24xlarge" + InstanceTypeR5bMetal InstanceType = "r5b.metal" + InstanceTypeR5dLarge InstanceType = "r5d.large" + InstanceTypeR5dXlarge InstanceType = "r5d.xlarge" + InstanceTypeR5d2xlarge InstanceType = "r5d.2xlarge" + InstanceTypeR5d4xlarge InstanceType = "r5d.4xlarge" + InstanceTypeR5d8xlarge InstanceType = "r5d.8xlarge" + InstanceTypeR5d12xlarge InstanceType = "r5d.12xlarge" + InstanceTypeR5d16xlarge InstanceType = "r5d.16xlarge" + InstanceTypeR5d24xlarge InstanceType = "r5d.24xlarge" + InstanceTypeR5dMetal InstanceType = "r5d.metal" + InstanceTypeR5adLarge InstanceType = "r5ad.large" + InstanceTypeR5adXlarge InstanceType = "r5ad.xlarge" + InstanceTypeR5ad2xlarge InstanceType = "r5ad.2xlarge" + InstanceTypeR5ad4xlarge InstanceType = "r5ad.4xlarge" + InstanceTypeR5ad8xlarge InstanceType = "r5ad.8xlarge" + InstanceTypeR5ad12xlarge InstanceType = "r5ad.12xlarge" + InstanceTypeR5ad16xlarge InstanceType = "r5ad.16xlarge" + InstanceTypeR5ad24xlarge InstanceType = "r5ad.24xlarge" + InstanceTypeR6gMetal InstanceType = "r6g.metal" + InstanceTypeR6gMedium InstanceType = "r6g.medium" + InstanceTypeR6gLarge InstanceType = "r6g.large" + InstanceTypeR6gXlarge InstanceType = "r6g.xlarge" + InstanceTypeR6g2xlarge InstanceType = "r6g.2xlarge" + InstanceTypeR6g4xlarge InstanceType = "r6g.4xlarge" + InstanceTypeR6g8xlarge InstanceType = "r6g.8xlarge" + InstanceTypeR6g12xlarge InstanceType = "r6g.12xlarge" + InstanceTypeR6g16xlarge InstanceType = "r6g.16xlarge" + InstanceTypeR6gdMetal InstanceType = "r6gd.metal" + InstanceTypeR6gdMedium InstanceType = "r6gd.medium" + InstanceTypeR6gdLarge InstanceType = "r6gd.large" + InstanceTypeR6gdXlarge InstanceType = "r6gd.xlarge" + InstanceTypeR6gd2xlarge InstanceType = "r6gd.2xlarge" + InstanceTypeR6gd4xlarge InstanceType = "r6gd.4xlarge" + InstanceTypeR6gd8xlarge InstanceType = "r6gd.8xlarge" + InstanceTypeR6gd12xlarge InstanceType = "r6gd.12xlarge" + InstanceTypeR6gd16xlarge InstanceType = "r6gd.16xlarge" + InstanceTypeX116xlarge InstanceType = "x1.16xlarge" + InstanceTypeX132xlarge InstanceType = "x1.32xlarge" + InstanceTypeX1eXlarge InstanceType = "x1e.xlarge" + InstanceTypeX1e2xlarge InstanceType = "x1e.2xlarge" + InstanceTypeX1e4xlarge InstanceType = "x1e.4xlarge" + InstanceTypeX1e8xlarge InstanceType = "x1e.8xlarge" + InstanceTypeX1e16xlarge InstanceType = "x1e.16xlarge" + InstanceTypeX1e32xlarge InstanceType = "x1e.32xlarge" + InstanceTypeI2Xlarge InstanceType = "i2.xlarge" + InstanceTypeI22xlarge InstanceType = "i2.2xlarge" + InstanceTypeI24xlarge InstanceType = "i2.4xlarge" + InstanceTypeI28xlarge InstanceType = "i2.8xlarge" + InstanceTypeI3Large InstanceType = "i3.large" + InstanceTypeI3Xlarge InstanceType = "i3.xlarge" + InstanceTypeI32xlarge InstanceType = "i3.2xlarge" + InstanceTypeI34xlarge InstanceType = "i3.4xlarge" + InstanceTypeI38xlarge InstanceType = "i3.8xlarge" + InstanceTypeI316xlarge InstanceType = "i3.16xlarge" + InstanceTypeI3Metal InstanceType = "i3.metal" + InstanceTypeI3enLarge InstanceType = "i3en.large" + InstanceTypeI3enXlarge InstanceType = "i3en.xlarge" + InstanceTypeI3en2xlarge InstanceType = "i3en.2xlarge" + InstanceTypeI3en3xlarge InstanceType = "i3en.3xlarge" + InstanceTypeI3en6xlarge InstanceType = "i3en.6xlarge" + InstanceTypeI3en12xlarge InstanceType = "i3en.12xlarge" + InstanceTypeI3en24xlarge InstanceType = "i3en.24xlarge" + InstanceTypeI3enMetal InstanceType = "i3en.metal" + InstanceTypeHi14xlarge InstanceType = "hi1.4xlarge" + InstanceTypeHs18xlarge InstanceType = "hs1.8xlarge" + InstanceTypeC1Medium InstanceType = "c1.medium" + InstanceTypeC1Xlarge InstanceType = "c1.xlarge" + InstanceTypeC3Large InstanceType = "c3.large" + InstanceTypeC3Xlarge InstanceType = "c3.xlarge" + InstanceTypeC32xlarge InstanceType = "c3.2xlarge" + InstanceTypeC34xlarge InstanceType = "c3.4xlarge" + InstanceTypeC38xlarge InstanceType = "c3.8xlarge" + InstanceTypeC4Large InstanceType = "c4.large" + InstanceTypeC4Xlarge InstanceType = "c4.xlarge" + InstanceTypeC42xlarge InstanceType = "c4.2xlarge" + InstanceTypeC44xlarge InstanceType = "c4.4xlarge" + InstanceTypeC48xlarge InstanceType = "c4.8xlarge" + InstanceTypeC5Large InstanceType = "c5.large" + InstanceTypeC5Xlarge InstanceType = "c5.xlarge" + InstanceTypeC52xlarge InstanceType = "c5.2xlarge" + InstanceTypeC54xlarge InstanceType = "c5.4xlarge" + InstanceTypeC59xlarge InstanceType = "c5.9xlarge" + InstanceTypeC512xlarge InstanceType = "c5.12xlarge" + InstanceTypeC518xlarge InstanceType = "c5.18xlarge" + InstanceTypeC524xlarge InstanceType = "c5.24xlarge" + InstanceTypeC5Metal InstanceType = "c5.metal" + InstanceTypeC5aLarge InstanceType = "c5a.large" + InstanceTypeC5aXlarge InstanceType = "c5a.xlarge" + InstanceTypeC5a2xlarge InstanceType = "c5a.2xlarge" + InstanceTypeC5a4xlarge InstanceType = "c5a.4xlarge" + InstanceTypeC5a8xlarge InstanceType = "c5a.8xlarge" + InstanceTypeC5a12xlarge InstanceType = "c5a.12xlarge" + InstanceTypeC5a16xlarge InstanceType = "c5a.16xlarge" + InstanceTypeC5a24xlarge InstanceType = "c5a.24xlarge" + InstanceTypeC5adLarge InstanceType = "c5ad.large" + InstanceTypeC5adXlarge InstanceType = "c5ad.xlarge" + InstanceTypeC5ad2xlarge InstanceType = "c5ad.2xlarge" + InstanceTypeC5ad4xlarge InstanceType = "c5ad.4xlarge" + InstanceTypeC5ad8xlarge InstanceType = "c5ad.8xlarge" + InstanceTypeC5ad12xlarge InstanceType = "c5ad.12xlarge" + InstanceTypeC5ad16xlarge InstanceType = "c5ad.16xlarge" + InstanceTypeC5ad24xlarge InstanceType = "c5ad.24xlarge" + InstanceTypeC5dLarge InstanceType = "c5d.large" + InstanceTypeC5dXlarge InstanceType = "c5d.xlarge" + InstanceTypeC5d2xlarge InstanceType = "c5d.2xlarge" + InstanceTypeC5d4xlarge InstanceType = "c5d.4xlarge" + InstanceTypeC5d9xlarge InstanceType = "c5d.9xlarge" + InstanceTypeC5d12xlarge InstanceType = "c5d.12xlarge" + InstanceTypeC5d18xlarge InstanceType = "c5d.18xlarge" + InstanceTypeC5d24xlarge InstanceType = "c5d.24xlarge" + InstanceTypeC5dMetal InstanceType = "c5d.metal" + InstanceTypeC5nLarge InstanceType = "c5n.large" + InstanceTypeC5nXlarge InstanceType = "c5n.xlarge" + InstanceTypeC5n2xlarge InstanceType = "c5n.2xlarge" + InstanceTypeC5n4xlarge InstanceType = "c5n.4xlarge" + InstanceTypeC5n9xlarge InstanceType = "c5n.9xlarge" + InstanceTypeC5n18xlarge InstanceType = "c5n.18xlarge" + InstanceTypeC5nMetal InstanceType = "c5n.metal" + InstanceTypeC6gMetal InstanceType = "c6g.metal" + InstanceTypeC6gMedium InstanceType = "c6g.medium" + InstanceTypeC6gLarge InstanceType = "c6g.large" + InstanceTypeC6gXlarge InstanceType = "c6g.xlarge" + InstanceTypeC6g2xlarge InstanceType = "c6g.2xlarge" + InstanceTypeC6g4xlarge InstanceType = "c6g.4xlarge" + InstanceTypeC6g8xlarge InstanceType = "c6g.8xlarge" + InstanceTypeC6g12xlarge InstanceType = "c6g.12xlarge" + InstanceTypeC6g16xlarge InstanceType = "c6g.16xlarge" + InstanceTypeC6gdMetal InstanceType = "c6gd.metal" + InstanceTypeC6gdMedium InstanceType = "c6gd.medium" + InstanceTypeC6gdLarge InstanceType = "c6gd.large" + InstanceTypeC6gdXlarge InstanceType = "c6gd.xlarge" + InstanceTypeC6gd2xlarge InstanceType = "c6gd.2xlarge" + InstanceTypeC6gd4xlarge InstanceType = "c6gd.4xlarge" + InstanceTypeC6gd8xlarge InstanceType = "c6gd.8xlarge" + InstanceTypeC6gd12xlarge InstanceType = "c6gd.12xlarge" + InstanceTypeC6gd16xlarge InstanceType = "c6gd.16xlarge" + InstanceTypeC6gnMedium InstanceType = "c6gn.medium" + InstanceTypeC6gnLarge InstanceType = "c6gn.large" + InstanceTypeC6gnXlarge InstanceType = "c6gn.xlarge" + InstanceTypeC6gn2xlarge InstanceType = "c6gn.2xlarge" + InstanceTypeC6gn4xlarge InstanceType = "c6gn.4xlarge" + InstanceTypeC6gn8xlarge InstanceType = "c6gn.8xlarge" + InstanceTypeC6gn12xlarge InstanceType = "c6gn.12xlarge" + InstanceTypeC6gn16xlarge InstanceType = "c6gn.16xlarge" + InstanceTypeC6gnMetal InstanceType = "c6gn.metal" + InstanceTypeCc14xlarge InstanceType = "cc1.4xlarge" + InstanceTypeCc28xlarge InstanceType = "cc2.8xlarge" + InstanceTypeG22xlarge InstanceType = "g2.2xlarge" + InstanceTypeG28xlarge InstanceType = "g2.8xlarge" + InstanceTypeG34xlarge InstanceType = "g3.4xlarge" + InstanceTypeG38xlarge InstanceType = "g3.8xlarge" + InstanceTypeG316xlarge InstanceType = "g3.16xlarge" + InstanceTypeG3sXlarge InstanceType = "g3s.xlarge" + InstanceTypeG4adXlarge InstanceType = "g4ad.xlarge" + InstanceTypeG4ad2xlarge InstanceType = "g4ad.2xlarge" + InstanceTypeG4ad4xlarge InstanceType = "g4ad.4xlarge" + InstanceTypeG4ad8xlarge InstanceType = "g4ad.8xlarge" + InstanceTypeG4ad16xlarge InstanceType = "g4ad.16xlarge" + InstanceTypeG4dnXlarge InstanceType = "g4dn.xlarge" + InstanceTypeG4dn2xlarge InstanceType = "g4dn.2xlarge" + InstanceTypeG4dn4xlarge InstanceType = "g4dn.4xlarge" + InstanceTypeG4dn8xlarge InstanceType = "g4dn.8xlarge" + InstanceTypeG4dn12xlarge InstanceType = "g4dn.12xlarge" + InstanceTypeG4dn16xlarge InstanceType = "g4dn.16xlarge" + InstanceTypeG4dnMetal InstanceType = "g4dn.metal" + InstanceTypeCg14xlarge InstanceType = "cg1.4xlarge" + InstanceTypeP2Xlarge InstanceType = "p2.xlarge" + InstanceTypeP28xlarge InstanceType = "p2.8xlarge" + InstanceTypeP216xlarge InstanceType = "p2.16xlarge" + InstanceTypeP32xlarge InstanceType = "p3.2xlarge" + InstanceTypeP38xlarge InstanceType = "p3.8xlarge" + InstanceTypeP316xlarge InstanceType = "p3.16xlarge" + InstanceTypeP3dn24xlarge InstanceType = "p3dn.24xlarge" + InstanceTypeP4d24xlarge InstanceType = "p4d.24xlarge" + InstanceTypeD2Xlarge InstanceType = "d2.xlarge" + InstanceTypeD22xlarge InstanceType = "d2.2xlarge" + InstanceTypeD24xlarge InstanceType = "d2.4xlarge" + InstanceTypeD28xlarge InstanceType = "d2.8xlarge" + InstanceTypeD3Xlarge InstanceType = "d3.xlarge" + InstanceTypeD32xlarge InstanceType = "d3.2xlarge" + InstanceTypeD34xlarge InstanceType = "d3.4xlarge" + InstanceTypeD38xlarge InstanceType = "d3.8xlarge" + InstanceTypeD3Metal InstanceType = "d3.metal" + InstanceTypeD3enLarge InstanceType = "d3en.large" + InstanceTypeD3enXlarge InstanceType = "d3en.xlarge" + InstanceTypeD3en2xlarge InstanceType = "d3en.2xlarge" + InstanceTypeD3en4xlarge InstanceType = "d3en.4xlarge" + InstanceTypeD3en6xlarge InstanceType = "d3en.6xlarge" + InstanceTypeD3en8xlarge InstanceType = "d3en.8xlarge" + InstanceTypeD3en12xlarge InstanceType = "d3en.12xlarge" + InstanceTypeD3enMetal InstanceType = "d3en.metal" + InstanceTypeF12xlarge InstanceType = "f1.2xlarge" + InstanceTypeF14xlarge InstanceType = "f1.4xlarge" + InstanceTypeF116xlarge InstanceType = "f1.16xlarge" + InstanceTypeM5Large InstanceType = "m5.large" + InstanceTypeM5Xlarge InstanceType = "m5.xlarge" + InstanceTypeM52xlarge InstanceType = "m5.2xlarge" + InstanceTypeM54xlarge InstanceType = "m5.4xlarge" + InstanceTypeM58xlarge InstanceType = "m5.8xlarge" + InstanceTypeM512xlarge InstanceType = "m5.12xlarge" + InstanceTypeM516xlarge InstanceType = "m5.16xlarge" + InstanceTypeM524xlarge InstanceType = "m5.24xlarge" + InstanceTypeM5Metal InstanceType = "m5.metal" + InstanceTypeM5aLarge InstanceType = "m5a.large" + InstanceTypeM5aXlarge InstanceType = "m5a.xlarge" + InstanceTypeM5a2xlarge InstanceType = "m5a.2xlarge" + InstanceTypeM5a4xlarge InstanceType = "m5a.4xlarge" + InstanceTypeM5a8xlarge InstanceType = "m5a.8xlarge" + InstanceTypeM5a12xlarge InstanceType = "m5a.12xlarge" + InstanceTypeM5a16xlarge InstanceType = "m5a.16xlarge" + InstanceTypeM5a24xlarge InstanceType = "m5a.24xlarge" + InstanceTypeM5dLarge InstanceType = "m5d.large" + InstanceTypeM5dXlarge InstanceType = "m5d.xlarge" + InstanceTypeM5d2xlarge InstanceType = "m5d.2xlarge" + InstanceTypeM5d4xlarge InstanceType = "m5d.4xlarge" + InstanceTypeM5d8xlarge InstanceType = "m5d.8xlarge" + InstanceTypeM5d12xlarge InstanceType = "m5d.12xlarge" + InstanceTypeM5d16xlarge InstanceType = "m5d.16xlarge" + InstanceTypeM5d24xlarge InstanceType = "m5d.24xlarge" + InstanceTypeM5dMetal InstanceType = "m5d.metal" + InstanceTypeM5adLarge InstanceType = "m5ad.large" + InstanceTypeM5adXlarge InstanceType = "m5ad.xlarge" + InstanceTypeM5ad2xlarge InstanceType = "m5ad.2xlarge" + InstanceTypeM5ad4xlarge InstanceType = "m5ad.4xlarge" + InstanceTypeM5ad8xlarge InstanceType = "m5ad.8xlarge" + InstanceTypeM5ad12xlarge InstanceType = "m5ad.12xlarge" + InstanceTypeM5ad16xlarge InstanceType = "m5ad.16xlarge" + InstanceTypeM5ad24xlarge InstanceType = "m5ad.24xlarge" + InstanceTypeM5znLarge InstanceType = "m5zn.large" + InstanceTypeM5znXlarge InstanceType = "m5zn.xlarge" + InstanceTypeM5zn2xlarge InstanceType = "m5zn.2xlarge" + InstanceTypeM5zn3xlarge InstanceType = "m5zn.3xlarge" + InstanceTypeM5zn6xlarge InstanceType = "m5zn.6xlarge" + InstanceTypeM5zn12xlarge InstanceType = "m5zn.12xlarge" + InstanceTypeM5znMetal InstanceType = "m5zn.metal" + InstanceTypeH12xlarge InstanceType = "h1.2xlarge" + InstanceTypeH14xlarge InstanceType = "h1.4xlarge" + InstanceTypeH18xlarge InstanceType = "h1.8xlarge" + InstanceTypeH116xlarge InstanceType = "h1.16xlarge" + InstanceTypeHpc5a48xlarge InstanceType = "hpc5a.48xlarge" + InstanceTypeZ1dLarge InstanceType = "z1d.large" + InstanceTypeZ1dXlarge InstanceType = "z1d.xlarge" + InstanceTypeZ1d2xlarge InstanceType = "z1d.2xlarge" + InstanceTypeZ1d3xlarge InstanceType = "z1d.3xlarge" + InstanceTypeZ1d6xlarge InstanceType = "z1d.6xlarge" + InstanceTypeZ1d12xlarge InstanceType = "z1d.12xlarge" + InstanceTypeZ1dMetal InstanceType = "z1d.metal" + InstanceTypeU6tb1Metal InstanceType = "u-6tb1.metal" + InstanceTypeU9tb1Metal InstanceType = "u-9tb1.metal" + InstanceTypeU12tb1Metal InstanceType = "u-12tb1.metal" + InstanceTypeU18tb1Metal InstanceType = "u-18tb1.metal" + InstanceTypeU24tb1Metal InstanceType = "u-24tb1.metal" + InstanceTypeA1Medium InstanceType = "a1.medium" + InstanceTypeA1Large InstanceType = "a1.large" + InstanceTypeA1Xlarge InstanceType = "a1.xlarge" + InstanceTypeA12xlarge InstanceType = "a1.2xlarge" + InstanceTypeA14xlarge InstanceType = "a1.4xlarge" + InstanceTypeA1Metal InstanceType = "a1.metal" + InstanceTypeM5dnLarge InstanceType = "m5dn.large" + InstanceTypeM5dnXlarge InstanceType = "m5dn.xlarge" + InstanceTypeM5dn2xlarge InstanceType = "m5dn.2xlarge" + InstanceTypeM5dn4xlarge InstanceType = "m5dn.4xlarge" + InstanceTypeM5dn8xlarge InstanceType = "m5dn.8xlarge" + InstanceTypeM5dn12xlarge InstanceType = "m5dn.12xlarge" + InstanceTypeM5dn16xlarge InstanceType = "m5dn.16xlarge" + InstanceTypeM5dn24xlarge InstanceType = "m5dn.24xlarge" + InstanceTypeM5nLarge InstanceType = "m5n.large" + InstanceTypeM5nXlarge InstanceType = "m5n.xlarge" + InstanceTypeM5n2xlarge InstanceType = "m5n.2xlarge" + InstanceTypeM5n4xlarge InstanceType = "m5n.4xlarge" + InstanceTypeM5n8xlarge InstanceType = "m5n.8xlarge" + InstanceTypeM5n12xlarge InstanceType = "m5n.12xlarge" + InstanceTypeM5n16xlarge InstanceType = "m5n.16xlarge" + InstanceTypeM5n24xlarge InstanceType = "m5n.24xlarge" + InstanceTypeR5dnLarge InstanceType = "r5dn.large" + InstanceTypeR5dnXlarge InstanceType = "r5dn.xlarge" + InstanceTypeR5dn2xlarge InstanceType = "r5dn.2xlarge" + InstanceTypeR5dn4xlarge InstanceType = "r5dn.4xlarge" + InstanceTypeR5dn8xlarge InstanceType = "r5dn.8xlarge" + InstanceTypeR5dn12xlarge InstanceType = "r5dn.12xlarge" + InstanceTypeR5dn16xlarge InstanceType = "r5dn.16xlarge" + InstanceTypeR5dn24xlarge InstanceType = "r5dn.24xlarge" + InstanceTypeR5nLarge InstanceType = "r5n.large" + InstanceTypeR5nXlarge InstanceType = "r5n.xlarge" + InstanceTypeR5n2xlarge InstanceType = "r5n.2xlarge" + InstanceTypeR5n4xlarge InstanceType = "r5n.4xlarge" + InstanceTypeR5n8xlarge InstanceType = "r5n.8xlarge" + InstanceTypeR5n12xlarge InstanceType = "r5n.12xlarge" + InstanceTypeR5n16xlarge InstanceType = "r5n.16xlarge" + InstanceTypeR5n24xlarge InstanceType = "r5n.24xlarge" + InstanceTypeInf1Xlarge InstanceType = "inf1.xlarge" + InstanceTypeInf12xlarge InstanceType = "inf1.2xlarge" + InstanceTypeInf16xlarge InstanceType = "inf1.6xlarge" + InstanceTypeInf124xlarge InstanceType = "inf1.24xlarge" + InstanceTypeM6gMetal InstanceType = "m6g.metal" + InstanceTypeM6gMedium InstanceType = "m6g.medium" + InstanceTypeM6gLarge InstanceType = "m6g.large" + InstanceTypeM6gXlarge InstanceType = "m6g.xlarge" + InstanceTypeM6g2xlarge InstanceType = "m6g.2xlarge" + InstanceTypeM6g4xlarge InstanceType = "m6g.4xlarge" + InstanceTypeM6g8xlarge InstanceType = "m6g.8xlarge" + InstanceTypeM6g12xlarge InstanceType = "m6g.12xlarge" + InstanceTypeM6g16xlarge InstanceType = "m6g.16xlarge" + InstanceTypeM6gdMetal InstanceType = "m6gd.metal" + InstanceTypeM6gdMedium InstanceType = "m6gd.medium" + InstanceTypeM6gdLarge InstanceType = "m6gd.large" + InstanceTypeM6gdXlarge InstanceType = "m6gd.xlarge" + InstanceTypeM6gd2xlarge InstanceType = "m6gd.2xlarge" + InstanceTypeM6gd4xlarge InstanceType = "m6gd.4xlarge" + InstanceTypeM6gd8xlarge InstanceType = "m6gd.8xlarge" + InstanceTypeM6gd12xlarge InstanceType = "m6gd.12xlarge" + InstanceTypeM6gd16xlarge InstanceType = "m6gd.16xlarge" + InstanceTypeMac1Metal InstanceType = "mac1.metal" +) + // Values returns all known values for InstanceType. 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. @@ -1986,6 +2904,12 @@ func (InstanceTypeHypervisor) Values() []InstanceTypeHypervisor { type InterfacePermissionType string +// Enum values for InterfacePermissionType +const ( + InterfacePermissionTypeInstanceAttach InterfacePermissionType = "INSTANCE-ATTACH" + InterfacePermissionTypeEipAssociate InterfacePermissionType = "EIP-ASSOCIATE" +) + // Values returns all known values for InterfacePermissionType. 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. @@ -1998,6 +2922,12 @@ func (InterfacePermissionType) Values() []InterfacePermissionType { type Ipv6SupportValue string +// Enum values for Ipv6SupportValue +const ( + Ipv6SupportValueEnable Ipv6SupportValue = "enable" + Ipv6SupportValueDisable Ipv6SupportValue = "disable" +) + // Values returns all known values for Ipv6SupportValue. 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. @@ -2055,6 +2985,12 @@ func (LaunchTemplateHttpTokensState) Values() []LaunchTemplateHttpTokensState { type LaunchTemplateInstanceMetadataEndpointState string +// Enum values for LaunchTemplateInstanceMetadataEndpointState +const ( + LaunchTemplateInstanceMetadataEndpointStateDisabled LaunchTemplateInstanceMetadataEndpointState = "disabled" + LaunchTemplateInstanceMetadataEndpointStateEnabled LaunchTemplateInstanceMetadataEndpointState = "enabled" +) + // Values returns all known values for LaunchTemplateInstanceMetadataEndpointState. // 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 @@ -2068,6 +3004,12 @@ func (LaunchTemplateInstanceMetadataEndpointState) Values() []LaunchTemplateInst type LaunchTemplateInstanceMetadataOptionsState string +// Enum values for LaunchTemplateInstanceMetadataOptionsState +const ( + LaunchTemplateInstanceMetadataOptionsStatePending LaunchTemplateInstanceMetadataOptionsState = "pending" + LaunchTemplateInstanceMetadataOptionsStateApplied LaunchTemplateInstanceMetadataOptionsState = "applied" +) + // Values returns all known values for LaunchTemplateInstanceMetadataOptionsState. // 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 @@ -2081,6 +3023,14 @@ func (LaunchTemplateInstanceMetadataOptionsState) Values() []LaunchTemplateInsta type ListingState string +// Enum values for ListingState +const ( + ListingStateAvailable ListingState = "available" + ListingStateSold ListingState = "sold" + ListingStateCancelled ListingState = "cancelled" + ListingStatePending ListingState = "pending" +) + // Values returns all known values for ListingState. 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. @@ -2095,6 +3045,14 @@ func (ListingState) Values() []ListingState { type ListingStatus string +// Enum values for ListingStatus +const ( + ListingStatusActive ListingStatus = "active" + ListingStatusPending ListingStatus = "pending" + ListingStatusCancelled ListingStatus = "cancelled" + ListingStatusClosed ListingStatus = "closed" +) + // Values returns all known values for ListingStatus. 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. @@ -2109,6 +3067,15 @@ func (ListingStatus) Values() []ListingStatus { type LocalGatewayRouteState string +// Enum values for LocalGatewayRouteState +const ( + LocalGatewayRouteStatePending LocalGatewayRouteState = "pending" + LocalGatewayRouteStateActive LocalGatewayRouteState = "active" + LocalGatewayRouteStateBlackhole LocalGatewayRouteState = "blackhole" + LocalGatewayRouteStateDeleting LocalGatewayRouteState = "deleting" + LocalGatewayRouteStateDeleted LocalGatewayRouteState = "deleted" +) + // Values returns all known values for LocalGatewayRouteState. 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. @@ -2124,6 +3091,12 @@ func (LocalGatewayRouteState) Values() []LocalGatewayRouteState { type LocalGatewayRouteType string +// Enum values for LocalGatewayRouteType +const ( + LocalGatewayRouteTypeStatic LocalGatewayRouteType = "static" + LocalGatewayRouteTypePropagated LocalGatewayRouteType = "propagated" +) + // Values returns all known values for LocalGatewayRouteType. 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. @@ -2136,6 +3109,13 @@ func (LocalGatewayRouteType) Values() []LocalGatewayRouteType { type LocationType string +// Enum values for LocationType +const ( + LocationTypeRegion LocationType = "region" + LocationTypeAvailabilityZone LocationType = "availability-zone" + LocationTypeAvailabilityZoneId LocationType = "availability-zone-id" +) + // Values returns all known values for LocationType. 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. @@ -2149,6 +3129,12 @@ func (LocationType) Values() []LocationType { type LogDestinationType string +// Enum values for LogDestinationType +const ( + LogDestinationTypeCloudWatchLogs LogDestinationType = "cloud-watch-logs" + LogDestinationTypeS3 LogDestinationType = "s3" +) + // Values returns all known values for LogDestinationType. 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. @@ -2161,6 +3147,11 @@ func (LogDestinationType) Values() []LogDestinationType { type MarketType string +// Enum values for MarketType +const ( + MarketTypeSpot MarketType = "spot" +) + // Values returns all known values for MarketType. 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. @@ -2172,6 +3163,12 @@ func (MarketType) Values() []MarketType { type MembershipType string +// Enum values for MembershipType +const ( + MembershipTypeStatic MembershipType = "static" + MembershipTypeIgmp MembershipType = "igmp" +) + // Values returns all known values for MembershipType. 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. @@ -2184,7 +3181,13 @@ func (MembershipType) Values() []MembershipType { type ModifyAvailabilityZoneOptInStatus string -// Values returns all known values for ModifyAvailabilityZoneOptInStatus. Note that +// Enum values for ModifyAvailabilityZoneOptInStatus +const ( + ModifyAvailabilityZoneOptInStatusOptedIn ModifyAvailabilityZoneOptInStatus = "opted-in" + ModifyAvailabilityZoneOptInStatusNotOptedIn ModifyAvailabilityZoneOptInStatus = "not-opted-in" +) + +// Values returns all known values for ModifyAvailabilityZoneOptInStatus. 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. @@ -2197,6 +3200,14 @@ func (ModifyAvailabilityZoneOptInStatus) Values() []ModifyAvailabilityZoneOptInS type MonitoringState string +// Enum values for MonitoringState +const ( + MonitoringStateDisabled MonitoringState = "disabled" + MonitoringStateDisabling MonitoringState = "disabling" + MonitoringStateEnabled MonitoringState = "enabled" + MonitoringStatePending MonitoringState = "pending" +) + // Values returns all known values for MonitoringState. 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. @@ -2211,6 +3222,12 @@ func (MonitoringState) Values() []MonitoringState { type MoveStatus string +// Enum values for MoveStatus +const ( + MoveStatusMovingtovpc MoveStatus = "movingToVpc" + MoveStatusRestoringtoclassic MoveStatus = "restoringToClassic" +) + // Values returns all known values for MoveStatus. 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. @@ -2223,6 +3240,12 @@ func (MoveStatus) Values() []MoveStatus { type MulticastSupportValue string +// Enum values for MulticastSupportValue +const ( + MulticastSupportValueEnable MulticastSupportValue = "enable" + MulticastSupportValueDisable MulticastSupportValue = "disable" +) + // Values returns all known values for MulticastSupportValue. 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. @@ -2259,6 +3282,14 @@ func (NatGatewayState) Values() []NatGatewayState { type NetworkInterfaceAttribute string +// Enum values for NetworkInterfaceAttribute +const ( + NetworkInterfaceAttributeDescription NetworkInterfaceAttribute = "description" + NetworkInterfaceAttributeGroupset NetworkInterfaceAttribute = "groupSet" + NetworkInterfaceAttributeSourcedestcheck NetworkInterfaceAttribute = "sourceDestCheck" + NetworkInterfaceAttributeAttachment NetworkInterfaceAttribute = "attachment" +) + // Values returns all known values for NetworkInterfaceAttribute. 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. @@ -2273,6 +3304,11 @@ func (NetworkInterfaceAttribute) Values() []NetworkInterfaceAttribute { type NetworkInterfaceCreationType string +// Enum values for NetworkInterfaceCreationType +const ( + NetworkInterfaceCreationTypeEfa NetworkInterfaceCreationType = "efa" +) + // Values returns all known values for NetworkInterfaceCreationType. 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. @@ -2284,6 +3320,14 @@ func (NetworkInterfaceCreationType) Values() []NetworkInterfaceCreationType { type NetworkInterfacePermissionStateCode string +// Enum values for NetworkInterfacePermissionStateCode +const ( + NetworkInterfacePermissionStateCodePending NetworkInterfacePermissionStateCode = "pending" + NetworkInterfacePermissionStateCodeGranted NetworkInterfacePermissionStateCode = "granted" + NetworkInterfacePermissionStateCodeRevoking NetworkInterfacePermissionStateCode = "revoking" + NetworkInterfacePermissionStateCodeRevoked NetworkInterfacePermissionStateCode = "revoked" +) + // Values returns all known values for NetworkInterfacePermissionStateCode. 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 @@ -2299,6 +3343,15 @@ func (NetworkInterfacePermissionStateCode) Values() []NetworkInterfacePermission type NetworkInterfaceStatus string +// Enum values for NetworkInterfaceStatus +const ( + NetworkInterfaceStatusAvailable NetworkInterfaceStatus = "available" + NetworkInterfaceStatusAssociated NetworkInterfaceStatus = "associated" + NetworkInterfaceStatusAttaching NetworkInterfaceStatus = "attaching" + NetworkInterfaceStatusInUse NetworkInterfaceStatus = "in-use" + NetworkInterfaceStatusDetaching NetworkInterfaceStatus = "detaching" +) + // Values returns all known values for NetworkInterfaceStatus. 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. @@ -2314,6 +3367,13 @@ func (NetworkInterfaceStatus) Values() []NetworkInterfaceStatus { type NetworkInterfaceType string +// Enum values for NetworkInterfaceType +const ( + NetworkInterfaceTypeInterface NetworkInterfaceType = "interface" + NetworkInterfaceTypeNatgateway NetworkInterfaceType = "natGateway" + NetworkInterfaceTypeEfa NetworkInterfaceType = "efa" +) + // Values returns all known values for NetworkInterfaceType. 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. @@ -2345,6 +3405,16 @@ func (OfferingClassType) Values() []OfferingClassType { type OfferingTypeValues string +// Enum values for OfferingTypeValues +const ( + OfferingTypeValuesHeavyUtilization OfferingTypeValues = "Heavy Utilization" + OfferingTypeValuesMediumUtilization OfferingTypeValues = "Medium Utilization" + OfferingTypeValuesLightUtilization OfferingTypeValues = "Light Utilization" + OfferingTypeValuesNoUpfront OfferingTypeValues = "No Upfront" + OfferingTypeValuesPartialUpfront OfferingTypeValues = "Partial Upfront" + OfferingTypeValuesAllUpfront OfferingTypeValues = "All Upfront" +) + // Values returns all known values for OfferingTypeValues. 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. @@ -2379,6 +3449,12 @@ func (OnDemandAllocationStrategy) Values() []OnDemandAllocationStrategy { type OperationType string +// Enum values for OperationType +const ( + OperationTypeAdd OperationType = "add" + OperationTypeRemove OperationType = "remove" +) + // Values returns all known values for OperationType. 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. @@ -2411,6 +3487,11 @@ func (PaymentOption) Values() []PaymentOption { type PermissionGroup string +// Enum values for PermissionGroup +const ( + PermissionGroupAll PermissionGroup = "all" +) + // Values returns all known values for PermissionGroup. 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. @@ -2422,6 +3503,14 @@ func (PermissionGroup) Values() []PermissionGroup { type PlacementGroupState string +// Enum values for PlacementGroupState +const ( + PlacementGroupStatePending PlacementGroupState = "pending" + PlacementGroupStateAvailable PlacementGroupState = "available" + PlacementGroupStateDeleting PlacementGroupState = "deleting" + PlacementGroupStateDeleted PlacementGroupState = "deleted" +) + // Values returns all known values for PlacementGroupState. 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. @@ -2436,6 +3525,13 @@ func (PlacementGroupState) Values() []PlacementGroupState { type PlacementGroupStrategy string +// Enum values for PlacementGroupStrategy +const ( + PlacementGroupStrategyCluster PlacementGroupStrategy = "cluster" + PlacementGroupStrategyPartition PlacementGroupStrategy = "partition" + PlacementGroupStrategySpread PlacementGroupStrategy = "spread" +) + // Values returns all known values for PlacementGroupStrategy. 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. @@ -2449,6 +3545,13 @@ func (PlacementGroupStrategy) Values() []PlacementGroupStrategy { type PlacementStrategy string +// Enum values for PlacementStrategy +const ( + PlacementStrategyCluster PlacementStrategy = "cluster" + PlacementStrategySpread PlacementStrategy = "spread" + PlacementStrategyPartition PlacementStrategy = "partition" +) + // Values returns all known values for PlacementStrategy. 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. @@ -2462,6 +3565,11 @@ func (PlacementStrategy) Values() []PlacementStrategy { type PlatformValues string +// Enum values for PlatformValues +const ( + PlatformValuesWindows PlatformValues = "Windows" +) + // Values returns all known values for PlatformValues. 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. @@ -2473,6 +3581,22 @@ func (PlatformValues) Values() []PlatformValues { type PrefixListState string +// Enum values for PrefixListState +const ( + PrefixListStateCreateInProgress PrefixListState = "create-in-progress" + PrefixListStateCreateComplete PrefixListState = "create-complete" + PrefixListStateCreateFailed PrefixListState = "create-failed" + PrefixListStateModifyInProgress PrefixListState = "modify-in-progress" + PrefixListStateModifyComplete PrefixListState = "modify-complete" + PrefixListStateModifyFailed PrefixListState = "modify-failed" + PrefixListStateRestoreInProgress PrefixListState = "restore-in-progress" + PrefixListStateRestoreComplete PrefixListState = "restore-complete" + PrefixListStateRestoreFailed PrefixListState = "restore-failed" + PrefixListStateDeleteInProgress PrefixListState = "delete-in-progress" + PrefixListStateDeleteComplete PrefixListState = "delete-complete" + PrefixListStateDeleteFailed PrefixListState = "delete-failed" +) + // Values returns all known values for PrefixListState. 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. @@ -2521,6 +3645,12 @@ func (PrincipalType) Values() []PrincipalType { type ProductCodeValues string +// Enum values for ProductCodeValues +const ( + ProductCodeValuesDevpay ProductCodeValues = "devpay" + ProductCodeValuesMarketplace ProductCodeValues = "marketplace" +) + // Values returns all known values for ProductCodeValues. 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. @@ -2533,6 +3663,12 @@ func (ProductCodeValues) Values() []ProductCodeValues { type Protocol string +// Enum values for Protocol +const ( + ProtocolTcp Protocol = "tcp" + ProtocolUdp Protocol = "udp" +) + // Values returns all known values for Protocol. Note that this can be expanded in // the future, and so it is only as up to date as the client. The ordering of this // slice is not guaranteed to be stable across updates. @@ -2545,6 +3681,11 @@ func (Protocol) Values() []Protocol { type ProtocolValue string +// Enum values for ProtocolValue +const ( + ProtocolValueGre ProtocolValue = "gre" +) + // Values returns all known values for ProtocolValue. 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. @@ -2556,6 +3697,11 @@ func (ProtocolValue) Values() []ProtocolValue { type RecurringChargeFrequency string +// Enum values for RecurringChargeFrequency +const ( + RecurringChargeFrequencyHourly RecurringChargeFrequency = "Hourly" +) + // Values returns all known values for RecurringChargeFrequency. 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. @@ -2583,6 +3729,19 @@ func (ReplacementStrategy) Values() []ReplacementStrategy { type ReportInstanceReasonCodes string +// Enum values for ReportInstanceReasonCodes +const ( + ReportInstanceReasonCodesInstanceStuckInState ReportInstanceReasonCodes = "instance-stuck-in-state" + ReportInstanceReasonCodesUnresponsive ReportInstanceReasonCodes = "unresponsive" + ReportInstanceReasonCodesNotAcceptingCredentials ReportInstanceReasonCodes = "not-accepting-credentials" + ReportInstanceReasonCodesPasswordNotAvailable ReportInstanceReasonCodes = "password-not-available" + ReportInstanceReasonCodesPerformanceNetwork ReportInstanceReasonCodes = "performance-network" + ReportInstanceReasonCodesPerformanceInstanceStore ReportInstanceReasonCodes = "performance-instance-store" + ReportInstanceReasonCodesPerformanceEbsVolume ReportInstanceReasonCodes = "performance-ebs-volume" + ReportInstanceReasonCodesPerformanceOther ReportInstanceReasonCodes = "performance-other" + ReportInstanceReasonCodesOther ReportInstanceReasonCodes = "other" +) + // Values returns all known values for ReportInstanceReasonCodes. 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. @@ -2602,6 +3761,12 @@ func (ReportInstanceReasonCodes) Values() []ReportInstanceReasonCodes { type ReportStatusType string +// Enum values for ReportStatusType +const ( + ReportStatusTypeOk ReportStatusType = "ok" + ReportStatusTypeImpaired ReportStatusType = "impaired" +) + // Values returns all known values for ReportStatusType. 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. @@ -2636,6 +3801,16 @@ func (ReservationState) Values() []ReservationState { type ReservedInstanceState string +// Enum values for ReservedInstanceState +const ( + ReservedInstanceStatePaymentPending ReservedInstanceState = "payment-pending" + ReservedInstanceStateActive ReservedInstanceState = "active" + ReservedInstanceStatePaymentFailed ReservedInstanceState = "payment-failed" + ReservedInstanceStateRetired ReservedInstanceState = "retired" + ReservedInstanceStateQueued ReservedInstanceState = "queued" + ReservedInstanceStateQueuedDeleted ReservedInstanceState = "queued-deleted" +) + // Values returns all known values for ReservedInstanceState. 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. @@ -2652,6 +3827,11 @@ func (ReservedInstanceState) Values() []ReservedInstanceState { type ResetFpgaImageAttributeName string +// Enum values for ResetFpgaImageAttributeName +const ( + ResetFpgaImageAttributeNameLoadpermission ResetFpgaImageAttributeName = "loadPermission" +) + // Values returns all known values for ResetFpgaImageAttributeName. 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. @@ -2663,6 +3843,11 @@ func (ResetFpgaImageAttributeName) Values() []ResetFpgaImageAttributeName { type ResetImageAttributeName string +// Enum values for ResetImageAttributeName +const ( + ResetImageAttributeNameLaunchpermission ResetImageAttributeName = "launchPermission" +) + // Values returns all known values for ResetImageAttributeName. 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. @@ -2674,6 +3859,58 @@ func (ResetImageAttributeName) Values() []ResetImageAttributeName { type ResourceType string +// Enum values for ResourceType +const ( + ResourceTypeClientVpnEndpoint ResourceType = "client-vpn-endpoint" + ResourceTypeCustomerGateway ResourceType = "customer-gateway" + ResourceTypeDedicatedHost ResourceType = "dedicated-host" + ResourceTypeDhcpOptions ResourceType = "dhcp-options" + ResourceTypeEgressOnlyInternetGateway ResourceType = "egress-only-internet-gateway" + ResourceTypeElasticIp ResourceType = "elastic-ip" + ResourceTypeElasticGpu ResourceType = "elastic-gpu" + ResourceTypeExportImageTask ResourceType = "export-image-task" + ResourceTypeExportInstanceTask ResourceType = "export-instance-task" + ResourceTypeFleet ResourceType = "fleet" + ResourceTypeFpgaImage ResourceType = "fpga-image" + ResourceTypeHostReservation ResourceType = "host-reservation" + ResourceTypeImage ResourceType = "image" + ResourceTypeImportImageTask ResourceType = "import-image-task" + ResourceTypeImportSnapshotTask ResourceType = "import-snapshot-task" + ResourceTypeInstance ResourceType = "instance" + ResourceTypeInternetGateway ResourceType = "internet-gateway" + ResourceTypeKeyPair ResourceType = "key-pair" + ResourceTypeLaunchTemplate ResourceType = "launch-template" + ResourceTypeLocalGatewayRouteTableVpcAssociation ResourceType = "local-gateway-route-table-vpc-association" + ResourceTypeNatgateway ResourceType = "natgateway" + ResourceTypeNetworkAcl ResourceType = "network-acl" + ResourceTypeNetworkInterface ResourceType = "network-interface" + ResourceTypeNetworkInsightsAnalysis ResourceType = "network-insights-analysis" + ResourceTypeNetworkInsightsPath ResourceType = "network-insights-path" + ResourceTypePlacementGroup ResourceType = "placement-group" + ResourceTypeReservedInstances ResourceType = "reserved-instances" + ResourceTypeRouteTable ResourceType = "route-table" + ResourceTypeSecurityGroup ResourceType = "security-group" + ResourceTypeSecurityGroupRule ResourceType = "security-group-rule" + ResourceTypeSnapshot ResourceType = "snapshot" + ResourceTypeSpotFleetRequest ResourceType = "spot-fleet-request" + ResourceTypeSpotInstancesRequest ResourceType = "spot-instances-request" + ResourceTypeSubnet ResourceType = "subnet" + ResourceTypeTrafficMirrorFilter ResourceType = "traffic-mirror-filter" + ResourceTypeTrafficMirrorSession ResourceType = "traffic-mirror-session" + ResourceTypeTrafficMirrorTarget ResourceType = "traffic-mirror-target" + ResourceTypeTransitGateway ResourceType = "transit-gateway" + ResourceTypeTransitGatewayAttachment ResourceType = "transit-gateway-attachment" + ResourceTypeTransitGatewayConnectPeer ResourceType = "transit-gateway-connect-peer" + ResourceTypeTransitGatewayMulticastDomain ResourceType = "transit-gateway-multicast-domain" + ResourceTypeTransitGatewayRouteTable ResourceType = "transit-gateway-route-table" + ResourceTypeVolume ResourceType = "volume" + ResourceTypeVpc ResourceType = "vpc" + ResourceTypeVpcPeeringConnection ResourceType = "vpc-peering-connection" + ResourceTypeVpnConnection ResourceType = "vpn-connection" + ResourceTypeVpnGateway ResourceType = "vpn-gateway" + ResourceTypeVpcFlowLog ResourceType = "vpc-flow-log" +) + // Values returns all known values for ResourceType. 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. @@ -2708,6 +3945,7 @@ func (ResourceType) Values() []ResourceType { "reserved-instances", "route-table", "security-group", + "security-group-rule", "snapshot", "spot-fleet-request", "spot-instances-request", @@ -2745,6 +3983,12 @@ func (RIProductDescription) Values() []RIProductDescription { type RootDeviceType string +// Enum values for RootDeviceType +const ( + RootDeviceTypeEbs RootDeviceType = "ebs" + RootDeviceTypeInstanceStore RootDeviceType = "instance-store" +) + // Values returns all known values for RootDeviceType. 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. @@ -2757,6 +4001,13 @@ func (RootDeviceType) Values() []RootDeviceType { type RouteOrigin string +// Enum values for RouteOrigin +const ( + RouteOriginCreateroutetable RouteOrigin = "CreateRouteTable" + RouteOriginCreateroute RouteOrigin = "CreateRoute" + RouteOriginEnablevgwroutepropagation RouteOrigin = "EnableVgwRoutePropagation" +) + // Values returns all known values for RouteOrigin. 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. @@ -2770,6 +4021,12 @@ func (RouteOrigin) Values() []RouteOrigin { type RouteState string +// Enum values for RouteState +const ( + RouteStateActive RouteState = "active" + RouteStateBlackhole RouteState = "blackhole" +) + // Values returns all known values for RouteState. 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. @@ -2782,6 +4039,15 @@ func (RouteState) Values() []RouteState { type RouteTableAssociationStateCode string +// Enum values for RouteTableAssociationStateCode +const ( + RouteTableAssociationStateCodeAssociating RouteTableAssociationStateCode = "associating" + RouteTableAssociationStateCodeAssociated RouteTableAssociationStateCode = "associated" + RouteTableAssociationStateCodeDisassociating RouteTableAssociationStateCode = "disassociating" + RouteTableAssociationStateCodeDisassociated RouteTableAssociationStateCode = "disassociated" + RouteTableAssociationStateCodeFailed RouteTableAssociationStateCode = "failed" +) + // Values returns all known values for RouteTableAssociationStateCode. 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 @@ -2798,6 +4064,12 @@ func (RouteTableAssociationStateCode) Values() []RouteTableAssociationStateCode type RuleAction string +// Enum values for RuleAction +const ( + RuleActionAllow RuleAction = "allow" + RuleActionDeny RuleAction = "deny" +) + // Values returns all known values for RuleAction. 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. @@ -2828,6 +4100,12 @@ func (Scope) Values() []Scope { type SelfServicePortal string +// Enum values for SelfServicePortal +const ( + SelfServicePortalEnabled SelfServicePortal = "enabled" + SelfServicePortalDisabled SelfServicePortal = "disabled" +) + // Values returns all known values for SelfServicePortal. 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. @@ -2884,6 +4162,12 @@ func (ServiceType) Values() []ServiceType { type ShutdownBehavior string +// Enum values for ShutdownBehavior +const ( + ShutdownBehaviorStop ShutdownBehavior = "stop" + ShutdownBehaviorTerminate ShutdownBehavior = "terminate" +) + // Values returns all known values for ShutdownBehavior. 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. @@ -2896,6 +4180,12 @@ func (ShutdownBehavior) Values() []ShutdownBehavior { type SnapshotAttributeName string +// Enum values for SnapshotAttributeName +const ( + SnapshotAttributeNameProductcodes SnapshotAttributeName = "productCodes" + SnapshotAttributeNameCreatevolumepermission SnapshotAttributeName = "createVolumePermission" +) + // Values returns all known values for SnapshotAttributeName. 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. @@ -2908,6 +4198,13 @@ func (SnapshotAttributeName) Values() []SnapshotAttributeName { type SnapshotState string +// Enum values for SnapshotState +const ( + SnapshotStatePending SnapshotState = "pending" + SnapshotStateCompleted SnapshotState = "completed" + SnapshotStateError SnapshotState = "error" +) + // Values returns all known values for SnapshotState. 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. @@ -2941,6 +4238,13 @@ func (SpotAllocationStrategy) Values() []SpotAllocationStrategy { type SpotInstanceInterruptionBehavior string +// Enum values for SpotInstanceInterruptionBehavior +const ( + SpotInstanceInterruptionBehaviorHibernate SpotInstanceInterruptionBehavior = "hibernate" + SpotInstanceInterruptionBehaviorStop SpotInstanceInterruptionBehavior = "stop" + SpotInstanceInterruptionBehaviorTerminate SpotInstanceInterruptionBehavior = "terminate" +) + // Values returns all known values for SpotInstanceInterruptionBehavior. 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 @@ -2955,6 +4259,15 @@ func (SpotInstanceInterruptionBehavior) Values() []SpotInstanceInterruptionBehav type SpotInstanceState string +// Enum values for SpotInstanceState +const ( + SpotInstanceStateOpen SpotInstanceState = "open" + SpotInstanceStateActive SpotInstanceState = "active" + SpotInstanceStateClosed SpotInstanceState = "closed" + SpotInstanceStateCancelled SpotInstanceState = "cancelled" + SpotInstanceStateFailed SpotInstanceState = "failed" +) + // Values returns all known values for SpotInstanceState. 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. @@ -2970,6 +4283,12 @@ func (SpotInstanceState) Values() []SpotInstanceState { type SpotInstanceType string +// Enum values for SpotInstanceType +const ( + SpotInstanceTypeOneTime SpotInstanceType = "one-time" + SpotInstanceTypePersistent SpotInstanceType = "persistent" +) + // Values returns all known values for SpotInstanceType. 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. @@ -3012,6 +4331,12 @@ func (State) Values() []State { type StaticSourcesSupportValue string +// Enum values for StaticSourcesSupportValue +const ( + StaticSourcesSupportValueEnable StaticSourcesSupportValue = "enable" + StaticSourcesSupportValueDisable StaticSourcesSupportValue = "disable" +) + // Values returns all known values for StaticSourcesSupportValue. 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. @@ -3044,6 +4369,11 @@ func (Status) Values() []Status { type StatusName string +// Enum values for StatusName +const ( + StatusNameReachability StatusName = "reachability" +) + // Values returns all known values for StatusName. 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. @@ -3055,6 +4385,14 @@ func (StatusName) Values() []StatusName { type StatusType string +// Enum values for StatusType +const ( + StatusTypePassed StatusType = "passed" + StatusTypeFailed StatusType = "failed" + StatusTypeInsufficientData StatusType = "insufficient-data" + StatusTypeInitializing StatusType = "initializing" +) + // Values returns all known values for StatusType. 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. @@ -3069,6 +4407,16 @@ func (StatusType) Values() []StatusType { type SubnetCidrBlockStateCode string +// Enum values for SubnetCidrBlockStateCode +const ( + SubnetCidrBlockStateCodeAssociating SubnetCidrBlockStateCode = "associating" + SubnetCidrBlockStateCodeAssociated SubnetCidrBlockStateCode = "associated" + SubnetCidrBlockStateCodeDisassociating SubnetCidrBlockStateCode = "disassociating" + SubnetCidrBlockStateCodeDisassociated SubnetCidrBlockStateCode = "disassociated" + SubnetCidrBlockStateCodeFailing SubnetCidrBlockStateCode = "failing" + SubnetCidrBlockStateCodeFailed SubnetCidrBlockStateCode = "failed" +) + // Values returns all known values for SubnetCidrBlockStateCode. 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. @@ -3085,6 +4433,12 @@ func (SubnetCidrBlockStateCode) Values() []SubnetCidrBlockStateCode { type SubnetState string +// Enum values for SubnetState +const ( + SubnetStatePending SubnetState = "pending" + SubnetStateAvailable SubnetState = "available" +) + // Values returns all known values for SubnetState. 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. @@ -3097,6 +4451,15 @@ func (SubnetState) Values() []SubnetState { type SummaryStatus string +// Enum values for SummaryStatus +const ( + SummaryStatusOk SummaryStatus = "ok" + SummaryStatusImpaired SummaryStatus = "impaired" + SummaryStatusInsufficientData SummaryStatus = "insufficient-data" + SummaryStatusNotApplicable SummaryStatus = "not-applicable" + SummaryStatusInitializing SummaryStatus = "initializing" +) + // Values returns all known values for SummaryStatus. 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. @@ -3112,6 +4475,12 @@ func (SummaryStatus) Values() []SummaryStatus { type TelemetryStatus string +// Enum values for TelemetryStatus +const ( + TelemetryStatusUp TelemetryStatus = "UP" + TelemetryStatusDown TelemetryStatus = "DOWN" +) + // Values returns all known values for TelemetryStatus. 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. @@ -3124,6 +4493,13 @@ func (TelemetryStatus) Values() []TelemetryStatus { type Tenancy string +// Enum values for Tenancy +const ( + TenancyDefault Tenancy = "default" + TenancyDedicated Tenancy = "dedicated" + TenancyHost Tenancy = "host" +) + // Values returns all known values for Tenancy. 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. @@ -3137,6 +4513,12 @@ func (Tenancy) Values() []Tenancy { type TrafficDirection string +// Enum values for TrafficDirection +const ( + TrafficDirectionIngress TrafficDirection = "ingress" + TrafficDirectionEgress TrafficDirection = "egress" +) + // Values returns all known values for TrafficDirection. 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. @@ -3149,6 +4531,14 @@ func (TrafficDirection) Values() []TrafficDirection { type TrafficMirrorFilterRuleField string +// Enum values for TrafficMirrorFilterRuleField +const ( + TrafficMirrorFilterRuleFieldDestinationPortRange TrafficMirrorFilterRuleField = "destination-port-range" + TrafficMirrorFilterRuleFieldSourcePortRange TrafficMirrorFilterRuleField = "source-port-range" + TrafficMirrorFilterRuleFieldProtocol TrafficMirrorFilterRuleField = "protocol" + TrafficMirrorFilterRuleFieldDescription TrafficMirrorFilterRuleField = "description" +) + // Values returns all known values for TrafficMirrorFilterRuleField. 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. @@ -3163,6 +4553,11 @@ func (TrafficMirrorFilterRuleField) Values() []TrafficMirrorFilterRuleField { type TrafficMirrorNetworkService string +// Enum values for TrafficMirrorNetworkService +const ( + TrafficMirrorNetworkServiceAmazonDns TrafficMirrorNetworkService = "amazon-dns" +) + // Values returns all known values for TrafficMirrorNetworkService. 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. @@ -3174,6 +4569,12 @@ func (TrafficMirrorNetworkService) Values() []TrafficMirrorNetworkService { type TrafficMirrorRuleAction string +// Enum values for TrafficMirrorRuleAction +const ( + TrafficMirrorRuleActionAccept TrafficMirrorRuleAction = "accept" + TrafficMirrorRuleActionReject TrafficMirrorRuleAction = "reject" +) + // Values returns all known values for TrafficMirrorRuleAction. 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. @@ -3186,6 +4587,13 @@ func (TrafficMirrorRuleAction) Values() []TrafficMirrorRuleAction { type TrafficMirrorSessionField string +// Enum values for TrafficMirrorSessionField +const ( + TrafficMirrorSessionFieldPacketLength TrafficMirrorSessionField = "packet-length" + TrafficMirrorSessionFieldDescription TrafficMirrorSessionField = "description" + TrafficMirrorSessionFieldVirtualNetworkId TrafficMirrorSessionField = "virtual-network-id" +) + // Values returns all known values for TrafficMirrorSessionField. 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. @@ -3199,6 +4607,12 @@ func (TrafficMirrorSessionField) Values() []TrafficMirrorSessionField { type TrafficMirrorTargetType string +// Enum values for TrafficMirrorTargetType +const ( + TrafficMirrorTargetTypeNetworkInterface TrafficMirrorTargetType = "network-interface" + TrafficMirrorTargetTypeNetworkLoadBalancer TrafficMirrorTargetType = "network-load-balancer" +) + // Values returns all known values for TrafficMirrorTargetType. 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. @@ -3211,6 +4625,13 @@ func (TrafficMirrorTargetType) Values() []TrafficMirrorTargetType { type TrafficType string +// Enum values for TrafficType +const ( + TrafficTypeAccept TrafficType = "ACCEPT" + TrafficTypeReject TrafficType = "REJECT" + TrafficTypeAll TrafficType = "ALL" +) + // Values returns all known values for TrafficType. 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. @@ -3224,6 +4645,14 @@ func (TrafficType) Values() []TrafficType { type TransitGatewayAssociationState string +// Enum values for TransitGatewayAssociationState +const ( + TransitGatewayAssociationStateAssociating TransitGatewayAssociationState = "associating" + TransitGatewayAssociationStateAssociated TransitGatewayAssociationState = "associated" + TransitGatewayAssociationStateDisassociating TransitGatewayAssociationState = "disassociating" + TransitGatewayAssociationStateDisassociated TransitGatewayAssociationState = "disassociated" +) + // Values returns all known values for TransitGatewayAssociationState. 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 @@ -3239,6 +4668,16 @@ func (TransitGatewayAssociationState) Values() []TransitGatewayAssociationState type TransitGatewayAttachmentResourceType string +// Enum values for TransitGatewayAttachmentResourceType +const ( + TransitGatewayAttachmentResourceTypeVpc TransitGatewayAttachmentResourceType = "vpc" + TransitGatewayAttachmentResourceTypeVpn TransitGatewayAttachmentResourceType = "vpn" + TransitGatewayAttachmentResourceTypeDirectConnectGateway TransitGatewayAttachmentResourceType = "direct-connect-gateway" + TransitGatewayAttachmentResourceTypeConnect TransitGatewayAttachmentResourceType = "connect" + TransitGatewayAttachmentResourceTypePeering TransitGatewayAttachmentResourceType = "peering" + TransitGatewayAttachmentResourceTypeTgwPeering TransitGatewayAttachmentResourceType = "tgw-peering" +) + // Values returns all known values for TransitGatewayAttachmentResourceType. 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 @@ -3256,6 +4695,23 @@ func (TransitGatewayAttachmentResourceType) Values() []TransitGatewayAttachmentR type TransitGatewayAttachmentState string +// Enum values for TransitGatewayAttachmentState +const ( + TransitGatewayAttachmentStateInitiating TransitGatewayAttachmentState = "initiating" + TransitGatewayAttachmentStateInitiatingrequest TransitGatewayAttachmentState = "initiatingRequest" + TransitGatewayAttachmentStatePendingacceptance TransitGatewayAttachmentState = "pendingAcceptance" + TransitGatewayAttachmentStateRollingback TransitGatewayAttachmentState = "rollingBack" + TransitGatewayAttachmentStatePending TransitGatewayAttachmentState = "pending" + TransitGatewayAttachmentStateAvailable TransitGatewayAttachmentState = "available" + TransitGatewayAttachmentStateModifying TransitGatewayAttachmentState = "modifying" + TransitGatewayAttachmentStateDeleting TransitGatewayAttachmentState = "deleting" + TransitGatewayAttachmentStateDeleted TransitGatewayAttachmentState = "deleted" + TransitGatewayAttachmentStateFailed TransitGatewayAttachmentState = "failed" + TransitGatewayAttachmentStateRejected TransitGatewayAttachmentState = "rejected" + TransitGatewayAttachmentStateRejecting TransitGatewayAttachmentState = "rejecting" + TransitGatewayAttachmentStateFailing TransitGatewayAttachmentState = "failing" +) + // Values returns all known values for TransitGatewayAttachmentState. 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 @@ -3280,6 +4736,14 @@ func (TransitGatewayAttachmentState) Values() []TransitGatewayAttachmentState { type TransitGatewayConnectPeerState string +// Enum values for TransitGatewayConnectPeerState +const ( + TransitGatewayConnectPeerStatePending TransitGatewayConnectPeerState = "pending" + TransitGatewayConnectPeerStateAvailable TransitGatewayConnectPeerState = "available" + TransitGatewayConnectPeerStateDeleting TransitGatewayConnectPeerState = "deleting" + TransitGatewayConnectPeerStateDeleted TransitGatewayConnectPeerState = "deleted" +) + // Values returns all known values for TransitGatewayConnectPeerState. 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 @@ -3295,6 +4759,17 @@ func (TransitGatewayConnectPeerState) Values() []TransitGatewayConnectPeerState type TransitGatewayMulitcastDomainAssociationState string +// Enum values for TransitGatewayMulitcastDomainAssociationState +const ( + TransitGatewayMulitcastDomainAssociationStatePendingacceptance TransitGatewayMulitcastDomainAssociationState = "pendingAcceptance" + TransitGatewayMulitcastDomainAssociationStateAssociating TransitGatewayMulitcastDomainAssociationState = "associating" + TransitGatewayMulitcastDomainAssociationStateAssociated TransitGatewayMulitcastDomainAssociationState = "associated" + TransitGatewayMulitcastDomainAssociationStateDisassociating TransitGatewayMulitcastDomainAssociationState = "disassociating" + TransitGatewayMulitcastDomainAssociationStateDisassociated TransitGatewayMulitcastDomainAssociationState = "disassociated" + TransitGatewayMulitcastDomainAssociationStateRejected TransitGatewayMulitcastDomainAssociationState = "rejected" + TransitGatewayMulitcastDomainAssociationStateFailed TransitGatewayMulitcastDomainAssociationState = "failed" +) + // Values returns all known values for // TransitGatewayMulitcastDomainAssociationState. 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 @@ -3313,6 +4788,14 @@ func (TransitGatewayMulitcastDomainAssociationState) Values() []TransitGatewayMu type TransitGatewayMulticastDomainState string +// Enum values for TransitGatewayMulticastDomainState +const ( + TransitGatewayMulticastDomainStatePending TransitGatewayMulticastDomainState = "pending" + TransitGatewayMulticastDomainStateAvailable TransitGatewayMulticastDomainState = "available" + TransitGatewayMulticastDomainStateDeleting TransitGatewayMulticastDomainState = "deleting" + TransitGatewayMulticastDomainStateDeleted TransitGatewayMulticastDomainState = "deleted" +) + // Values returns all known values for TransitGatewayMulticastDomainState. 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 @@ -3328,6 +4811,14 @@ func (TransitGatewayMulticastDomainState) Values() []TransitGatewayMulticastDoma type TransitGatewayPrefixListReferenceState string +// Enum values for TransitGatewayPrefixListReferenceState +const ( + TransitGatewayPrefixListReferenceStatePending TransitGatewayPrefixListReferenceState = "pending" + TransitGatewayPrefixListReferenceStateAvailable TransitGatewayPrefixListReferenceState = "available" + TransitGatewayPrefixListReferenceStateModifying TransitGatewayPrefixListReferenceState = "modifying" + TransitGatewayPrefixListReferenceStateDeleting TransitGatewayPrefixListReferenceState = "deleting" +) + // Values returns all known values for TransitGatewayPrefixListReferenceState. 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 @@ -3343,6 +4834,14 @@ func (TransitGatewayPrefixListReferenceState) Values() []TransitGatewayPrefixLis type TransitGatewayPropagationState string +// Enum values for TransitGatewayPropagationState +const ( + TransitGatewayPropagationStateEnabling TransitGatewayPropagationState = "enabling" + TransitGatewayPropagationStateEnabled TransitGatewayPropagationState = "enabled" + TransitGatewayPropagationStateDisabling TransitGatewayPropagationState = "disabling" + TransitGatewayPropagationStateDisabled TransitGatewayPropagationState = "disabled" +) + // Values returns all known values for TransitGatewayPropagationState. 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 @@ -3358,6 +4857,15 @@ func (TransitGatewayPropagationState) Values() []TransitGatewayPropagationState type TransitGatewayRouteState string +// Enum values for TransitGatewayRouteState +const ( + TransitGatewayRouteStatePending TransitGatewayRouteState = "pending" + TransitGatewayRouteStateActive TransitGatewayRouteState = "active" + TransitGatewayRouteStateBlackhole TransitGatewayRouteState = "blackhole" + TransitGatewayRouteStateDeleting TransitGatewayRouteState = "deleting" + TransitGatewayRouteStateDeleted TransitGatewayRouteState = "deleted" +) + // Values returns all known values for TransitGatewayRouteState. 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. @@ -3373,6 +4881,14 @@ func (TransitGatewayRouteState) Values() []TransitGatewayRouteState { type TransitGatewayRouteTableState string +// Enum values for TransitGatewayRouteTableState +const ( + TransitGatewayRouteTableStatePending TransitGatewayRouteTableState = "pending" + TransitGatewayRouteTableStateAvailable TransitGatewayRouteTableState = "available" + TransitGatewayRouteTableStateDeleting TransitGatewayRouteTableState = "deleting" + TransitGatewayRouteTableStateDeleted TransitGatewayRouteTableState = "deleted" +) + // Values returns all known values for TransitGatewayRouteTableState. 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 @@ -3388,6 +4904,12 @@ func (TransitGatewayRouteTableState) Values() []TransitGatewayRouteTableState { type TransitGatewayRouteType string +// Enum values for TransitGatewayRouteType +const ( + TransitGatewayRouteTypeStatic TransitGatewayRouteType = "static" + TransitGatewayRouteTypePropagated TransitGatewayRouteType = "propagated" +) + // Values returns all known values for TransitGatewayRouteType. 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. @@ -3400,6 +4922,15 @@ func (TransitGatewayRouteType) Values() []TransitGatewayRouteType { type TransitGatewayState string +// Enum values for TransitGatewayState +const ( + TransitGatewayStatePending TransitGatewayState = "pending" + TransitGatewayStateAvailable TransitGatewayState = "available" + TransitGatewayStateModifying TransitGatewayState = "modifying" + TransitGatewayStateDeleting TransitGatewayState = "deleting" + TransitGatewayStateDeleted TransitGatewayState = "deleted" +) + // Values returns all known values for TransitGatewayState. 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. @@ -3415,6 +4946,12 @@ func (TransitGatewayState) Values() []TransitGatewayState { type TransportProtocol string +// Enum values for TransportProtocol +const ( + TransportProtocolTcp TransportProtocol = "tcp" + TransportProtocolUdp TransportProtocol = "udp" +) + // Values returns all known values for TransportProtocol. 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. @@ -3427,6 +4964,12 @@ func (TransportProtocol) Values() []TransportProtocol { type TunnelInsideIpVersion string +// Enum values for TunnelInsideIpVersion +const ( + TunnelInsideIpVersionIpv4 TunnelInsideIpVersion = "ipv4" + TunnelInsideIpVersionIpv6 TunnelInsideIpVersion = "ipv6" +) + // Values returns all known values for TunnelInsideIpVersion. 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. @@ -3439,6 +4982,14 @@ func (TunnelInsideIpVersion) Values() []TunnelInsideIpVersion { type UnlimitedSupportedInstanceFamily string +// Enum values for UnlimitedSupportedInstanceFamily +const ( + UnlimitedSupportedInstanceFamilyT2 UnlimitedSupportedInstanceFamily = "t2" + UnlimitedSupportedInstanceFamilyT3 UnlimitedSupportedInstanceFamily = "t3" + UnlimitedSupportedInstanceFamilyT3a UnlimitedSupportedInstanceFamily = "t3a" + UnlimitedSupportedInstanceFamilyT4g UnlimitedSupportedInstanceFamily = "t4g" +) + // Values returns all known values for UnlimitedSupportedInstanceFamily. 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 @@ -3477,6 +5028,12 @@ func (UnsuccessfulInstanceCreditSpecificationErrorCode) Values() []UnsuccessfulI type UsageClassType string +// Enum values for UsageClassType +const ( + UsageClassTypeSpot UsageClassType = "spot" + UsageClassTypeOnDemand UsageClassType = "on-demand" +) + // Values returns all known values for UsageClassType. 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. @@ -3489,6 +5046,12 @@ func (UsageClassType) Values() []UsageClassType { type VirtualizationType string +// Enum values for VirtualizationType +const ( + VirtualizationTypeHvm VirtualizationType = "hvm" + VirtualizationTypeParavirtual VirtualizationType = "paravirtual" +) + // Values returns all known values for VirtualizationType. 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. @@ -3501,6 +5064,15 @@ func (VirtualizationType) Values() []VirtualizationType { type VolumeAttachmentState string +// Enum values for VolumeAttachmentState +const ( + VolumeAttachmentStateAttaching VolumeAttachmentState = "attaching" + VolumeAttachmentStateAttached VolumeAttachmentState = "attached" + VolumeAttachmentStateDetaching VolumeAttachmentState = "detaching" + VolumeAttachmentStateDetached VolumeAttachmentState = "detached" + VolumeAttachmentStateBusy VolumeAttachmentState = "busy" +) + // Values returns all known values for VolumeAttachmentState. 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. @@ -3516,6 +5088,12 @@ func (VolumeAttachmentState) Values() []VolumeAttachmentState { type VolumeAttributeName string +// Enum values for VolumeAttributeName +const ( + VolumeAttributeNameAutoenableio VolumeAttributeName = "autoEnableIO" + VolumeAttributeNameProductcodes VolumeAttributeName = "productCodes" +) + // Values returns all known values for VolumeAttributeName. 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. @@ -3528,6 +5106,14 @@ func (VolumeAttributeName) Values() []VolumeAttributeName { type VolumeModificationState string +// Enum values for VolumeModificationState +const ( + VolumeModificationStateModifying VolumeModificationState = "modifying" + VolumeModificationStateOptimizing VolumeModificationState = "optimizing" + VolumeModificationStateCompleted VolumeModificationState = "completed" + VolumeModificationStateFailed VolumeModificationState = "failed" +) + // Values returns all known values for VolumeModificationState. 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. @@ -3542,6 +5128,16 @@ func (VolumeModificationState) Values() []VolumeModificationState { type VolumeState string +// Enum values for VolumeState +const ( + VolumeStateCreating VolumeState = "creating" + VolumeStateAvailable VolumeState = "available" + VolumeStateInUse VolumeState = "in-use" + VolumeStateDeleting VolumeState = "deleting" + VolumeStateDeleted VolumeState = "deleted" + VolumeStateError VolumeState = "error" +) + // Values returns all known values for VolumeState. 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. @@ -3558,6 +5154,13 @@ func (VolumeState) Values() []VolumeState { type VolumeStatusInfoStatus string +// Enum values for VolumeStatusInfoStatus +const ( + VolumeStatusInfoStatusOk VolumeStatusInfoStatus = "ok" + VolumeStatusInfoStatusImpaired VolumeStatusInfoStatus = "impaired" + VolumeStatusInfoStatusInsufficientData VolumeStatusInfoStatus = "insufficient-data" +) + // Values returns all known values for VolumeStatusInfoStatus. 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. @@ -3571,6 +5174,12 @@ func (VolumeStatusInfoStatus) Values() []VolumeStatusInfoStatus { type VolumeStatusName string +// Enum values for VolumeStatusName +const ( + VolumeStatusNameIoEnabled VolumeStatusName = "io-enabled" + VolumeStatusNameIoPerformance VolumeStatusName = "io-performance" +) + // Values returns all known values for VolumeStatusName. 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. @@ -3583,6 +5192,17 @@ func (VolumeStatusName) Values() []VolumeStatusName { type VolumeType string +// Enum values for VolumeType +const ( + VolumeTypeStandard VolumeType = "standard" + VolumeTypeIo1 VolumeType = "io1" + VolumeTypeIo2 VolumeType = "io2" + VolumeTypeGp2 VolumeType = "gp2" + VolumeTypeSc1 VolumeType = "sc1" + VolumeTypeSt1 VolumeType = "st1" + VolumeTypeGp3 VolumeType = "gp3" +) + // Values returns all known values for VolumeType. 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. @@ -3600,6 +5220,12 @@ func (VolumeType) Values() []VolumeType { type VpcAttributeName string +// Enum values for VpcAttributeName +const ( + VpcAttributeNameEnablednssupport VpcAttributeName = "enableDnsSupport" + VpcAttributeNameEnablednshostnames VpcAttributeName = "enableDnsHostnames" +) + // Values returns all known values for VpcAttributeName. 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. @@ -3612,6 +5238,16 @@ func (VpcAttributeName) Values() []VpcAttributeName { type VpcCidrBlockStateCode string +// Enum values for VpcCidrBlockStateCode +const ( + VpcCidrBlockStateCodeAssociating VpcCidrBlockStateCode = "associating" + VpcCidrBlockStateCodeAssociated VpcCidrBlockStateCode = "associated" + VpcCidrBlockStateCodeDisassociating VpcCidrBlockStateCode = "disassociating" + VpcCidrBlockStateCodeDisassociated VpcCidrBlockStateCode = "disassociated" + VpcCidrBlockStateCodeFailing VpcCidrBlockStateCode = "failing" + VpcCidrBlockStateCodeFailed VpcCidrBlockStateCode = "failed" +) + // Values returns all known values for VpcCidrBlockStateCode. 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. @@ -3648,6 +5284,19 @@ func (VpcEndpointType) Values() []VpcEndpointType { type VpcPeeringConnectionStateReasonCode string +// Enum values for VpcPeeringConnectionStateReasonCode +const ( + VpcPeeringConnectionStateReasonCodeInitiatingRequest VpcPeeringConnectionStateReasonCode = "initiating-request" + VpcPeeringConnectionStateReasonCodePendingAcceptance VpcPeeringConnectionStateReasonCode = "pending-acceptance" + VpcPeeringConnectionStateReasonCodeActive VpcPeeringConnectionStateReasonCode = "active" + VpcPeeringConnectionStateReasonCodeDeleted VpcPeeringConnectionStateReasonCode = "deleted" + VpcPeeringConnectionStateReasonCodeRejected VpcPeeringConnectionStateReasonCode = "rejected" + VpcPeeringConnectionStateReasonCodeFailed VpcPeeringConnectionStateReasonCode = "failed" + VpcPeeringConnectionStateReasonCodeExpired VpcPeeringConnectionStateReasonCode = "expired" + VpcPeeringConnectionStateReasonCodeProvisioning VpcPeeringConnectionStateReasonCode = "provisioning" + VpcPeeringConnectionStateReasonCodeDeleting VpcPeeringConnectionStateReasonCode = "deleting" +) + // Values returns all known values for VpcPeeringConnectionStateReasonCode. 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 @@ -3668,6 +5317,12 @@ func (VpcPeeringConnectionStateReasonCode) Values() []VpcPeeringConnectionStateR type VpcState string +// Enum values for VpcState +const ( + VpcStatePending VpcState = "pending" + VpcStateAvailable VpcState = "available" +) + // Values returns all known values for VpcState. 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. @@ -3680,6 +5335,11 @@ func (VpcState) Values() []VpcState { type VpcTenancy string +// Enum values for VpcTenancy +const ( + VpcTenancyDefault VpcTenancy = "default" +) + // Values returns all known values for VpcTenancy. 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. @@ -3691,6 +5351,12 @@ func (VpcTenancy) Values() []VpcTenancy { type VpnEcmpSupportValue string +// Enum values for VpnEcmpSupportValue +const ( + VpnEcmpSupportValueEnable VpnEcmpSupportValue = "enable" + VpnEcmpSupportValueDisable VpnEcmpSupportValue = "disable" +) + // Values returns all known values for VpnEcmpSupportValue. 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. @@ -3703,6 +5369,11 @@ func (VpnEcmpSupportValue) Values() []VpnEcmpSupportValue { type VpnProtocol string +// Enum values for VpnProtocol +const ( + VpnProtocolOpenvpn VpnProtocol = "openvpn" +) + // Values returns all known values for VpnProtocol. 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. @@ -3714,6 +5385,14 @@ func (VpnProtocol) Values() []VpnProtocol { type VpnState string +// Enum values for VpnState +const ( + VpnStatePending VpnState = "pending" + VpnStateAvailable VpnState = "available" + VpnStateDeleting VpnState = "deleting" + VpnStateDeleted VpnState = "deleted" +) + // Values returns all known values for VpnState. 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. @@ -3728,6 +5407,11 @@ func (VpnState) Values() []VpnState { type VpnStaticRouteSource string +// Enum values for VpnStaticRouteSource +const ( + VpnStaticRouteSourceStatic VpnStaticRouteSource = "Static" +) + // Values returns all known values for VpnStaticRouteSource. 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. diff --git a/service/ec2/types/types.go b/service/ec2/types/types.go index 23eee008187..3bd28ddcb75 100644 --- a/service/ec2/types/types.go +++ b/service/ec2/types/types.go @@ -1972,6 +1972,8 @@ type EbsBlockDevice struct { // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html). KmsKeyId *string + OutpostArn *string + // The ID of the snapshot. SnapshotId *string @@ -3856,6 +3858,8 @@ type Instance struct { // Any block device mapping entries for the instance. BlockDeviceMappings []InstanceBlockDeviceMapping + BootMode BootModeValues + // The ID of the Capacity Reservation. CapacityReservationId *string @@ -9648,18 +9652,20 @@ type TagSpecification struct { // The type of resource to tag. Currently, the resource types that support tagging // on creation are: capacity-reservation | carrier-gateway | client-vpn-endpoint | - // customer-gateway | dedicated-host | dhcp-options | export-image-task | - // export-instance-task | fleet | fpga-image | host-reservation | import-image-task - // | import-snapshot-task | instance | internet-gateway | ipv4pool-ec2 | - // ipv6pool-ec2 | key-pair | launch-template | placement-group | prefix-list | - // natgateway | network-acl | route-table | security-group | spot-fleet-request | + // customer-gateway | dedicated-host | dhcp-options | egress-only-internet-gateway + // | elastic-ip | elastic-gpu | export-image-task | export-instance-task | fleet | + // fpga-image | host-reservation | image| import-image-task | import-snapshot-task + // | instance | internet-gateway | ipv4pool-ec2 | ipv6pool-ec2 | key-pair | + // launch-template | local-gateway-route-table-vpc-association | placement-group | + // prefix-list | natgateway | network-acl | network-interface | reserved-instances + // |route-table | security-group| snapshot | spot-fleet-request | // spot-instances-request | snapshot | subnet | traffic-mirror-filter | // traffic-mirror-session | traffic-mirror-target | transit-gateway | - // transit-gateway-attachment | transit-gateway-connect-peer | - // transit-gateway-multicast-domain | transit-gateway-route-table | volume |vpc | - // vpc-peering-connection | vpc-endpoint (for interface and gateway endpoints) | - // vpc-endpoint-service (for AWS PrivateLink) | vpc-flow-log | vpn-connection | - // vpn-gateway. To tag a resource after it has been created, see CreateTags + // transit-gateway-attachment | transit-gateway-multicast-domain | + // transit-gateway-route-table | volume |vpc | vpc-peering-connection | + // vpc-endpoint (for interface and gateway endpoints) | vpc-endpoint-service (for + // AWS PrivateLink) | vpc-flow-log | vpn-connection | vpn-gateway. To tag a + // resource after it has been created, see CreateTags // (https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateTags.html). ResourceType ResourceType @@ -10983,6 +10989,7 @@ type VolumeModification struct { // The original IOPS rate of the volume. OriginalIops int32 + // The original setting for Amazon EBS Multi-Attach. OriginalMultiAttachEnabled bool // The original size of the volume, in GiB. @@ -11006,6 +11013,7 @@ type VolumeModification struct { // The target IOPS rate of the volume. TargetIops int32 + // The target setting for Amazon EBS Multi-Attach. TargetMultiAttachEnabled bool // The target size of the volume, in GiB. diff --git a/service/eks/types/enums.go b/service/eks/types/enums.go index 1d1c3314537..d4135a90606 100644 --- a/service/eks/types/enums.go +++ b/service/eks/types/enums.go @@ -28,6 +28,17 @@ func (AddonIssueCode) Values() []AddonIssueCode { type AddonStatus string +// Enum values for AddonStatus +const ( + AddonStatusCreating AddonStatus = "CREATING" + AddonStatusActive AddonStatus = "ACTIVE" + AddonStatusCreateFailed AddonStatus = "CREATE_FAILED" + AddonStatusUpdating AddonStatus = "UPDATING" + AddonStatusDeleting AddonStatus = "DELETING" + AddonStatusDeleteFailed AddonStatus = "DELETE_FAILED" + AddonStatusDegraded AddonStatus = "DEGRADED" +) + // Values returns all known values for AddonStatus. 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. @@ -45,6 +56,13 @@ func (AddonStatus) Values() []AddonStatus { type AMITypes string +// Enum values for AMITypes +const ( + AMITypesAl2X8664 AMITypes = "AL2_x86_64" + AMITypesAl2X8664Gpu AMITypes = "AL2_x86_64_GPU" + AMITypesAl2Arm64 AMITypes = "AL2_ARM_64" +) + // Values returns all known values for AMITypes. 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. @@ -58,6 +76,12 @@ func (AMITypes) Values() []AMITypes { type CapacityTypes string +// Enum values for CapacityTypes +const ( + CapacityTypesOnDemand CapacityTypes = "ON_DEMAND" + CapacityTypesSpot CapacityTypes = "SPOT" +) + // Values returns all known values for CapacityTypes. 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. @@ -70,6 +94,15 @@ func (CapacityTypes) Values() []CapacityTypes { type ClusterStatus string +// Enum values for ClusterStatus +const ( + ClusterStatusCreating ClusterStatus = "CREATING" + ClusterStatusActive ClusterStatus = "ACTIVE" + ClusterStatusDeleting ClusterStatus = "DELETING" + ClusterStatusFailed ClusterStatus = "FAILED" + ClusterStatusUpdating ClusterStatus = "UPDATING" +) + // Values returns all known values for ClusterStatus. 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. @@ -127,6 +160,15 @@ func (ErrorCode) Values() []ErrorCode { type FargateProfileStatus string +// Enum values for FargateProfileStatus +const ( + FargateProfileStatusCreating FargateProfileStatus = "CREATING" + FargateProfileStatusActive FargateProfileStatus = "ACTIVE" + FargateProfileStatusDeleting FargateProfileStatus = "DELETING" + FargateProfileStatusCreateFailed FargateProfileStatus = "CREATE_FAILED" + FargateProfileStatusDeleteFailed FargateProfileStatus = "DELETE_FAILED" +) + // Values returns all known values for FargateProfileStatus. 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. @@ -216,6 +258,17 @@ func (NodegroupIssueCode) Values() []NodegroupIssueCode { type NodegroupStatus string +// Enum values for NodegroupStatus +const ( + NodegroupStatusCreating NodegroupStatus = "CREATING" + NodegroupStatusActive NodegroupStatus = "ACTIVE" + NodegroupStatusUpdating NodegroupStatus = "UPDATING" + NodegroupStatusDeleting NodegroupStatus = "DELETING" + NodegroupStatusCreateFailed NodegroupStatus = "CREATE_FAILED" + NodegroupStatusDeleteFailed NodegroupStatus = "DELETE_FAILED" + NodegroupStatusDegraded NodegroupStatus = "DEGRADED" +) + // Values returns all known values for NodegroupStatus. 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. @@ -233,6 +286,12 @@ func (NodegroupStatus) Values() []NodegroupStatus { type ResolveConflicts string +// Enum values for ResolveConflicts +const ( + ResolveConflictsOverwrite ResolveConflicts = "OVERWRITE" + ResolveConflictsNone ResolveConflicts = "NONE" +) + // Values returns all known values for ResolveConflicts. 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. diff --git a/service/elasticache/api_op_CreateGlobalReplicationGroup.go b/service/elasticache/api_op_CreateGlobalReplicationGroup.go index a13ef19dee1..63a65c5992b 100644 --- a/service/elasticache/api_op_CreateGlobalReplicationGroup.go +++ b/service/elasticache/api_op_CreateGlobalReplicationGroup.go @@ -48,7 +48,7 @@ type CreateGlobalReplicationGroupInput struct { // Datastore name across multiple regions. For a full list of AWS Regions and their // respective Global Datastore iD prefixes, see Using the AWS CLI with Global // Datastores - // (http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Redis-Global-Clusters-CLI.html). + // (http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Redis-Global-Datastores-CLI.html). // // This member is required. GlobalReplicationGroupIdSuffix *string diff --git a/service/elasticache/types/enums.go b/service/elasticache/types/enums.go index 2ee8d80d988..871d20c36a0 100644 --- a/service/elasticache/types/enums.go +++ b/service/elasticache/types/enums.go @@ -22,6 +22,12 @@ func (AuthenticationType) Values() []AuthenticationType { type AuthTokenUpdateStatus string +// Enum values for AuthTokenUpdateStatus +const ( + AuthTokenUpdateStatusSetting AuthTokenUpdateStatus = "SETTING" + AuthTokenUpdateStatusRotating AuthTokenUpdateStatus = "ROTATING" +) + // Values returns all known values for AuthTokenUpdateStatus. 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. @@ -34,6 +40,13 @@ func (AuthTokenUpdateStatus) Values() []AuthTokenUpdateStatus { type AuthTokenUpdateStrategyType string +// Enum values for AuthTokenUpdateStrategyType +const ( + AuthTokenUpdateStrategyTypeSet AuthTokenUpdateStrategyType = "SET" + AuthTokenUpdateStrategyTypeRotate AuthTokenUpdateStrategyType = "ROTATE" + AuthTokenUpdateStrategyTypeDelete AuthTokenUpdateStrategyType = "DELETE" +) + // Values returns all known values for AuthTokenUpdateStrategyType. 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. @@ -87,6 +100,12 @@ func (AZMode) Values() []AZMode { type ChangeType string +// Enum values for ChangeType +const ( + ChangeTypeImmediate ChangeType = "immediate" + ChangeTypeRequiresReboot ChangeType = "requires-reboot" +) + // Values returns all known values for ChangeType. 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. @@ -276,6 +295,17 @@ func (SlaMet) Values() []SlaMet { type SourceType string +// Enum values for SourceType +const ( + SourceTypeCacheCluster SourceType = "cache-cluster" + SourceTypeCacheParameterGroup SourceType = "cache-parameter-group" + SourceTypeCacheSecurityGroup SourceType = "cache-security-group" + SourceTypeCacheSubnetGroup SourceType = "cache-subnet-group" + SourceTypeReplicationGroup SourceType = "replication-group" + SourceTypeUser SourceType = "user" + SourceTypeUserGroup SourceType = "user-group" +) + // Values returns all known values for SourceType. 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. diff --git a/service/elasticbeanstalk/types/enums.go b/service/elasticbeanstalk/types/enums.go index 541bc10baa3..22c47dd0f74 100644 --- a/service/elasticbeanstalk/types/enums.go +++ b/service/elasticbeanstalk/types/enums.go @@ -4,6 +4,13 @@ package types type ActionHistoryStatus string +// Enum values for ActionHistoryStatus +const ( + ActionHistoryStatusCompleted ActionHistoryStatus = "Completed" + ActionHistoryStatusFailed ActionHistoryStatus = "Failed" + ActionHistoryStatusUnknown ActionHistoryStatus = "Unknown" +) + // Values returns all known values for ActionHistoryStatus. 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. @@ -17,6 +24,14 @@ func (ActionHistoryStatus) Values() []ActionHistoryStatus { type ActionStatus string +// Enum values for ActionStatus +const ( + ActionStatusScheduled ActionStatus = "Scheduled" + ActionStatusPending ActionStatus = "Pending" + ActionStatusRunning ActionStatus = "Running" + ActionStatusUnknown ActionStatus = "Unknown" +) + // Values returns all known values for ActionStatus. 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. @@ -31,6 +46,13 @@ func (ActionStatus) Values() []ActionStatus { type ActionType string +// Enum values for ActionType +const ( + ActionTypeInstancerefresh ActionType = "InstanceRefresh" + ActionTypePlatformupdate ActionType = "PlatformUpdate" + ActionTypeUnknown ActionType = "Unknown" +) + // Values returns all known values for ActionType. Note that this can be expanded // in the future, and so it is only as up to date as the client. The ordering of // this slice is not guaranteed to be stable across updates. @@ -44,6 +66,15 @@ func (ActionType) Values() []ActionType { type ApplicationVersionStatus string +// Enum values for ApplicationVersionStatus +const ( + ApplicationVersionStatusProcessed ApplicationVersionStatus = "Processed" + ApplicationVersionStatusUnprocessed ApplicationVersionStatus = "Unprocessed" + ApplicationVersionStatusFailed ApplicationVersionStatus = "Failed" + ApplicationVersionStatusProcessing ApplicationVersionStatus = "Processing" + ApplicationVersionStatusBuilding ApplicationVersionStatus = "Building" +) + // Values returns all known values for ApplicationVersionStatus. 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. @@ -79,6 +110,13 @@ func (ComputeType) Values() []ComputeType { type ConfigurationDeploymentStatus string +// Enum values for ConfigurationDeploymentStatus +const ( + ConfigurationDeploymentStatusDeployed ConfigurationDeploymentStatus = "deployed" + ConfigurationDeploymentStatusPending ConfigurationDeploymentStatus = "pending" + ConfigurationDeploymentStatusFailed ConfigurationDeploymentStatus = "failed" +) + // Values returns all known values for ConfigurationDeploymentStatus. 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 @@ -93,6 +131,12 @@ func (ConfigurationDeploymentStatus) Values() []ConfigurationDeploymentStatus { type ConfigurationOptionValueType string +// Enum values for ConfigurationOptionValueType +const ( + ConfigurationOptionValueTypeScalar ConfigurationOptionValueType = "Scalar" + ConfigurationOptionValueTypeList ConfigurationOptionValueType = "List" +) + // Values returns all known values for ConfigurationOptionValueType. 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. @@ -105,6 +149,14 @@ func (ConfigurationOptionValueType) Values() []ConfigurationOptionValueType { type EnvironmentHealth string +// Enum values for EnvironmentHealth +const ( + EnvironmentHealthGreen EnvironmentHealth = "Green" + EnvironmentHealthYellow EnvironmentHealth = "Yellow" + EnvironmentHealthRed EnvironmentHealth = "Red" + EnvironmentHealthGrey EnvironmentHealth = "Grey" +) + // Values returns all known values for EnvironmentHealth. 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. @@ -149,6 +201,19 @@ func (EnvironmentHealthAttribute) Values() []EnvironmentHealthAttribute { type EnvironmentHealthStatus string +// Enum values for EnvironmentHealthStatus +const ( + EnvironmentHealthStatusNodata EnvironmentHealthStatus = "NoData" + EnvironmentHealthStatusUnknown EnvironmentHealthStatus = "Unknown" + EnvironmentHealthStatusPending EnvironmentHealthStatus = "Pending" + EnvironmentHealthStatusOk EnvironmentHealthStatus = "Ok" + EnvironmentHealthStatusInfo EnvironmentHealthStatus = "Info" + EnvironmentHealthStatusWarning EnvironmentHealthStatus = "Warning" + EnvironmentHealthStatusDegraded EnvironmentHealthStatus = "Degraded" + EnvironmentHealthStatusSevere EnvironmentHealthStatus = "Severe" + EnvironmentHealthStatusSuspended EnvironmentHealthStatus = "Suspended" +) + // Values returns all known values for EnvironmentHealthStatus. 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. @@ -168,6 +233,12 @@ func (EnvironmentHealthStatus) Values() []EnvironmentHealthStatus { type EnvironmentInfoType string +// Enum values for EnvironmentInfoType +const ( + EnvironmentInfoTypeTail EnvironmentInfoType = "tail" + EnvironmentInfoTypeBundle EnvironmentInfoType = "bundle" +) + // Values returns all known values for EnvironmentInfoType. 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. @@ -180,6 +251,18 @@ func (EnvironmentInfoType) Values() []EnvironmentInfoType { type EnvironmentStatus string +// Enum values for EnvironmentStatus +const ( + EnvironmentStatusAborting EnvironmentStatus = "Aborting" + EnvironmentStatusLaunching EnvironmentStatus = "Launching" + EnvironmentStatusUpdating EnvironmentStatus = "Updating" + EnvironmentStatusLinkingfrom EnvironmentStatus = "LinkingFrom" + EnvironmentStatusLinkingto EnvironmentStatus = "LinkingTo" + EnvironmentStatusReady EnvironmentStatus = "Ready" + EnvironmentStatusTerminating EnvironmentStatus = "Terminating" + EnvironmentStatusTerminated EnvironmentStatus = "Terminated" +) + // Values returns all known values for EnvironmentStatus. 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. @@ -198,6 +281,16 @@ func (EnvironmentStatus) Values() []EnvironmentStatus { type EventSeverity string +// Enum values for EventSeverity +const ( + EventSeverityTrace EventSeverity = "TRACE" + EventSeverityDebug EventSeverity = "DEBUG" + EventSeverityInfo EventSeverity = "INFO" + EventSeverityWarn EventSeverity = "WARN" + EventSeverityError EventSeverity = "ERROR" + EventSeverityFatal EventSeverity = "FATAL" +) + // Values returns all known values for EventSeverity. 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. @@ -214,6 +307,17 @@ func (EventSeverity) Values() []EventSeverity { type FailureType string +// Enum values for FailureType +const ( + FailureTypeUpdatecancelled FailureType = "UpdateCancelled" + FailureTypeCancellationfailed FailureType = "CancellationFailed" + FailureTypeRollbackfailed FailureType = "RollbackFailed" + FailureTypeRollbacksuccessful FailureType = "RollbackSuccessful" + FailureTypeInternalfailure FailureType = "InternalFailure" + FailureTypeInvalidenvironmentstate FailureType = "InvalidEnvironmentState" + FailureTypePermissionserror FailureType = "PermissionsError" +) + // Values returns all known values for FailureType. 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. @@ -267,6 +371,15 @@ func (InstancesHealthAttribute) Values() []InstancesHealthAttribute { type PlatformStatus string +// Enum values for PlatformStatus +const ( + PlatformStatusCreating PlatformStatus = "Creating" + PlatformStatusFailed PlatformStatus = "Failed" + PlatformStatusReady PlatformStatus = "Ready" + PlatformStatusDeleting PlatformStatus = "Deleting" + PlatformStatusDeleted PlatformStatus = "Deleted" +) + // Values returns all known values for PlatformStatus. 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. @@ -282,6 +395,12 @@ func (PlatformStatus) Values() []PlatformStatus { type SourceRepository string +// Enum values for SourceRepository +const ( + SourceRepositoryCodecommit SourceRepository = "CodeCommit" + SourceRepositoryS3 SourceRepository = "S3" +) + // Values returns all known values for SourceRepository. 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. @@ -294,6 +413,12 @@ func (SourceRepository) Values() []SourceRepository { type SourceType string +// Enum values for SourceType +const ( + SourceTypeGit SourceType = "Git" + SourceTypeZip SourceType = "Zip" +) + // Values returns all known values for SourceType. 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. @@ -306,6 +431,12 @@ func (SourceType) Values() []SourceType { type ValidationSeverity string +// Enum values for ValidationSeverity +const ( + ValidationSeverityError ValidationSeverity = "error" + ValidationSeverityWarning ValidationSeverity = "warning" +) + // Values returns all known values for ValidationSeverity. 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. diff --git a/service/elasticinference/types/enums.go b/service/elasticinference/types/enums.go index 7526a9694f0..bb83c0f1a40 100644 --- a/service/elasticinference/types/enums.go +++ b/service/elasticinference/types/enums.go @@ -4,6 +4,13 @@ package types type LocationType string +// Enum values for LocationType +const ( + LocationTypeRegion LocationType = "region" + LocationTypeAvailabilityZone LocationType = "availability-zone" + LocationTypeAvailabilityZoneId LocationType = "availability-zone-id" +) + // Values returns all known values for LocationType. 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. diff --git a/service/elasticloadbalancingv2/types/enums.go b/service/elasticloadbalancingv2/types/enums.go index 88084732438..c842fcc67ba 100644 --- a/service/elasticloadbalancingv2/types/enums.go +++ b/service/elasticloadbalancingv2/types/enums.go @@ -148,6 +148,17 @@ func (LoadBalancerTypeEnum) Values() []LoadBalancerTypeEnum { type ProtocolEnum string +// Enum values for ProtocolEnum +const ( + ProtocolEnumHttp ProtocolEnum = "HTTP" + ProtocolEnumHttps ProtocolEnum = "HTTPS" + ProtocolEnumTcp ProtocolEnum = "TCP" + ProtocolEnumTls ProtocolEnum = "TLS" + ProtocolEnumUdp ProtocolEnum = "UDP" + ProtocolEnumTcpUdp ProtocolEnum = "TCP_UDP" + ProtocolEnumGeneve ProtocolEnum = "GENEVE" +) + // Values returns all known values for ProtocolEnum. 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. diff --git a/service/elasticsearchservice/types/enums.go b/service/elasticsearchservice/types/enums.go index 7bcc8405ec2..d91eb3b6f96 100644 --- a/service/elasticsearchservice/types/enums.go +++ b/service/elasticsearchservice/types/enums.go @@ -4,6 +4,15 @@ package types type DeploymentStatus string +// Enum values for DeploymentStatus +const ( + DeploymentStatusPendingUpdate DeploymentStatus = "PENDING_UPDATE" + DeploymentStatusInProgress DeploymentStatus = "IN_PROGRESS" + DeploymentStatusCompleted DeploymentStatus = "COMPLETED" + DeploymentStatusNotEligible DeploymentStatus = "NOT_ELIGIBLE" + DeploymentStatusEligible DeploymentStatus = "ELIGIBLE" +) + // 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. @@ -39,6 +48,15 @@ func (DescribePackagesFilterName) Values() []DescribePackagesFilterName { type DomainPackageStatus string +// Enum values for DomainPackageStatus +const ( + DomainPackageStatusAssociating DomainPackageStatus = "ASSOCIATING" + DomainPackageStatusAssociationFailed DomainPackageStatus = "ASSOCIATION_FAILED" + DomainPackageStatusActive DomainPackageStatus = "ACTIVE" + DomainPackageStatusDissociating DomainPackageStatus = "DISSOCIATING" + DomainPackageStatusDissociationFailed DomainPackageStatus = "DISSOCIATION_FAILED" +) + // Values returns all known values for DomainPackageStatus. 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. @@ -54,6 +72,68 @@ func (DomainPackageStatus) Values() []DomainPackageStatus { type ESPartitionInstanceType string +// Enum values for ESPartitionInstanceType +const ( + ESPartitionInstanceTypeM3MediumElasticsearch ESPartitionInstanceType = "m3.medium.elasticsearch" + ESPartitionInstanceTypeM3LargeElasticsearch ESPartitionInstanceType = "m3.large.elasticsearch" + ESPartitionInstanceTypeM3XlargeElasticsearch ESPartitionInstanceType = "m3.xlarge.elasticsearch" + ESPartitionInstanceTypeM32xlargeElasticsearch ESPartitionInstanceType = "m3.2xlarge.elasticsearch" + ESPartitionInstanceTypeM4LargeElasticsearch ESPartitionInstanceType = "m4.large.elasticsearch" + ESPartitionInstanceTypeM4XlargeElasticsearch ESPartitionInstanceType = "m4.xlarge.elasticsearch" + ESPartitionInstanceTypeM42xlargeElasticsearch ESPartitionInstanceType = "m4.2xlarge.elasticsearch" + ESPartitionInstanceTypeM44xlargeElasticsearch ESPartitionInstanceType = "m4.4xlarge.elasticsearch" + ESPartitionInstanceTypeM410xlargeElasticsearch ESPartitionInstanceType = "m4.10xlarge.elasticsearch" + ESPartitionInstanceTypeM5LargeElasticsearch ESPartitionInstanceType = "m5.large.elasticsearch" + ESPartitionInstanceTypeM5XlargeElasticsearch ESPartitionInstanceType = "m5.xlarge.elasticsearch" + ESPartitionInstanceTypeM52xlargeElasticsearch ESPartitionInstanceType = "m5.2xlarge.elasticsearch" + ESPartitionInstanceTypeM54xlargeElasticsearch ESPartitionInstanceType = "m5.4xlarge.elasticsearch" + ESPartitionInstanceTypeM512xlargeElasticsearch ESPartitionInstanceType = "m5.12xlarge.elasticsearch" + ESPartitionInstanceTypeR5LargeElasticsearch ESPartitionInstanceType = "r5.large.elasticsearch" + ESPartitionInstanceTypeR5XlargeElasticsearch ESPartitionInstanceType = "r5.xlarge.elasticsearch" + ESPartitionInstanceTypeR52xlargeElasticsearch ESPartitionInstanceType = "r5.2xlarge.elasticsearch" + ESPartitionInstanceTypeR54xlargeElasticsearch ESPartitionInstanceType = "r5.4xlarge.elasticsearch" + ESPartitionInstanceTypeR512xlargeElasticsearch ESPartitionInstanceType = "r5.12xlarge.elasticsearch" + ESPartitionInstanceTypeC5LargeElasticsearch ESPartitionInstanceType = "c5.large.elasticsearch" + ESPartitionInstanceTypeC5XlargeElasticsearch ESPartitionInstanceType = "c5.xlarge.elasticsearch" + ESPartitionInstanceTypeC52xlargeElasticsearch ESPartitionInstanceType = "c5.2xlarge.elasticsearch" + ESPartitionInstanceTypeC54xlargeElasticsearch ESPartitionInstanceType = "c5.4xlarge.elasticsearch" + ESPartitionInstanceTypeC59xlargeElasticsearch ESPartitionInstanceType = "c5.9xlarge.elasticsearch" + ESPartitionInstanceTypeC518xlargeElasticsearch ESPartitionInstanceType = "c5.18xlarge.elasticsearch" + ESPartitionInstanceTypeUltrawarm1MediumElasticsearch ESPartitionInstanceType = "ultrawarm1.medium.elasticsearch" + ESPartitionInstanceTypeUltrawarm1LargeElasticsearch ESPartitionInstanceType = "ultrawarm1.large.elasticsearch" + ESPartitionInstanceTypeT2MicroElasticsearch ESPartitionInstanceType = "t2.micro.elasticsearch" + ESPartitionInstanceTypeT2SmallElasticsearch ESPartitionInstanceType = "t2.small.elasticsearch" + ESPartitionInstanceTypeT2MediumElasticsearch ESPartitionInstanceType = "t2.medium.elasticsearch" + ESPartitionInstanceTypeR3LargeElasticsearch ESPartitionInstanceType = "r3.large.elasticsearch" + ESPartitionInstanceTypeR3XlargeElasticsearch ESPartitionInstanceType = "r3.xlarge.elasticsearch" + ESPartitionInstanceTypeR32xlargeElasticsearch ESPartitionInstanceType = "r3.2xlarge.elasticsearch" + ESPartitionInstanceTypeR34xlargeElasticsearch ESPartitionInstanceType = "r3.4xlarge.elasticsearch" + ESPartitionInstanceTypeR38xlargeElasticsearch ESPartitionInstanceType = "r3.8xlarge.elasticsearch" + ESPartitionInstanceTypeI2XlargeElasticsearch ESPartitionInstanceType = "i2.xlarge.elasticsearch" + ESPartitionInstanceTypeI22xlargeElasticsearch ESPartitionInstanceType = "i2.2xlarge.elasticsearch" + ESPartitionInstanceTypeD2XlargeElasticsearch ESPartitionInstanceType = "d2.xlarge.elasticsearch" + ESPartitionInstanceTypeD22xlargeElasticsearch ESPartitionInstanceType = "d2.2xlarge.elasticsearch" + ESPartitionInstanceTypeD24xlargeElasticsearch ESPartitionInstanceType = "d2.4xlarge.elasticsearch" + ESPartitionInstanceTypeD28xlargeElasticsearch ESPartitionInstanceType = "d2.8xlarge.elasticsearch" + ESPartitionInstanceTypeC4LargeElasticsearch ESPartitionInstanceType = "c4.large.elasticsearch" + ESPartitionInstanceTypeC4XlargeElasticsearch ESPartitionInstanceType = "c4.xlarge.elasticsearch" + ESPartitionInstanceTypeC42xlargeElasticsearch ESPartitionInstanceType = "c4.2xlarge.elasticsearch" + ESPartitionInstanceTypeC44xlargeElasticsearch ESPartitionInstanceType = "c4.4xlarge.elasticsearch" + ESPartitionInstanceTypeC48xlargeElasticsearch ESPartitionInstanceType = "c4.8xlarge.elasticsearch" + ESPartitionInstanceTypeR4LargeElasticsearch ESPartitionInstanceType = "r4.large.elasticsearch" + ESPartitionInstanceTypeR4XlargeElasticsearch ESPartitionInstanceType = "r4.xlarge.elasticsearch" + ESPartitionInstanceTypeR42xlargeElasticsearch ESPartitionInstanceType = "r4.2xlarge.elasticsearch" + ESPartitionInstanceTypeR44xlargeElasticsearch ESPartitionInstanceType = "r4.4xlarge.elasticsearch" + ESPartitionInstanceTypeR48xlargeElasticsearch ESPartitionInstanceType = "r4.8xlarge.elasticsearch" + ESPartitionInstanceTypeR416xlargeElasticsearch ESPartitionInstanceType = "r4.16xlarge.elasticsearch" + ESPartitionInstanceTypeI3LargeElasticsearch ESPartitionInstanceType = "i3.large.elasticsearch" + ESPartitionInstanceTypeI3XlargeElasticsearch ESPartitionInstanceType = "i3.xlarge.elasticsearch" + ESPartitionInstanceTypeI32xlargeElasticsearch ESPartitionInstanceType = "i3.2xlarge.elasticsearch" + ESPartitionInstanceTypeI34xlargeElasticsearch ESPartitionInstanceType = "i3.4xlarge.elasticsearch" + ESPartitionInstanceTypeI38xlargeElasticsearch ESPartitionInstanceType = "i3.8xlarge.elasticsearch" + ESPartitionInstanceTypeI316xlargeElasticsearch ESPartitionInstanceType = "i3.16xlarge.elasticsearch" +) + // Values returns all known values for ESPartitionInstanceType. 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. @@ -122,6 +202,12 @@ func (ESPartitionInstanceType) Values() []ESPartitionInstanceType { type ESWarmPartitionInstanceType string +// Enum values for ESWarmPartitionInstanceType +const ( + ESWarmPartitionInstanceTypeUltrawarm1MediumElasticsearch ESWarmPartitionInstanceType = "ultrawarm1.medium.elasticsearch" + ESWarmPartitionInstanceTypeUltrawarm1LargeElasticsearch ESWarmPartitionInstanceType = "ultrawarm1.large.elasticsearch" +) + // Values returns all known values for ESWarmPartitionInstanceType. 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. @@ -161,6 +247,14 @@ func (InboundCrossClusterSearchConnectionStatusCode) Values() []InboundCrossClus type LogType string +// Enum values for LogType +const ( + LogTypeIndexSlowLogs LogType = "INDEX_SLOW_LOGS" + LogTypeSearchSlowLogs LogType = "SEARCH_SLOW_LOGS" + LogTypeEsApplicationLogs LogType = "ES_APPLICATION_LOGS" + LogTypeAuditLogs LogType = "AUDIT_LOGS" +) + // Values returns all known values for LogType. 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. @@ -175,6 +269,13 @@ func (LogType) Values() []LogType { type OptionState string +// Enum values for OptionState +const ( + OptionStateRequiresindexdocuments OptionState = "RequiresIndexDocuments" + OptionStateProcessing OptionState = "Processing" + OptionStateActive OptionState = "Active" +) + // Values returns all known values for OptionState. 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. @@ -219,6 +320,18 @@ func (OutboundCrossClusterSearchConnectionStatusCode) Values() []OutboundCrossCl type PackageStatus string +// Enum values for PackageStatus +const ( + PackageStatusCopying PackageStatus = "COPYING" + PackageStatusCopyFailed PackageStatus = "COPY_FAILED" + PackageStatusValidating PackageStatus = "VALIDATING" + PackageStatusValidationFailed PackageStatus = "VALIDATION_FAILED" + PackageStatusAvailable PackageStatus = "AVAILABLE" + PackageStatusDeleting PackageStatus = "DELETING" + PackageStatusDeleted PackageStatus = "DELETED" + PackageStatusDeleteFailed PackageStatus = "DELETE_FAILED" +) + // Values returns all known values for PackageStatus. 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. @@ -237,6 +350,11 @@ func (PackageStatus) Values() []PackageStatus { type PackageType string +// Enum values for PackageType +const ( + PackageTypeTxtDictionary PackageType = "TXT-DICTIONARY" +) + // Values returns all known values for PackageType. 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. @@ -248,6 +366,13 @@ func (PackageType) Values() []PackageType { type ReservedElasticsearchInstancePaymentOption string +// Enum values for ReservedElasticsearchInstancePaymentOption +const ( + ReservedElasticsearchInstancePaymentOptionAllUpfront ReservedElasticsearchInstancePaymentOption = "ALL_UPFRONT" + ReservedElasticsearchInstancePaymentOptionPartialUpfront ReservedElasticsearchInstancePaymentOption = "PARTIAL_UPFRONT" + ReservedElasticsearchInstancePaymentOptionNoUpfront ReservedElasticsearchInstancePaymentOption = "NO_UPFRONT" +) + // Values returns all known values for ReservedElasticsearchInstancePaymentOption. // 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 @@ -280,6 +405,14 @@ func (TLSSecurityPolicy) Values() []TLSSecurityPolicy { type UpgradeStatus string +// Enum values for UpgradeStatus +const ( + UpgradeStatusInProgress UpgradeStatus = "IN_PROGRESS" + UpgradeStatusSucceeded UpgradeStatus = "SUCCEEDED" + UpgradeStatusSucceededWithIssues UpgradeStatus = "SUCCEEDED_WITH_ISSUES" + UpgradeStatusFailed UpgradeStatus = "FAILED" +) + // Values returns all known values for UpgradeStatus. 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. @@ -294,6 +427,13 @@ func (UpgradeStatus) Values() []UpgradeStatus { type UpgradeStep string +// Enum values for UpgradeStep +const ( + UpgradeStepPreUpgradeCheck UpgradeStep = "PRE_UPGRADE_CHECK" + UpgradeStepSnapshot UpgradeStep = "SNAPSHOT" + UpgradeStepUpgrade UpgradeStep = "UPGRADE" +) + // Values returns all known values for UpgradeStep. 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. @@ -307,6 +447,13 @@ func (UpgradeStep) Values() []UpgradeStep { type VolumeType string +// Enum values for VolumeType +const ( + VolumeTypeStandard VolumeType = "standard" + VolumeTypeGp2 VolumeType = "gp2" + VolumeTypeIo1 VolumeType = "io1" +) + // Values returns all known values for VolumeType. 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. diff --git a/service/emr/types/enums.go b/service/emr/types/enums.go index 7ca5afbba86..f817fff7abc 100644 --- a/service/emr/types/enums.go +++ b/service/emr/types/enums.go @@ -431,6 +431,13 @@ func (InstanceGroupType) Values() []InstanceGroupType { type InstanceRoleType string +// Enum values for InstanceRoleType +const ( + InstanceRoleTypeMaster InstanceRoleType = "MASTER" + InstanceRoleTypeCore InstanceRoleType = "CORE" + InstanceRoleTypeTask InstanceRoleType = "TASK" +) + // Values returns all known values for InstanceRoleType. 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. @@ -667,6 +674,12 @@ func (SpotProvisioningAllocationStrategy) Values() []SpotProvisioningAllocationS type SpotProvisioningTimeoutAction string +// Enum values for SpotProvisioningTimeoutAction +const ( + SpotProvisioningTimeoutActionSwitchToOnDemand SpotProvisioningTimeoutAction = "SWITCH_TO_ON_DEMAND" + SpotProvisioningTimeoutActionTerminateCluster SpotProvisioningTimeoutAction = "TERMINATE_CLUSTER" +) + // Values returns all known values for SpotProvisioningTimeoutAction. 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 @@ -704,6 +717,12 @@ func (Statistic) Values() []Statistic { type StepCancellationOption string +// Enum values for StepCancellationOption +const ( + StepCancellationOptionSendInterrupt StepCancellationOption = "SEND_INTERRUPT" + StepCancellationOptionTerminateProcess StepCancellationOption = "TERMINATE_PROCESS" +) + // Values returns all known values for StepCancellationOption. 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. @@ -716,6 +735,17 @@ func (StepCancellationOption) Values() []StepCancellationOption { type StepExecutionState string +// Enum values for StepExecutionState +const ( + StepExecutionStatePending StepExecutionState = "PENDING" + StepExecutionStateRunning StepExecutionState = "RUNNING" + StepExecutionStateContinue StepExecutionState = "CONTINUE" + StepExecutionStateCompleted StepExecutionState = "COMPLETED" + StepExecutionStateCancelled StepExecutionState = "CANCELLED" + StepExecutionStateFailed StepExecutionState = "FAILED" + StepExecutionStateInterrupted StepExecutionState = "INTERRUPTED" +) + // Values returns all known values for StepExecutionState. 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. @@ -761,6 +791,11 @@ func (StepState) Values() []StepState { type StepStateChangeReasonCode string +// Enum values for StepStateChangeReasonCode +const ( + StepStateChangeReasonCodeNone StepStateChangeReasonCode = "NONE" +) + // Values returns all known values for StepStateChangeReasonCode. 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. diff --git a/service/firehose/types/enums.go b/service/firehose/types/enums.go index 4ba2f3daedb..89582bc19a1 100644 --- a/service/firehose/types/enums.go +++ b/service/firehose/types/enums.go @@ -141,6 +141,12 @@ func (DeliveryStreamStatus) Values() []DeliveryStreamStatus { type DeliveryStreamType string +// Enum values for DeliveryStreamType +const ( + DeliveryStreamTypeDirectput DeliveryStreamType = "DirectPut" + DeliveryStreamTypeKinesisstreamassource DeliveryStreamType = "KinesisStreamAsSource" +) + // Values returns all known values for DeliveryStreamType. 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. @@ -153,6 +159,15 @@ func (DeliveryStreamType) Values() []DeliveryStreamType { type ElasticsearchIndexRotationPeriod string +// Enum values for ElasticsearchIndexRotationPeriod +const ( + ElasticsearchIndexRotationPeriodNorotation ElasticsearchIndexRotationPeriod = "NoRotation" + ElasticsearchIndexRotationPeriodOnehour ElasticsearchIndexRotationPeriod = "OneHour" + ElasticsearchIndexRotationPeriodOneday ElasticsearchIndexRotationPeriod = "OneDay" + ElasticsearchIndexRotationPeriodOneweek ElasticsearchIndexRotationPeriod = "OneWeek" + ElasticsearchIndexRotationPeriodOnemonth ElasticsearchIndexRotationPeriod = "OneMonth" +) + // Values returns all known values for ElasticsearchIndexRotationPeriod. 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 @@ -169,6 +184,12 @@ func (ElasticsearchIndexRotationPeriod) Values() []ElasticsearchIndexRotationPer type ElasticsearchS3BackupMode string +// Enum values for ElasticsearchS3BackupMode +const ( + ElasticsearchS3BackupModeFaileddocumentsonly ElasticsearchS3BackupMode = "FailedDocumentsOnly" + ElasticsearchS3BackupModeAlldocuments ElasticsearchS3BackupMode = "AllDocuments" +) + // Values returns all known values for ElasticsearchS3BackupMode. 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. @@ -181,6 +202,12 @@ func (ElasticsearchS3BackupMode) Values() []ElasticsearchS3BackupMode { type HECEndpointType string +// Enum values for HECEndpointType +const ( + HECEndpointTypeRaw HECEndpointType = "Raw" + HECEndpointTypeEvent HECEndpointType = "Event" +) + // Values returns all known values for HECEndpointType. 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. @@ -193,6 +220,12 @@ func (HECEndpointType) Values() []HECEndpointType { type HttpEndpointS3BackupMode string +// Enum values for HttpEndpointS3BackupMode +const ( + HttpEndpointS3BackupModeFaileddataonly HttpEndpointS3BackupMode = "FailedDataOnly" + HttpEndpointS3BackupModeAlldata HttpEndpointS3BackupMode = "AllData" +) + // Values returns all known values for HttpEndpointS3BackupMode. 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. @@ -223,6 +256,11 @@ func (KeyType) Values() []KeyType { type NoEncryptionConfig string +// Enum values for NoEncryptionConfig +const ( + NoEncryptionConfigNoencryption NoEncryptionConfig = "NoEncryption" +) + // Values returns all known values for NoEncryptionConfig. 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. @@ -334,6 +372,11 @@ func (ProcessorParameterName) Values() []ProcessorParameterName { type ProcessorType string +// Enum values for ProcessorType +const ( + ProcessorTypeLambda ProcessorType = "Lambda" +) + // Values returns all known values for ProcessorType. 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. @@ -345,6 +388,12 @@ func (ProcessorType) Values() []ProcessorType { type RedshiftS3BackupMode string +// Enum values for RedshiftS3BackupMode +const ( + RedshiftS3BackupModeDisabled RedshiftS3BackupMode = "Disabled" + RedshiftS3BackupModeEnabled RedshiftS3BackupMode = "Enabled" +) + // Values returns all known values for RedshiftS3BackupMode. 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. @@ -357,6 +406,12 @@ func (RedshiftS3BackupMode) Values() []RedshiftS3BackupMode { type S3BackupMode string +// Enum values for S3BackupMode +const ( + S3BackupModeDisabled S3BackupMode = "Disabled" + S3BackupModeEnabled S3BackupMode = "Enabled" +) + // Values returns all known values for S3BackupMode. 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. @@ -369,6 +424,12 @@ func (S3BackupMode) Values() []S3BackupMode { type SplunkS3BackupMode string +// Enum values for SplunkS3BackupMode +const ( + SplunkS3BackupModeFailedeventsonly SplunkS3BackupMode = "FailedEventsOnly" + SplunkS3BackupModeAllevents SplunkS3BackupMode = "AllEvents" +) + // Values returns all known values for SplunkS3BackupMode. 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. diff --git a/service/gamelift/types/enums.go b/service/gamelift/types/enums.go index acc2cec36dd..96d56f35d0f 100644 --- a/service/gamelift/types/enums.go +++ b/service/gamelift/types/enums.go @@ -4,6 +4,12 @@ package types type AcceptanceType string +// Enum values for AcceptanceType +const ( + AcceptanceTypeAccept AcceptanceType = "ACCEPT" + AcceptanceTypeReject AcceptanceType = "REJECT" +) + // Values returns all known values for AcceptanceType. 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. @@ -114,6 +120,92 @@ func (ComparisonOperatorType) Values() []ComparisonOperatorType { type EC2InstanceType string +// Enum values for EC2InstanceType +const ( + EC2InstanceTypeT2Micro EC2InstanceType = "t2.micro" + EC2InstanceTypeT2Small EC2InstanceType = "t2.small" + EC2InstanceTypeT2Medium EC2InstanceType = "t2.medium" + EC2InstanceTypeT2Large EC2InstanceType = "t2.large" + EC2InstanceTypeC3Large EC2InstanceType = "c3.large" + EC2InstanceTypeC3Xlarge EC2InstanceType = "c3.xlarge" + EC2InstanceTypeC32xlarge EC2InstanceType = "c3.2xlarge" + EC2InstanceTypeC34xlarge EC2InstanceType = "c3.4xlarge" + EC2InstanceTypeC38xlarge EC2InstanceType = "c3.8xlarge" + EC2InstanceTypeC4Large EC2InstanceType = "c4.large" + EC2InstanceTypeC4Xlarge EC2InstanceType = "c4.xlarge" + EC2InstanceTypeC42xlarge EC2InstanceType = "c4.2xlarge" + EC2InstanceTypeC44xlarge EC2InstanceType = "c4.4xlarge" + EC2InstanceTypeC48xlarge EC2InstanceType = "c4.8xlarge" + EC2InstanceTypeC5Large EC2InstanceType = "c5.large" + EC2InstanceTypeC5Xlarge EC2InstanceType = "c5.xlarge" + EC2InstanceTypeC52xlarge EC2InstanceType = "c5.2xlarge" + EC2InstanceTypeC54xlarge EC2InstanceType = "c5.4xlarge" + EC2InstanceTypeC59xlarge EC2InstanceType = "c5.9xlarge" + EC2InstanceTypeC512xlarge EC2InstanceType = "c5.12xlarge" + EC2InstanceTypeC518xlarge EC2InstanceType = "c5.18xlarge" + EC2InstanceTypeC524xlarge EC2InstanceType = "c5.24xlarge" + EC2InstanceTypeC5aLarge EC2InstanceType = "c5a.large" + EC2InstanceTypeC5aXlarge EC2InstanceType = "c5a.xlarge" + EC2InstanceTypeC5a2xlarge EC2InstanceType = "c5a.2xlarge" + EC2InstanceTypeC5a4xlarge EC2InstanceType = "c5a.4xlarge" + EC2InstanceTypeC5a8xlarge EC2InstanceType = "c5a.8xlarge" + EC2InstanceTypeC5a12xlarge EC2InstanceType = "c5a.12xlarge" + EC2InstanceTypeC5a16xlarge EC2InstanceType = "c5a.16xlarge" + EC2InstanceTypeC5a24xlarge EC2InstanceType = "c5a.24xlarge" + EC2InstanceTypeR3Large EC2InstanceType = "r3.large" + EC2InstanceTypeR3Xlarge EC2InstanceType = "r3.xlarge" + EC2InstanceTypeR32xlarge EC2InstanceType = "r3.2xlarge" + EC2InstanceTypeR34xlarge EC2InstanceType = "r3.4xlarge" + EC2InstanceTypeR38xlarge EC2InstanceType = "r3.8xlarge" + EC2InstanceTypeR4Large EC2InstanceType = "r4.large" + EC2InstanceTypeR4Xlarge EC2InstanceType = "r4.xlarge" + EC2InstanceTypeR42xlarge EC2InstanceType = "r4.2xlarge" + EC2InstanceTypeR44xlarge EC2InstanceType = "r4.4xlarge" + EC2InstanceTypeR48xlarge EC2InstanceType = "r4.8xlarge" + EC2InstanceTypeR416xlarge EC2InstanceType = "r4.16xlarge" + EC2InstanceTypeR5Large EC2InstanceType = "r5.large" + EC2InstanceTypeR5Xlarge EC2InstanceType = "r5.xlarge" + EC2InstanceTypeR52xlarge EC2InstanceType = "r5.2xlarge" + EC2InstanceTypeR54xlarge EC2InstanceType = "r5.4xlarge" + EC2InstanceTypeR58xlarge EC2InstanceType = "r5.8xlarge" + EC2InstanceTypeR512xlarge EC2InstanceType = "r5.12xlarge" + EC2InstanceTypeR516xlarge EC2InstanceType = "r5.16xlarge" + EC2InstanceTypeR524xlarge EC2InstanceType = "r5.24xlarge" + EC2InstanceTypeR5aLarge EC2InstanceType = "r5a.large" + EC2InstanceTypeR5aXlarge EC2InstanceType = "r5a.xlarge" + EC2InstanceTypeR5a2xlarge EC2InstanceType = "r5a.2xlarge" + EC2InstanceTypeR5a4xlarge EC2InstanceType = "r5a.4xlarge" + EC2InstanceTypeR5a8xlarge EC2InstanceType = "r5a.8xlarge" + EC2InstanceTypeR5a12xlarge EC2InstanceType = "r5a.12xlarge" + EC2InstanceTypeR5a16xlarge EC2InstanceType = "r5a.16xlarge" + EC2InstanceTypeR5a24xlarge EC2InstanceType = "r5a.24xlarge" + EC2InstanceTypeM3Medium EC2InstanceType = "m3.medium" + EC2InstanceTypeM3Large EC2InstanceType = "m3.large" + EC2InstanceTypeM3Xlarge EC2InstanceType = "m3.xlarge" + EC2InstanceTypeM32xlarge EC2InstanceType = "m3.2xlarge" + EC2InstanceTypeM4Large EC2InstanceType = "m4.large" + EC2InstanceTypeM4Xlarge EC2InstanceType = "m4.xlarge" + EC2InstanceTypeM42xlarge EC2InstanceType = "m4.2xlarge" + EC2InstanceTypeM44xlarge EC2InstanceType = "m4.4xlarge" + EC2InstanceTypeM410xlarge EC2InstanceType = "m4.10xlarge" + EC2InstanceTypeM5Large EC2InstanceType = "m5.large" + EC2InstanceTypeM5Xlarge EC2InstanceType = "m5.xlarge" + EC2InstanceTypeM52xlarge EC2InstanceType = "m5.2xlarge" + EC2InstanceTypeM54xlarge EC2InstanceType = "m5.4xlarge" + EC2InstanceTypeM58xlarge EC2InstanceType = "m5.8xlarge" + EC2InstanceTypeM512xlarge EC2InstanceType = "m5.12xlarge" + EC2InstanceTypeM516xlarge EC2InstanceType = "m5.16xlarge" + EC2InstanceTypeM524xlarge EC2InstanceType = "m5.24xlarge" + EC2InstanceTypeM5aLarge EC2InstanceType = "m5a.large" + EC2InstanceTypeM5aXlarge EC2InstanceType = "m5a.xlarge" + EC2InstanceTypeM5a2xlarge EC2InstanceType = "m5a.2xlarge" + EC2InstanceTypeM5a4xlarge EC2InstanceType = "m5a.4xlarge" + EC2InstanceTypeM5a8xlarge EC2InstanceType = "m5a.8xlarge" + EC2InstanceTypeM5a12xlarge EC2InstanceType = "m5a.12xlarge" + EC2InstanceTypeM5a16xlarge EC2InstanceType = "m5a.16xlarge" + EC2InstanceTypeM5a24xlarge EC2InstanceType = "m5a.24xlarge" +) + // Values returns all known values for EC2InstanceType. 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. @@ -422,6 +514,50 @@ func (GameServerGroupDeleteOption) Values() []GameServerGroupDeleteOption { type GameServerGroupInstanceType string +// Enum values for GameServerGroupInstanceType +const ( + GameServerGroupInstanceTypeC4Large GameServerGroupInstanceType = "c4.large" + GameServerGroupInstanceTypeC4Xlarge GameServerGroupInstanceType = "c4.xlarge" + GameServerGroupInstanceTypeC42xlarge GameServerGroupInstanceType = "c4.2xlarge" + GameServerGroupInstanceTypeC44xlarge GameServerGroupInstanceType = "c4.4xlarge" + GameServerGroupInstanceTypeC48xlarge GameServerGroupInstanceType = "c4.8xlarge" + GameServerGroupInstanceTypeC5Large GameServerGroupInstanceType = "c5.large" + GameServerGroupInstanceTypeC5Xlarge GameServerGroupInstanceType = "c5.xlarge" + GameServerGroupInstanceTypeC52xlarge GameServerGroupInstanceType = "c5.2xlarge" + GameServerGroupInstanceTypeC54xlarge GameServerGroupInstanceType = "c5.4xlarge" + GameServerGroupInstanceTypeC59xlarge GameServerGroupInstanceType = "c5.9xlarge" + GameServerGroupInstanceTypeC512xlarge GameServerGroupInstanceType = "c5.12xlarge" + GameServerGroupInstanceTypeC518xlarge GameServerGroupInstanceType = "c5.18xlarge" + GameServerGroupInstanceTypeC524xlarge GameServerGroupInstanceType = "c5.24xlarge" + GameServerGroupInstanceTypeR4Large GameServerGroupInstanceType = "r4.large" + GameServerGroupInstanceTypeR4Xlarge GameServerGroupInstanceType = "r4.xlarge" + GameServerGroupInstanceTypeR42xlarge GameServerGroupInstanceType = "r4.2xlarge" + GameServerGroupInstanceTypeR44xlarge GameServerGroupInstanceType = "r4.4xlarge" + GameServerGroupInstanceTypeR48xlarge GameServerGroupInstanceType = "r4.8xlarge" + GameServerGroupInstanceTypeR416xlarge GameServerGroupInstanceType = "r4.16xlarge" + GameServerGroupInstanceTypeR5Large GameServerGroupInstanceType = "r5.large" + GameServerGroupInstanceTypeR5Xlarge GameServerGroupInstanceType = "r5.xlarge" + GameServerGroupInstanceTypeR52xlarge GameServerGroupInstanceType = "r5.2xlarge" + GameServerGroupInstanceTypeR54xlarge GameServerGroupInstanceType = "r5.4xlarge" + GameServerGroupInstanceTypeR58xlarge GameServerGroupInstanceType = "r5.8xlarge" + GameServerGroupInstanceTypeR512xlarge GameServerGroupInstanceType = "r5.12xlarge" + GameServerGroupInstanceTypeR516xlarge GameServerGroupInstanceType = "r5.16xlarge" + GameServerGroupInstanceTypeR524xlarge GameServerGroupInstanceType = "r5.24xlarge" + GameServerGroupInstanceTypeM4Large GameServerGroupInstanceType = "m4.large" + GameServerGroupInstanceTypeM4Xlarge GameServerGroupInstanceType = "m4.xlarge" + GameServerGroupInstanceTypeM42xlarge GameServerGroupInstanceType = "m4.2xlarge" + GameServerGroupInstanceTypeM44xlarge GameServerGroupInstanceType = "m4.4xlarge" + GameServerGroupInstanceTypeM410xlarge GameServerGroupInstanceType = "m4.10xlarge" + GameServerGroupInstanceTypeM5Large GameServerGroupInstanceType = "m5.large" + GameServerGroupInstanceTypeM5Xlarge GameServerGroupInstanceType = "m5.xlarge" + GameServerGroupInstanceTypeM52xlarge GameServerGroupInstanceType = "m5.2xlarge" + GameServerGroupInstanceTypeM54xlarge GameServerGroupInstanceType = "m5.4xlarge" + GameServerGroupInstanceTypeM58xlarge GameServerGroupInstanceType = "m5.8xlarge" + GameServerGroupInstanceTypeM512xlarge GameServerGroupInstanceType = "m5.12xlarge" + GameServerGroupInstanceTypeM516xlarge GameServerGroupInstanceType = "m5.16xlarge" + GameServerGroupInstanceTypeM524xlarge GameServerGroupInstanceType = "m5.24xlarge" +) + // Values returns all known values for GameServerGroupInstanceType. 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. @@ -674,6 +810,18 @@ func (IpProtocol) Values() []IpProtocol { type MatchmakingConfigurationStatus string +// Enum values for MatchmakingConfigurationStatus +const ( + MatchmakingConfigurationStatusCancelled MatchmakingConfigurationStatus = "CANCELLED" + MatchmakingConfigurationStatusCompleted MatchmakingConfigurationStatus = "COMPLETED" + MatchmakingConfigurationStatusFailed MatchmakingConfigurationStatus = "FAILED" + MatchmakingConfigurationStatusPlacing MatchmakingConfigurationStatus = "PLACING" + MatchmakingConfigurationStatusQueued MatchmakingConfigurationStatus = "QUEUED" + MatchmakingConfigurationStatusRequiresAcceptance MatchmakingConfigurationStatus = "REQUIRES_ACCEPTANCE" + MatchmakingConfigurationStatusSearching MatchmakingConfigurationStatus = "SEARCHING" + MatchmakingConfigurationStatusTimedOut MatchmakingConfigurationStatus = "TIMED_OUT" +) + // Values returns all known values for MatchmakingConfigurationStatus. 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 @@ -693,6 +841,21 @@ func (MatchmakingConfigurationStatus) Values() []MatchmakingConfigurationStatus type MetricName string +// Enum values for MetricName +const ( + MetricNameActivatinggamesessions MetricName = "ActivatingGameSessions" + MetricNameActivegamesessions MetricName = "ActiveGameSessions" + MetricNameActiveinstances MetricName = "ActiveInstances" + MetricNameAvailablegamesessions MetricName = "AvailableGameSessions" + MetricNameAvailableplayersessions MetricName = "AvailablePlayerSessions" + MetricNameCurrentplayersessions MetricName = "CurrentPlayerSessions" + MetricNameIdleinstances MetricName = "IdleInstances" + MetricNamePercentavailablegamesessions MetricName = "PercentAvailableGameSessions" + MetricNamePercentidleinstances MetricName = "PercentIdleInstances" + MetricNameQueuedepth MetricName = "QueueDepth" + MetricNameWaittime MetricName = "WaitTime" +) + // Values returns all known values for MetricName. 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. diff --git a/service/globalaccelerator/api_op_ListByoipCidrs.go b/service/globalaccelerator/api_op_ListByoipCidrs.go index f56b756e059..85d5c08d6e0 100644 --- a/service/globalaccelerator/api_op_ListByoipCidrs.go +++ b/service/globalaccelerator/api_op_ListByoipCidrs.go @@ -4,6 +4,7 @@ package globalaccelerator 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/globalaccelerator/types" @@ -108,6 +109,93 @@ func addOperationListByoipCidrsMiddlewares(stack *middleware.Stack, options Opti return nil } +// ListByoipCidrsAPIClient is a client that implements the ListByoipCidrs +// operation. +type ListByoipCidrsAPIClient interface { + ListByoipCidrs(context.Context, *ListByoipCidrsInput, ...func(*Options)) (*ListByoipCidrsOutput, error) +} + +var _ ListByoipCidrsAPIClient = (*Client)(nil) + +// ListByoipCidrsPaginatorOptions is the paginator options for ListByoipCidrs +type ListByoipCidrsPaginatorOptions struct { + // The maximum number of results to return with a single call. To retrieve the + // remaining results, make another call 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 +} + +// ListByoipCidrsPaginator is a paginator for ListByoipCidrs +type ListByoipCidrsPaginator struct { + options ListByoipCidrsPaginatorOptions + client ListByoipCidrsAPIClient + params *ListByoipCidrsInput + nextToken *string + firstPage bool +} + +// NewListByoipCidrsPaginator returns a new ListByoipCidrsPaginator +func NewListByoipCidrsPaginator(client ListByoipCidrsAPIClient, params *ListByoipCidrsInput, optFns ...func(*ListByoipCidrsPaginatorOptions)) *ListByoipCidrsPaginator { + options := ListByoipCidrsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListByoipCidrsInput{} + } + + return &ListByoipCidrsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListByoipCidrsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListByoipCidrs page. +func (p *ListByoipCidrsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListByoipCidrsOutput, 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.ListByoipCidrs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListByoipCidrs(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/globalaccelerator/types/enums.go b/service/globalaccelerator/types/enums.go index 780b18fedcd..c416a500ff2 100644 --- a/service/globalaccelerator/types/enums.go +++ b/service/globalaccelerator/types/enums.go @@ -4,6 +4,12 @@ package types type AcceleratorStatus string +// Enum values for AcceleratorStatus +const ( + AcceleratorStatusDeployed AcceleratorStatus = "DEPLOYED" + AcceleratorStatusInProgress AcceleratorStatus = "IN_PROGRESS" +) + // Values returns all known values for AcceleratorStatus. 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. @@ -52,6 +58,12 @@ func (ByoipCidrState) Values() []ByoipCidrState { type ClientAffinity string +// Enum values for ClientAffinity +const ( + ClientAffinityNone ClientAffinity = "NONE" + ClientAffinitySourceIp ClientAffinity = "SOURCE_IP" +) + // Values returns all known values for ClientAffinity. 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. @@ -64,6 +76,12 @@ func (ClientAffinity) Values() []ClientAffinity { type CustomRoutingAcceleratorStatus string +// Enum values for CustomRoutingAcceleratorStatus +const ( + CustomRoutingAcceleratorStatusDeployed CustomRoutingAcceleratorStatus = "DEPLOYED" + CustomRoutingAcceleratorStatusInProgress CustomRoutingAcceleratorStatus = "IN_PROGRESS" +) + // Values returns all known values for CustomRoutingAcceleratorStatus. 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 @@ -134,6 +152,13 @@ func (HealthCheckProtocol) Values() []HealthCheckProtocol { type HealthState string +// Enum values for HealthState +const ( + HealthStateInitial HealthState = "INITIAL" + HealthStateHealthy HealthState = "HEALTHY" + HealthStateUnhealthy HealthState = "UNHEALTHY" +) + // Values returns all known values for HealthState. 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. diff --git a/service/glue/deserializers.go b/service/glue/deserializers.go index 1c7adc5bedc..1a05bc1ec06 100644 --- a/service/glue/deserializers.go +++ b/service/glue/deserializers.go @@ -21323,6 +21323,93 @@ func awsAwsjson11_deserializeDocumentColumnErrors(v *[]types.ColumnError, value return nil } +func awsAwsjson11_deserializeDocumentColumnImportance(v **types.ColumnImportance, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ColumnImportance + if *v == nil { + sv = &types.ColumnImportance{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ColumnName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NameString to be of type string, got %T instead", value) + } + sv.ColumnName = ptr.String(jtv) + } + + case "Importance": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected GenericBoundedDouble to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Importance = ptr.Float64(f64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentColumnImportanceList(v *[]types.ColumnImportance, 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.ColumnImportance + if *v == nil { + cv = []types.ColumnImportance{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ColumnImportance + destAddr := &col + if err := awsAwsjson11_deserializeDocumentColumnImportance(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentColumnList(v *[]types.Column, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -24783,6 +24870,11 @@ func awsAwsjson11_deserializeDocumentFindMatchesMetrics(v **types.FindMatchesMet sv.AreaUnderPRCurve = ptr.Float64(f64) } + case "ColumnImportances": + if err := awsAwsjson11_deserializeDocumentColumnImportanceList(&sv.ColumnImportances, value); err != nil { + return err + } + case "ConfusionMatrix": if err := awsAwsjson11_deserializeDocumentConfusionMatrix(&sv.ConfusionMatrix, value); err != nil { return err diff --git a/service/glue/types/enums.go b/service/glue/types/enums.go index a3cde1d0df3..613c0388a7d 100644 --- a/service/glue/types/enums.go +++ b/service/glue/types/enums.go @@ -1021,6 +1021,13 @@ func (UpdateBehavior) Values() []UpdateBehavior { type WorkerType string +// Enum values for WorkerType +const ( + WorkerTypeStandard WorkerType = "Standard" + WorkerTypeG1x WorkerType = "G.1X" + WorkerTypeG2x WorkerType = "G.2X" +) + // Values returns all known values for WorkerType. 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. diff --git a/service/glue/types/types.go b/service/glue/types/types.go index b09844fdead..da804783ad0 100644 --- a/service/glue/types/types.go +++ b/service/glue/types/types.go @@ -314,6 +314,12 @@ type ColumnError struct { Error *ErrorDetail } +type ColumnImportance struct { + ColumnName *string + + Importance *float64 +} + // Represents the generated column-level statistics for a table or partition. type ColumnStatistics struct { @@ -1333,6 +1339,8 @@ type FindMatchesMetrics struct { // (https://en.wikipedia.org/wiki/Precision_and_recall) in Wikipedia. AreaUnderPRCurve *float64 + ColumnImportances []ColumnImportance + // The confusion matrix shows you what your transform is predicting accurately and // what types of errors it is making. For more information, see Confusion matrix // (https://en.wikipedia.org/wiki/Confusion_matrix) in Wikipedia. diff --git a/service/greengrassv2/LICENSE.txt b/service/greengrassv2/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/greengrassv2/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/service/greengrassv2/api_client.go b/service/greengrassv2/api_client.go new file mode 100644 index 00000000000..df1d4bc2f8b --- /dev/null +++ b/service/greengrassv2/api_client.go @@ -0,0 +1,235 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + 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" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "time" +) + +const ServiceID = "GreengrassV2" +const ServiceAPIVersion = "2020-11-30" + +// Client provides the API client to make operations call for AWS IoT Greengrass +// V2. +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) + + 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 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 + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. + Retryer retry.Retryer + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient +} + +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) { + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + for _, fn := range optFns { + fn(&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 +} + +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) +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + Retryer: cfg.Retryer, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + } + resolveAWSEndpointResolver(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + if o.HTTPClient != nil { + return + } + o.HTTPClient = awshttp.NewBuildableClient() +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + o.Retryer = retry.NewStandard() +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil { + return + } + o.EndpointResolver = WithEndpointResolver(cfg.EndpointResolver, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddUserAgentKey("greengrassv2")(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) +} + +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) +} diff --git a/service/greengrassv2/api_op_CancelDeployment.go b/service/greengrassv2/api_op_CancelDeployment.go new file mode 100644 index 00000000000..9eeceb8e3fd --- /dev/null +++ b/service/greengrassv2/api_op_CancelDeployment.go @@ -0,0 +1,115 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Cancels a deployment. This operation cancels the deployment for devices that +// haven't yet received it. If a device already received the deployment, this +// operation doesn't change anything for that device. +func (c *Client) CancelDeployment(ctx context.Context, params *CancelDeploymentInput, optFns ...func(*Options)) (*CancelDeploymentOutput, error) { + if params == nil { + params = &CancelDeploymentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CancelDeployment", params, optFns, addOperationCancelDeploymentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CancelDeploymentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CancelDeploymentInput struct { + + // The ID of the deployment. + // + // This member is required. + DeploymentId *string +} + +type CancelDeploymentOutput struct { + + // A message that communicates if the cancel was successful. + Message *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCancelDeploymentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCancelDeployment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCancelDeployment{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCancelDeploymentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelDeployment(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opCancelDeployment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "greengrass", + OperationName: "CancelDeployment", + } +} diff --git a/service/greengrassv2/api_op_CreateComponentVersion.go b/service/greengrassv2/api_op_CreateComponentVersion.go new file mode 100644 index 00000000000..625d0b307b8 --- /dev/null +++ b/service/greengrassv2/api_op_CreateComponentVersion.go @@ -0,0 +1,185 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +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/greengrassv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates a component. Components are software that run on AWS IoT Greengrass core +// devices. After you develop and test a component on your core device, you can use +// this operation to upload your component to AWS IoT Greengrass. Then, you can +// deploy the component to other core devices. You can use this operation to do the +// following: +// +// * Create components from recipes Create a component from a recipe, +// which is a file that defines the component's metadata, parameters, dependencies, +// lifecycle, artifacts, and platform capability. For more information, see AWS IoT +// Greengrass component recipe reference +// (https://docs.aws.amazon.com/greengrass/v2/developerguide/component-recipe-reference.html) +// in the AWS IoT Greengrass V2 Developer Guide. To create a component from a +// recipe, specify inlineRecipe when you call this operation. +// +// * Create components +// from Lambda functions Create a component from an AWS Lambda function that runs +// on AWS IoT Greengrass. This creates a recipe and artifacts from the Lambda +// function's deployment package. You can use this operation to migrate Lambda +// functions from AWS IoT Greengrass V1 to AWS IoT Greengrass V2. This function +// only accepts Lambda functions that use the following runtimes: +// +// * Python 2.7 – +// python2.7 +// +// * Python 3.7 – python3.7 +// +// * Python 3.8 – python3.8 +// +// * Java 8 – +// java8 +// +// * Node.js 10 – nodejs10.x +// +// * Node.js 12 – nodejs12.x +// +// To create a +// component from a Lambda function, specify lambdaFunction when you call this +// operation. +func (c *Client) CreateComponentVersion(ctx context.Context, params *CreateComponentVersionInput, optFns ...func(*Options)) (*CreateComponentVersionOutput, error) { + if params == nil { + params = &CreateComponentVersionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateComponentVersion", params, optFns, addOperationCreateComponentVersionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateComponentVersionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateComponentVersionInput struct { + + // The recipe to use to create the component. The recipe defines the component's + // metadata, parameters, dependencies, lifecycle, artifacts, and platform + // compatibility. You must specify either inlineRecipe or lambdaFunction. + InlineRecipe []byte + + // The parameters to create a component from a Lambda function. You must specify + // either inlineRecipe or lambdaFunction. + LambdaFunction *types.LambdaFunctionRecipeSource + + // A list of key-value pairs that contain metadata for the resource. For more + // information, see Tag your resources + // (https://docs.aws.amazon.com/greengrass/v2/tag-resources.html) in the AWS IoT + // Greengrass V2 Developer Guide. + Tags map[string]string +} + +type CreateComponentVersionOutput struct { + + // The name of the component. + // + // This member is required. + ComponentName *string + + // The version of the component. + // + // This member is required. + ComponentVersion *string + + // The time at which the component was created, expressed in ISO 8601 format. + // + // This member is required. + CreationTimestamp *time.Time + + // The status of the component version in AWS IoT Greengrass V2. This status is + // different from the status of the component on a core device. + // + // This member is required. + Status *types.CloudComponentStatus + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the component version. + Arn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCreateComponentVersionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateComponentVersion{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateComponentVersion{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateComponentVersionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateComponentVersion(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opCreateComponentVersion(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "greengrass", + OperationName: "CreateComponentVersion", + } +} diff --git a/service/greengrassv2/api_op_CreateDeployment.go b/service/greengrassv2/api_op_CreateDeployment.go new file mode 100644 index 00000000000..794356db8a0 --- /dev/null +++ b/service/greengrassv2/api_op_CreateDeployment.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +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/greengrassv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a continuous deployment for a target, which is a AWS IoT Greengrass core +// device or group of core devices. When you add a new core device to a group of +// core devices that has a deployment, AWS IoT Greengrass deploys that group's +// deployment to the new device. You can define one deployment for each target. +// When you create a new deployment for a target that has an existing deployment, +// you replace the previous deployment. AWS IoT Greengrass applies the new +// deployment to the target devices. Every deployment has a revision number that +// indicates how many deployment revisions you define for a target. Use this +// operation to create a new revision of an existing deployment. This operation +// returns the revision number of the new deployment when you create it. For more +// information, see the Create deployments +// (https://docs.aws.amazon.com/greengrass/v2/latest/developerguide/create-deployments.html) +// in the AWS IoT Greengrass V2 Developer Guide. +func (c *Client) CreateDeployment(ctx context.Context, params *CreateDeploymentInput, optFns ...func(*Options)) (*CreateDeploymentOutput, error) { + if params == nil { + params = &CreateDeploymentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDeployment", params, optFns, addOperationCreateDeploymentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDeploymentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDeploymentInput struct { + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the target AWS IoT thing or thing group. + // + // This member is required. + TargetArn *string + + // The components to deploy. This is a dictionary, where each key is the name of a + // component, and each key's value is the version and configuration to deploy for + // that component. + Components map[string]types.ComponentDeploymentSpecification + + // The name of the deployment. You can create deployments without names. If you + // create a deployment without a name, the AWS IoT Greengrass V2 console shows the + // deployment name as :, where targetType and targetName are the type and name of + // the deployment target. + DeploymentName *string + + // The deployment policies for the deployment. These policies define how the + // deployment updates components and handles failure. + DeploymentPolicies *types.DeploymentPolicies + + // The job configuration for the deployment configuration. The job configuration + // specifies the rollout, timeout, and stop configurations for the deployment + // configuration. + IotJobConfiguration *types.DeploymentIoTJobConfiguration + + // A list of key-value pairs that contain metadata for the resource. For more + // information, see Tag your resources + // (https://docs.aws.amazon.com/greengrass/v2/tag-resources.html) in the AWS IoT + // Greengrass V2 Developer Guide. + Tags map[string]string +} + +type CreateDeploymentOutput struct { + + // The ID of the deployment. + DeploymentId *string + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the AWS IoT job that applies the deployment to target devices. + IotJobArn *string + + // The ID of the AWS IoT job that applies the deployment to target devices. + IotJobId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCreateDeploymentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateDeployment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateDeployment{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateDeploymentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDeployment(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opCreateDeployment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "greengrass", + OperationName: "CreateDeployment", + } +} diff --git a/service/greengrassv2/api_op_DeleteComponent.go b/service/greengrassv2/api_op_DeleteComponent.go new file mode 100644 index 00000000000..13ca95b405f --- /dev/null +++ b/service/greengrassv2/api_op_DeleteComponent.go @@ -0,0 +1,115 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a version of a component from AWS IoT Greengrass. This operation deletes +// the component's recipe and artifacts. As a result, deployments that refer to +// this component version will fail. If you have deployments that use this +// component version, you can remove the component from the deployment or update +// the deployment to use a valid version. +func (c *Client) DeleteComponent(ctx context.Context, params *DeleteComponentInput, optFns ...func(*Options)) (*DeleteComponentOutput, error) { + if params == nil { + params = &DeleteComponentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteComponent", params, optFns, addOperationDeleteComponentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteComponentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteComponentInput struct { + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the component version. + // + // This member is required. + Arn *string +} + +type DeleteComponentOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteComponentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteComponent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteComponent{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteComponentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteComponent(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDeleteComponent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "greengrass", + OperationName: "DeleteComponent", + } +} diff --git a/service/greengrassv2/api_op_DeleteCoreDevice.go b/service/greengrassv2/api_op_DeleteCoreDevice.go new file mode 100644 index 00000000000..be7d5f6227c --- /dev/null +++ b/service/greengrassv2/api_op_DeleteCoreDevice.go @@ -0,0 +1,114 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a AWS IoT Greengrass core device, which is an AWS IoT thing. This +// operation removes the core device from the list of core devices. This operation +// doesn't delete the AWS IoT thing. For more information about how to delete the +// AWS IoT thing, see DeleteThing +// (https://docs.aws.amazon.com/iot/latest/apireference/API_DeleteThing.html) in +// the AWS IoT API Reference. +func (c *Client) DeleteCoreDevice(ctx context.Context, params *DeleteCoreDeviceInput, optFns ...func(*Options)) (*DeleteCoreDeviceOutput, error) { + if params == nil { + params = &DeleteCoreDeviceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteCoreDevice", params, optFns, addOperationDeleteCoreDeviceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteCoreDeviceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteCoreDeviceInput struct { + + // The name of the core device. This is also the name of the AWS IoT thing. + // + // This member is required. + CoreDeviceThingName *string +} + +type DeleteCoreDeviceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteCoreDeviceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteCoreDevice{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteCoreDevice{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteCoreDeviceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCoreDevice(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDeleteCoreDevice(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "greengrass", + OperationName: "DeleteCoreDevice", + } +} diff --git a/service/greengrassv2/api_op_DescribeComponent.go b/service/greengrassv2/api_op_DescribeComponent.go new file mode 100644 index 00000000000..adf3c5921da --- /dev/null +++ b/service/greengrassv2/api_op_DescribeComponent.go @@ -0,0 +1,147 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +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/greengrassv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves metadata for a version of a component. +func (c *Client) DescribeComponent(ctx context.Context, params *DescribeComponentInput, optFns ...func(*Options)) (*DescribeComponentOutput, error) { + if params == nil { + params = &DescribeComponentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeComponent", params, optFns, addOperationDescribeComponentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeComponentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeComponentInput struct { + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the component version. + // + // This member is required. + Arn *string +} + +type DescribeComponentOutput struct { + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the component version. + Arn *string + + // The name of the component. + ComponentName *string + + // The version of the component. + ComponentVersion *string + + // The time at which the component was created, expressed in ISO 8601 format. + CreationTimestamp *time.Time + + // The description of the component version. + Description *string + + // The platforms that the component version supports. + Platforms []types.ComponentPlatform + + // The publisher of the component version. + Publisher *string + + // The status of the component version in AWS IoT Greengrass V2. This status is + // different from the status of the component on a core device. + Status *types.CloudComponentStatus + + // A list of key-value pairs that contain metadata for the resource. For more + // information, see Tag your resources + // (https://docs.aws.amazon.com/greengrass/v2/tag-resources.html) in the AWS IoT + // Greengrass V2 Developer Guide. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDescribeComponentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeComponent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeComponent{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeComponentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeComponent(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDescribeComponent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "greengrass", + OperationName: "DescribeComponent", + } +} diff --git a/service/greengrassv2/api_op_GetComponent.go b/service/greengrassv2/api_op_GetComponent.go new file mode 100644 index 00000000000..b1f8ab54324 --- /dev/null +++ b/service/greengrassv2/api_op_GetComponent.go @@ -0,0 +1,133 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +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/greengrassv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets the recipe for a version of a component. Core devices can call this +// operation to identify the artifacts and requirements to install a component. +func (c *Client) GetComponent(ctx context.Context, params *GetComponentInput, optFns ...func(*Options)) (*GetComponentOutput, error) { + if params == nil { + params = &GetComponentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetComponent", params, optFns, addOperationGetComponentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetComponentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetComponentInput struct { + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the component version. + // + // This member is required. + Arn *string + + // The format of the recipe. + RecipeOutputFormat types.RecipeOutputFormat +} + +type GetComponentOutput struct { + + // The recipe of the component version. + // + // This member is required. + Recipe []byte + + // The format of the recipe. + // + // This member is required. + RecipeOutputFormat types.RecipeOutputFormat + + // A list of key-value pairs that contain metadata for the resource. For more + // information, see Tag your resources + // (https://docs.aws.amazon.com/greengrass/v2/tag-resources.html) in the AWS IoT + // Greengrass V2 Developer Guide. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetComponentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetComponent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetComponent{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetComponentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetComponent(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetComponent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "greengrass", + OperationName: "GetComponent", + } +} diff --git a/service/greengrassv2/api_op_GetComponentVersionArtifact.go b/service/greengrassv2/api_op_GetComponentVersionArtifact.go new file mode 100644 index 00000000000..e402091e1ca --- /dev/null +++ b/service/greengrassv2/api_op_GetComponentVersionArtifact.go @@ -0,0 +1,124 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +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 pre-signed URL to a component artifact in an S3 bucket. Core devices +// can call this operation to identify the URL that they can use to download an +// artifact to install. +func (c *Client) GetComponentVersionArtifact(ctx context.Context, params *GetComponentVersionArtifactInput, optFns ...func(*Options)) (*GetComponentVersionArtifactOutput, error) { + if params == nil { + params = &GetComponentVersionArtifactInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetComponentVersionArtifact", params, optFns, addOperationGetComponentVersionArtifactMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetComponentVersionArtifactOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetComponentVersionArtifactInput struct { + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the component version. + // + // This member is required. + Arn *string + + // The name of the artifact. + // + // This member is required. + ArtifactName *string +} + +type GetComponentVersionArtifactOutput struct { + + // The URL to the artifact. + // + // This member is required. + PreSignedUrl *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetComponentVersionArtifactMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetComponentVersionArtifact{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetComponentVersionArtifact{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetComponentVersionArtifactValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetComponentVersionArtifact(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetComponentVersionArtifact(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "greengrass", + OperationName: "GetComponentVersionArtifact", + } +} diff --git a/service/greengrassv2/api_op_GetCoreDevice.go b/service/greengrassv2/api_op_GetCoreDevice.go new file mode 100644 index 00000000000..5e9c0fe28bd --- /dev/null +++ b/service/greengrassv2/api_op_GetCoreDevice.go @@ -0,0 +1,149 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +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/greengrassv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves metadata for a AWS IoT Greengrass core device. +func (c *Client) GetCoreDevice(ctx context.Context, params *GetCoreDeviceInput, optFns ...func(*Options)) (*GetCoreDeviceOutput, error) { + if params == nil { + params = &GetCoreDeviceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetCoreDevice", params, optFns, addOperationGetCoreDeviceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetCoreDeviceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetCoreDeviceInput struct { + + // The name of the core device. This is also the name of the AWS IoT thing. + // + // This member is required. + CoreDeviceThingName *string +} + +type GetCoreDeviceOutput struct { + + // The computer architecture of the core device. + Architecture *string + + // The name of the core device. This is also the name of the AWS IoT thing. + CoreDeviceThingName *string + + // The version of the AWS IoT Greengrass Core software that the core device runs. + // This version is equivalent to the version of the AWS IoT Greengrass nucleus + // component that runs on the core device. For more information, see the AWS IoT + // Greengrass nucleus component + // (https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html) + // in the AWS IoT Greengrass V2 Developer Guide. + CoreVersion *string + + // The time at which the core device's status last updated, expressed in ISO 8601 + // format. + LastStatusUpdateTimestamp *time.Time + + // The operating system platform that the core device runs. + Platform *string + + // The status of the core device. The core device status can be: + // + // * HEALTHY – The + // AWS IoT Greengrass Core software and all components run on the core device + // without issue. + // + // * UNHEALTHY – The AWS IoT Greengrass Core software or a + // component is in a failed state on the core device. + Status types.CoreDeviceStatus + + // A list of key-value pairs that contain metadata for the resource. For more + // information, see Tag your resources + // (https://docs.aws.amazon.com/greengrass/v2/tag-resources.html) in the AWS IoT + // Greengrass V2 Developer Guide. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetCoreDeviceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetCoreDevice{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetCoreDevice{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetCoreDeviceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCoreDevice(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetCoreDevice(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "greengrass", + OperationName: "GetCoreDevice", + } +} diff --git a/service/greengrassv2/api_op_GetDeployment.go b/service/greengrassv2/api_op_GetDeployment.go new file mode 100644 index 00000000000..e51379b96a0 --- /dev/null +++ b/service/greengrassv2/api_op_GetDeployment.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +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/greengrassv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Gets a deployment. Deployments define the components that run on AWS IoT +// Greengrass core devices. +func (c *Client) GetDeployment(ctx context.Context, params *GetDeploymentInput, optFns ...func(*Options)) (*GetDeploymentOutput, error) { + if params == nil { + params = &GetDeploymentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDeployment", params, optFns, addOperationGetDeploymentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDeploymentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDeploymentInput struct { + + // The ID of the deployment. + // + // This member is required. + DeploymentId *string +} + +type GetDeploymentOutput struct { + + // The components to deploy. This is a dictionary, where each key is the name of a + // component, and each key's value is the version and configuration to deploy for + // that component. + Components map[string]types.ComponentDeploymentSpecification + + // The time at which the deployment was created, expressed in ISO 8601 format. + CreationTimestamp *time.Time + + // The ID of the deployment. + DeploymentId *string + + // The name of the deployment. You can create deployments without names. If you + // create a deployment without a name, the AWS IoT Greengrass V2 console shows the + // deployment name as :, where targetType and targetName are the type and name of + // the deployment target. + DeploymentName *string + + // The deployment policies for the deployment. These policies define how the + // deployment updates components and handles failure. + DeploymentPolicies *types.DeploymentPolicies + + // The status of the deployment. + DeploymentStatus types.DeploymentStatus + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the AWS IoT job that applies the deployment to target devices. + IotJobArn *string + + // The job configuration for the deployment configuration. The job configuration + // specifies the rollout, timeout, and stop configurations for the deployment + // configuration. + IotJobConfiguration *types.DeploymentIoTJobConfiguration + + // The ID of the AWS IoT job that applies the deployment to target devices. + IotJobId *string + + // Whether or not the deployment is the latest revision for its target. + IsLatestForTarget bool + + // The revision number of the deployment. + RevisionId *string + + // A list of key-value pairs that contain metadata for the resource. For more + // information, see Tag your resources + // (https://docs.aws.amazon.com/greengrass/v2/tag-resources.html) in the AWS IoT + // Greengrass V2 Developer Guide. + Tags map[string]string + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the target AWS IoT thing or thing group. + TargetArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetDeploymentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDeployment{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDeployment{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetDeploymentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDeployment(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetDeployment(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "greengrass", + OperationName: "GetDeployment", + } +} diff --git a/service/greengrassv2/api_op_ListComponentVersions.go b/service/greengrassv2/api_op_ListComponentVersions.go new file mode 100644 index 00000000000..3ba964ee9ff --- /dev/null +++ b/service/greengrassv2/api_op_ListComponentVersions.go @@ -0,0 +1,210 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +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/greengrassv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a paginated list of all versions for a component. +func (c *Client) ListComponentVersions(ctx context.Context, params *ListComponentVersionsInput, optFns ...func(*Options)) (*ListComponentVersionsOutput, error) { + if params == nil { + params = &ListComponentVersionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListComponentVersions", params, optFns, addOperationListComponentVersionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListComponentVersionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListComponentVersionsInput struct { + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the component version. + // + // This member is required. + Arn *string + + // The maximum number of results to be returned per paginated request. + MaxResults int32 + + // The token to be used for the next set of paginated results. + NextToken *string +} + +type ListComponentVersionsOutput struct { + + // A list of versions that exist for the component. + ComponentVersions []types.ComponentVersionListItem + + // The token for the next set of results, or null if there are no additional + // results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListComponentVersionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListComponentVersions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListComponentVersions{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListComponentVersionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListComponentVersions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListComponentVersionsAPIClient is a client that implements the +// ListComponentVersions operation. +type ListComponentVersionsAPIClient interface { + ListComponentVersions(context.Context, *ListComponentVersionsInput, ...func(*Options)) (*ListComponentVersionsOutput, error) +} + +var _ ListComponentVersionsAPIClient = (*Client)(nil) + +// ListComponentVersionsPaginatorOptions is the paginator options for +// ListComponentVersions +type ListComponentVersionsPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListComponentVersionsPaginator is a paginator for ListComponentVersions +type ListComponentVersionsPaginator struct { + options ListComponentVersionsPaginatorOptions + client ListComponentVersionsAPIClient + params *ListComponentVersionsInput + nextToken *string + firstPage bool +} + +// NewListComponentVersionsPaginator returns a new ListComponentVersionsPaginator +func NewListComponentVersionsPaginator(client ListComponentVersionsAPIClient, params *ListComponentVersionsInput, optFns ...func(*ListComponentVersionsPaginatorOptions)) *ListComponentVersionsPaginator { + options := ListComponentVersionsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListComponentVersionsInput{} + } + + return &ListComponentVersionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListComponentVersionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListComponentVersions page. +func (p *ListComponentVersionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListComponentVersionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListComponentVersions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListComponentVersions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "greengrass", + OperationName: "ListComponentVersions", + } +} diff --git a/service/greengrassv2/api_op_ListComponents.go b/service/greengrassv2/api_op_ListComponents.go new file mode 100644 index 00000000000..e526a3a14be --- /dev/null +++ b/service/greengrassv2/api_op_ListComponents.go @@ -0,0 +1,203 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +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/greengrassv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a paginated list of component summaries. This list includes components +// that you have permission to view. +func (c *Client) ListComponents(ctx context.Context, params *ListComponentsInput, optFns ...func(*Options)) (*ListComponentsOutput, error) { + if params == nil { + params = &ListComponentsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListComponents", params, optFns, addOperationListComponentsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListComponentsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListComponentsInput struct { + + // The maximum number of results to be returned per paginated request. + MaxResults int32 + + // The token to be used for the next set of paginated results. + NextToken *string + + // The scope of the components to list. Default: PRIVATE + Scope types.ComponentVisibilityScope +} + +type ListComponentsOutput struct { + + // A list that summarizes each component. + Components []types.Component + + // The token for the next set of results, or null if there are no additional + // results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListComponentsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListComponents{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListComponents{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListComponents(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListComponentsAPIClient is a client that implements the ListComponents +// operation. +type ListComponentsAPIClient interface { + ListComponents(context.Context, *ListComponentsInput, ...func(*Options)) (*ListComponentsOutput, error) +} + +var _ ListComponentsAPIClient = (*Client)(nil) + +// ListComponentsPaginatorOptions is the paginator options for ListComponents +type ListComponentsPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListComponentsPaginator is a paginator for ListComponents +type ListComponentsPaginator struct { + options ListComponentsPaginatorOptions + client ListComponentsAPIClient + params *ListComponentsInput + nextToken *string + firstPage bool +} + +// NewListComponentsPaginator returns a new ListComponentsPaginator +func NewListComponentsPaginator(client ListComponentsAPIClient, params *ListComponentsInput, optFns ...func(*ListComponentsPaginatorOptions)) *ListComponentsPaginator { + options := ListComponentsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListComponentsInput{} + } + + return &ListComponentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListComponentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListComponents page. +func (p *ListComponentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListComponentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListComponents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListComponents(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "greengrass", + OperationName: "ListComponents", + } +} diff --git a/service/greengrassv2/api_op_ListCoreDevices.go b/service/greengrassv2/api_op_ListCoreDevices.go new file mode 100644 index 00000000000..7822315cf56 --- /dev/null +++ b/service/greengrassv2/api_op_ListCoreDevices.go @@ -0,0 +1,216 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +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/greengrassv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a paginated list of AWS IoT Greengrass core devices. +func (c *Client) ListCoreDevices(ctx context.Context, params *ListCoreDevicesInput, optFns ...func(*Options)) (*ListCoreDevicesOutput, error) { + if params == nil { + params = &ListCoreDevicesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListCoreDevices", params, optFns, addOperationListCoreDevicesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListCoreDevicesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListCoreDevicesInput struct { + + // The maximum number of results to be returned per paginated request. + MaxResults int32 + + // The token to be used for the next set of paginated results. + NextToken *string + + // The core device status by which to filter. If you specify this parameter, the + // list includes only core devices that have this status. Choose one of the + // following options: + // + // * HEALTHY – The AWS IoT Greengrass Core software and all + // components run on the core device without issue. + // + // * UNHEALTHY – The AWS IoT + // Greengrass Core software or a component is in a failed state on the core device. + Status types.CoreDeviceStatus + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the AWS IoT thing group by which to filter. If you specify this parameter, the + // list includes only core devices that are members of this thing group. + ThingGroupArn *string +} + +type ListCoreDevicesOutput struct { + + // A list that summarizes each core device. + CoreDevices []types.CoreDevice + + // The token for the next set of results, or null if there are no additional + // results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListCoreDevicesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListCoreDevices{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCoreDevices{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListCoreDevices(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListCoreDevicesAPIClient is a client that implements the ListCoreDevices +// operation. +type ListCoreDevicesAPIClient interface { + ListCoreDevices(context.Context, *ListCoreDevicesInput, ...func(*Options)) (*ListCoreDevicesOutput, error) +} + +var _ ListCoreDevicesAPIClient = (*Client)(nil) + +// ListCoreDevicesPaginatorOptions is the paginator options for ListCoreDevices +type ListCoreDevicesPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListCoreDevicesPaginator is a paginator for ListCoreDevices +type ListCoreDevicesPaginator struct { + options ListCoreDevicesPaginatorOptions + client ListCoreDevicesAPIClient + params *ListCoreDevicesInput + nextToken *string + firstPage bool +} + +// NewListCoreDevicesPaginator returns a new ListCoreDevicesPaginator +func NewListCoreDevicesPaginator(client ListCoreDevicesAPIClient, params *ListCoreDevicesInput, optFns ...func(*ListCoreDevicesPaginatorOptions)) *ListCoreDevicesPaginator { + options := ListCoreDevicesPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListCoreDevicesInput{} + } + + return &ListCoreDevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCoreDevicesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListCoreDevices page. +func (p *ListCoreDevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCoreDevicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListCoreDevices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListCoreDevices(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "greengrass", + OperationName: "ListCoreDevices", + } +} diff --git a/service/greengrassv2/api_op_ListDeployments.go b/service/greengrassv2/api_op_ListDeployments.go new file mode 100644 index 00000000000..780eb6b57e2 --- /dev/null +++ b/service/greengrassv2/api_op_ListDeployments.go @@ -0,0 +1,215 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +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/greengrassv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a paginated list of deployments. +func (c *Client) ListDeployments(ctx context.Context, params *ListDeploymentsInput, optFns ...func(*Options)) (*ListDeploymentsOutput, error) { + if params == nil { + params = &ListDeploymentsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListDeployments", params, optFns, addOperationListDeploymentsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListDeploymentsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListDeploymentsInput struct { + + // The filter for the list of deployments. Choose one of the following options: + // + // * + // ALL – The list includes all deployments. + // + // * LATEST_ONLY – The list includes only + // the latest revision of each deployment. + // + // Default: LATEST_ONLY + HistoryFilter types.DeploymentHistoryFilter + + // The maximum number of results to be returned per paginated request. + MaxResults int32 + + // The token to be used for the next set of paginated results. + NextToken *string + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the target AWS IoT thing or thing group. + TargetArn *string +} + +type ListDeploymentsOutput struct { + + // A list that summarizes each deployment. + Deployments []types.Deployment + + // The token for the next set of results, or null if there are no additional + // results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListDeploymentsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListDeployments{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDeployments{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListDeployments(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListDeploymentsAPIClient is a client that implements the ListDeployments +// operation. +type ListDeploymentsAPIClient interface { + ListDeployments(context.Context, *ListDeploymentsInput, ...func(*Options)) (*ListDeploymentsOutput, error) +} + +var _ ListDeploymentsAPIClient = (*Client)(nil) + +// ListDeploymentsPaginatorOptions is the paginator options for ListDeployments +type ListDeploymentsPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListDeploymentsPaginator is a paginator for ListDeployments +type ListDeploymentsPaginator struct { + options ListDeploymentsPaginatorOptions + client ListDeploymentsAPIClient + params *ListDeploymentsInput + nextToken *string + firstPage bool +} + +// NewListDeploymentsPaginator returns a new ListDeploymentsPaginator +func NewListDeploymentsPaginator(client ListDeploymentsAPIClient, params *ListDeploymentsInput, optFns ...func(*ListDeploymentsPaginatorOptions)) *ListDeploymentsPaginator { + options := ListDeploymentsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeploymentsInput{} + } + + return &ListDeploymentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeploymentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDeployments page. +func (p *ListDeploymentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeploymentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListDeployments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListDeployments(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "greengrass", + OperationName: "ListDeployments", + } +} diff --git a/service/greengrassv2/api_op_ListEffectiveDeployments.go b/service/greengrassv2/api_op_ListEffectiveDeployments.go new file mode 100644 index 00000000000..9a2e1a301f2 --- /dev/null +++ b/service/greengrassv2/api_op_ListEffectiveDeployments.go @@ -0,0 +1,210 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +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/greengrassv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a paginated list of deployment jobs that AWS IoT Greengrass sends to +// AWS IoT Greengrass core devices. +func (c *Client) ListEffectiveDeployments(ctx context.Context, params *ListEffectiveDeploymentsInput, optFns ...func(*Options)) (*ListEffectiveDeploymentsOutput, error) { + if params == nil { + params = &ListEffectiveDeploymentsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListEffectiveDeployments", params, optFns, addOperationListEffectiveDeploymentsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListEffectiveDeploymentsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListEffectiveDeploymentsInput struct { + + // The name of the core device. This is also the name of the AWS IoT thing. + // + // This member is required. + CoreDeviceThingName *string + + // The maximum number of results to be returned per paginated request. + MaxResults int32 + + // The token to be used for the next set of paginated results. + NextToken *string +} + +type ListEffectiveDeploymentsOutput struct { + + // A list that summarizes each deployment on the core device. + EffectiveDeployments []types.EffectiveDeployment + + // The token for the next set of results, or null if there are no additional + // results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListEffectiveDeploymentsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListEffectiveDeployments{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListEffectiveDeployments{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListEffectiveDeploymentsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListEffectiveDeployments(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListEffectiveDeploymentsAPIClient is a client that implements the +// ListEffectiveDeployments operation. +type ListEffectiveDeploymentsAPIClient interface { + ListEffectiveDeployments(context.Context, *ListEffectiveDeploymentsInput, ...func(*Options)) (*ListEffectiveDeploymentsOutput, error) +} + +var _ ListEffectiveDeploymentsAPIClient = (*Client)(nil) + +// ListEffectiveDeploymentsPaginatorOptions is the paginator options for +// ListEffectiveDeployments +type ListEffectiveDeploymentsPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListEffectiveDeploymentsPaginator is a paginator for ListEffectiveDeployments +type ListEffectiveDeploymentsPaginator struct { + options ListEffectiveDeploymentsPaginatorOptions + client ListEffectiveDeploymentsAPIClient + params *ListEffectiveDeploymentsInput + nextToken *string + firstPage bool +} + +// NewListEffectiveDeploymentsPaginator returns a new +// ListEffectiveDeploymentsPaginator +func NewListEffectiveDeploymentsPaginator(client ListEffectiveDeploymentsAPIClient, params *ListEffectiveDeploymentsInput, optFns ...func(*ListEffectiveDeploymentsPaginatorOptions)) *ListEffectiveDeploymentsPaginator { + options := ListEffectiveDeploymentsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListEffectiveDeploymentsInput{} + } + + return &ListEffectiveDeploymentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEffectiveDeploymentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListEffectiveDeployments page. +func (p *ListEffectiveDeploymentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEffectiveDeploymentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListEffectiveDeployments(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListEffectiveDeployments(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "greengrass", + OperationName: "ListEffectiveDeployments", + } +} diff --git a/service/greengrassv2/api_op_ListInstalledComponents.go b/service/greengrassv2/api_op_ListInstalledComponents.go new file mode 100644 index 00000000000..046002d0052 --- /dev/null +++ b/service/greengrassv2/api_op_ListInstalledComponents.go @@ -0,0 +1,210 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +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/greengrassv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a paginated list of the components that a AWS IoT Greengrass core +// device runs. +func (c *Client) ListInstalledComponents(ctx context.Context, params *ListInstalledComponentsInput, optFns ...func(*Options)) (*ListInstalledComponentsOutput, error) { + if params == nil { + params = &ListInstalledComponentsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListInstalledComponents", params, optFns, addOperationListInstalledComponentsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListInstalledComponentsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListInstalledComponentsInput struct { + + // The name of the core device. This is also the name of the AWS IoT thing. + // + // This member is required. + CoreDeviceThingName *string + + // The maximum number of results to be returned per paginated request. + MaxResults int32 + + // The token to be used for the next set of paginated results. + NextToken *string +} + +type ListInstalledComponentsOutput struct { + + // A list that summarizes each component on the core device. + InstalledComponents []types.InstalledComponent + + // The token for the next set of results, or null if there are no additional + // results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListInstalledComponentsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListInstalledComponents{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListInstalledComponents{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListInstalledComponentsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListInstalledComponents(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListInstalledComponentsAPIClient is a client that implements the +// ListInstalledComponents operation. +type ListInstalledComponentsAPIClient interface { + ListInstalledComponents(context.Context, *ListInstalledComponentsInput, ...func(*Options)) (*ListInstalledComponentsOutput, error) +} + +var _ ListInstalledComponentsAPIClient = (*Client)(nil) + +// ListInstalledComponentsPaginatorOptions is the paginator options for +// ListInstalledComponents +type ListInstalledComponentsPaginatorOptions struct { + // The maximum number of results to be returned per paginated request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListInstalledComponentsPaginator is a paginator for ListInstalledComponents +type ListInstalledComponentsPaginator struct { + options ListInstalledComponentsPaginatorOptions + client ListInstalledComponentsAPIClient + params *ListInstalledComponentsInput + nextToken *string + firstPage bool +} + +// NewListInstalledComponentsPaginator returns a new +// ListInstalledComponentsPaginator +func NewListInstalledComponentsPaginator(client ListInstalledComponentsAPIClient, params *ListInstalledComponentsInput, optFns ...func(*ListInstalledComponentsPaginatorOptions)) *ListInstalledComponentsPaginator { + options := ListInstalledComponentsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListInstalledComponentsInput{} + } + + return &ListInstalledComponentsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListInstalledComponentsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListInstalledComponents page. +func (p *ListInstalledComponentsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListInstalledComponentsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListInstalledComponents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListInstalledComponents(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "greengrass", + OperationName: "ListInstalledComponents", + } +} diff --git a/service/greengrassv2/api_op_ListTagsForResource.go b/service/greengrassv2/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..100315222c6 --- /dev/null +++ b/service/greengrassv2/api_op_ListTagsForResource.go @@ -0,0 +1,118 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +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" +) + +// Retrieves the list of tags for an AWS IoT Greengrass 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, addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the resource. + // + // This member is required. + ResourceArn *string +} + +type ListTagsForResourceOutput struct { + + // A list of key-value pairs that contain metadata for the resource. For more + // information, see Tag your resources + // (https://docs.aws.amazon.com/greengrass/v2/tag-resources.html) in the AWS IoT + // Greengrass V2 Developer Guide. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "greengrass", + OperationName: "ListTagsForResource", + } +} diff --git a/service/greengrassv2/api_op_ResolveComponentCandidates.go b/service/greengrassv2/api_op_ResolveComponentCandidates.go new file mode 100644 index 00000000000..809ab4011f0 --- /dev/null +++ b/service/greengrassv2/api_op_ResolveComponentCandidates.go @@ -0,0 +1,135 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +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/greengrassv2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a list of components that meet the component, version, and platform +// requirements of a deployment. AWS IoT Greengrass core devices call this +// operation when they receive a deployment to identify the components to install. +// This operation identifies components that meet all dependency requirements for a +// deployment. If the requirements conflict, then this operation returns an error +// and the deployment fails. For example, this occurs if component A requires +// version >2.0.0 and component B requires version <2.0.0 of a component +// dependency. When you specify the component candidates to resolve, AWS IoT +// Greengrass compares each component's digest from the core device with the +// component's digest in the AWS Cloud. If the digests don't match, then AWS IoT +// Greengrass specifies to use the version from the AWS Cloud. To use this +// operation, you must use the data plane API endpoint and authenticate with an AWS +// IoT device certificate. For more information, see AWS IoT Greengrass endpoints +// and quotas +// (https://docs.aws.amazon.com/https:/docs.aws.amazon.com/general/latest/gr/greengrass.html). +func (c *Client) ResolveComponentCandidates(ctx context.Context, params *ResolveComponentCandidatesInput, optFns ...func(*Options)) (*ResolveComponentCandidatesOutput, error) { + if params == nil { + params = &ResolveComponentCandidatesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ResolveComponentCandidates", params, optFns, addOperationResolveComponentCandidatesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ResolveComponentCandidatesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ResolveComponentCandidatesInput struct { + + // The list of components to resolve. + // + // This member is required. + ComponentCandidates []types.ComponentCandidate + + // The platform to use to resolve compatible components. + // + // This member is required. + Platform *types.ComponentPlatform +} + +type ResolveComponentCandidatesOutput struct { + + // A list of components that meet the requirements that you specify in the request. + // This list includes each component's recipe that you can use to install the + // component. + ResolvedComponentVersions []types.ResolvedComponentVersion + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationResolveComponentCandidatesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpResolveComponentCandidates{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpResolveComponentCandidates{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpResolveComponentCandidatesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opResolveComponentCandidates(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opResolveComponentCandidates(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "greengrass", + OperationName: "ResolveComponentCandidates", + } +} diff --git a/service/greengrassv2/api_op_TagResource.go b/service/greengrassv2/api_op_TagResource.go new file mode 100644 index 00000000000..5ddcdc2ddc7 --- /dev/null +++ b/service/greengrassv2/api_op_TagResource.go @@ -0,0 +1,120 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +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 tags to an AWS IoT Greengrass resource. If a tag already exists for the +// resource, this operation updates the tag's value. +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, addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the resource to tag. + // + // This member is required. + ResourceArn *string + + // A list of key-value pairs that contain metadata for the resource. For more + // information, see Tag your resources + // (https://docs.aws.amazon.com/greengrass/v2/tag-resources.html) in the AWS IoT + // Greengrass V2 Developer Guide. + // + // This member is required. + Tags map[string]string +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "greengrass", + OperationName: "TagResource", + } +} diff --git a/service/greengrassv2/api_op_UntagResource.go b/service/greengrassv2/api_op_UntagResource.go new file mode 100644 index 00000000000..2ced6b159d8 --- /dev/null +++ b/service/greengrassv2/api_op_UntagResource.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes a tag from an AWS IoT Greengrass resource. +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the resource to untag. + // + // This member is required. + ResourceArn *string + + // A list of keys for tags to remove from the resource. + // + // This member is required. + TagKeys []string +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "greengrass", + OperationName: "UntagResource", + } +} diff --git a/service/greengrassv2/deserializers.go b/service/greengrassv2/deserializers.go new file mode 100644 index 00000000000..c1ee52b04f1 --- /dev/null +++ b/service/greengrassv2/deserializers.go @@ -0,0 +1,5959 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +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/greengrassv2/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" + "strconv" + "strings" +) + +type awsRestjson1_deserializeOpCancelDeployment struct { +} + +func (*awsRestjson1_deserializeOpCancelDeployment) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCancelDeployment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCancelDeployment(response, &metadata) + } + output := &CancelDeploymentOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCancelDeploymentOutput(&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_deserializeOpErrorCancelDeployment(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCancelDeploymentOutput(v **CancelDeploymentOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CancelDeploymentOutput + if *v == nil { + sv = &CancelDeploymentOutput{} + } 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 NonEmptyString to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateComponentVersion struct { +} + +func (*awsRestjson1_deserializeOpCreateComponentVersion) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateComponentVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateComponentVersion(response, &metadata) + } + output := &CreateComponentVersionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateComponentVersionOutput(&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_deserializeOpErrorCreateComponentVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateComponentVersionOutput(v **CreateComponentVersionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateComponentVersionOutput + if *v == nil { + sv = &CreateComponentVersionOutput{} + } 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 ComponentVersionARN to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "componentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentNameString to be of type string, got %T instead", value) + } + sv.ComponentName = ptr.String(jtv) + } + + case "componentVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentVersionString to be of type string, got %T instead", value) + } + sv.ComponentVersion = ptr.String(jtv) + } + + case "creationTimestamp": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "status": + if err := awsRestjson1_deserializeDocumentCloudComponentStatus(&sv.Status, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateDeployment struct { +} + +func (*awsRestjson1_deserializeOpCreateDeployment) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateDeployment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateDeployment(response, &metadata) + } + output := &CreateDeploymentOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateDeploymentOutput(&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_deserializeOpErrorCreateDeployment(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateDeploymentOutput(v **CreateDeploymentOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateDeploymentOutput + if *v == nil { + sv = &CreateDeploymentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "deploymentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.DeploymentId = ptr.String(jtv) + } + + case "iotJobArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IoTJobARN to be of type string, got %T instead", value) + } + sv.IotJobArn = ptr.String(jtv) + } + + case "iotJobId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.IotJobId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteComponent struct { +} + +func (*awsRestjson1_deserializeOpDeleteComponent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteComponent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteComponent(response, &metadata) + } + output := &DeleteComponentOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteComponent(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteCoreDevice struct { +} + +func (*awsRestjson1_deserializeOpDeleteCoreDevice) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteCoreDevice) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteCoreDevice(response, &metadata) + } + output := &DeleteCoreDeviceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteCoreDevice(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDescribeComponent struct { +} + +func (*awsRestjson1_deserializeOpDescribeComponent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDescribeComponent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDescribeComponent(response, &metadata) + } + output := &DescribeComponentOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentDescribeComponentOutput(&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_deserializeOpErrorDescribeComponent(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDescribeComponentOutput(v **DescribeComponentOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeComponentOutput + if *v == nil { + sv = &DescribeComponentOutput{} + } 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 ComponentVersionARN to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "componentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentNameString to be of type string, got %T instead", value) + } + sv.ComponentName = ptr.String(jtv) + } + + case "componentVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentVersionString to be of type string, got %T instead", value) + } + sv.ComponentVersion = ptr.String(jtv) + } + + case "creationTimestamp": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DescriptionString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "platforms": + if err := awsRestjson1_deserializeDocumentComponentPlatformList(&sv.Platforms, value); err != nil { + return err + } + + case "publisher": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PublisherString to be of type string, got %T instead", value) + } + sv.Publisher = ptr.String(jtv) + } + + case "status": + if err := awsRestjson1_deserializeDocumentCloudComponentStatus(&sv.Status, 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_deserializeOpGetComponent struct { +} + +func (*awsRestjson1_deserializeOpGetComponent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetComponent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetComponent(response, &metadata) + } + output := &GetComponentOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetComponentOutput(&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_deserializeOpErrorGetComponent(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetComponentOutput(v **GetComponentOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetComponentOutput + if *v == nil { + sv = &GetComponentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "recipe": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecipeBlob to be []byte, got %T instead", value) + } + dv, err := base64.StdEncoding.DecodeString(jtv) + if err != nil { + return fmt.Errorf("failed to base64 decode RecipeBlob, %w", err) + } + sv.Recipe = dv + } + + case "recipeOutputFormat": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecipeOutputFormat to be of type string, got %T instead", value) + } + sv.RecipeOutputFormat = types.RecipeOutputFormat(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetComponentVersionArtifact struct { +} + +func (*awsRestjson1_deserializeOpGetComponentVersionArtifact) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetComponentVersionArtifact) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetComponentVersionArtifact(response, &metadata) + } + output := &GetComponentVersionArtifactOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetComponentVersionArtifactOutput(&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_deserializeOpErrorGetComponentVersionArtifact(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetComponentVersionArtifactOutput(v **GetComponentVersionArtifactOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetComponentVersionArtifactOutput + if *v == nil { + sv = &GetComponentVersionArtifactOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "preSignedUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.PreSignedUrl = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetCoreDevice struct { +} + +func (*awsRestjson1_deserializeOpGetCoreDevice) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetCoreDevice) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetCoreDevice(response, &metadata) + } + output := &GetCoreDeviceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetCoreDeviceOutput(&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_deserializeOpErrorGetCoreDevice(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetCoreDeviceOutput(v **GetCoreDeviceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetCoreDeviceOutput + if *v == nil { + sv = &GetCoreDeviceOutput{} + } 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 CoreDeviceArchitectureString to be of type string, got %T instead", value) + } + sv.Architecture = ptr.String(jtv) + } + + case "coreDeviceThingName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CoreDeviceThingName to be of type string, got %T instead", value) + } + sv.CoreDeviceThingName = ptr.String(jtv) + } + + case "coreVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GGCVersion to be of type string, got %T instead", value) + } + sv.CoreVersion = ptr.String(jtv) + } + + case "lastStatusUpdateTimestamp": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastStatusUpdateTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "platform": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CoreDevicePlatformString to be of type string, got %T instead", value) + } + sv.Platform = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CoreDeviceStatus to be of type string, got %T instead", value) + } + sv.Status = types.CoreDeviceStatus(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetDeployment struct { +} + +func (*awsRestjson1_deserializeOpGetDeployment) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetDeployment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetDeployment(response, &metadata) + } + output := &GetDeploymentOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetDeploymentOutput(&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_deserializeOpErrorGetDeployment(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetDeploymentOutput(v **GetDeploymentOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetDeploymentOutput + if *v == nil { + sv = &GetDeploymentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "components": + if err := awsRestjson1_deserializeDocumentComponentDeploymentSpecifications(&sv.Components, value); err != nil { + return err + } + + case "creationTimestamp": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "deploymentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.DeploymentId = ptr.String(jtv) + } + + case "deploymentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NullableString to be of type string, got %T instead", value) + } + sv.DeploymentName = ptr.String(jtv) + } + + case "deploymentPolicies": + if err := awsRestjson1_deserializeDocumentDeploymentPolicies(&sv.DeploymentPolicies, value); err != nil { + return err + } + + case "deploymentStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeploymentStatus to be of type string, got %T instead", value) + } + sv.DeploymentStatus = types.DeploymentStatus(jtv) + } + + case "iotJobArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IoTJobARN to be of type string, got %T instead", value) + } + sv.IotJobArn = ptr.String(jtv) + } + + case "iotJobConfiguration": + if err := awsRestjson1_deserializeDocumentDeploymentIoTJobConfiguration(&sv.IotJobConfiguration, value); err != nil { + return err + } + + case "iotJobId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NullableString to be of type string, got %T instead", value) + } + sv.IotJobId = ptr.String(jtv) + } + + case "isLatestForTarget": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected IsLatestForTarget to be of type *bool, got %T instead", value) + } + sv.IsLatestForTarget = jtv + } + + case "revisionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RevisionId = ptr.String(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "targetArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetARN to be of type string, got %T instead", value) + } + sv.TargetArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListComponents struct { +} + +func (*awsRestjson1_deserializeOpListComponents) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListComponents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListComponents(response, &metadata) + } + output := &ListComponentsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListComponentsOutput(&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_deserializeOpErrorListComponents(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListComponentsOutput(v **ListComponentsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListComponentsOutput + if *v == nil { + sv = &ListComponentsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "components": + if err := awsRestjson1_deserializeDocumentComponentList(&sv.Components, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextTokenString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListComponentVersions struct { +} + +func (*awsRestjson1_deserializeOpListComponentVersions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListComponentVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListComponentVersions(response, &metadata) + } + output := &ListComponentVersionsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListComponentVersionsOutput(&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_deserializeOpErrorListComponentVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListComponentVersionsOutput(v **ListComponentVersionsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListComponentVersionsOutput + if *v == nil { + sv = &ListComponentVersionsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "componentVersions": + if err := awsRestjson1_deserializeDocumentComponentVersionList(&sv.ComponentVersions, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextTokenString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListCoreDevices struct { +} + +func (*awsRestjson1_deserializeOpListCoreDevices) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListCoreDevices) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListCoreDevices(response, &metadata) + } + output := &ListCoreDevicesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListCoreDevicesOutput(&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_deserializeOpErrorListCoreDevices(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListCoreDevicesOutput(v **ListCoreDevicesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListCoreDevicesOutput + if *v == nil { + sv = &ListCoreDevicesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "coreDevices": + if err := awsRestjson1_deserializeDocumentCoreDevicesList(&sv.CoreDevices, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextTokenString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListDeployments struct { +} + +func (*awsRestjson1_deserializeOpListDeployments) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListDeployments) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListDeployments(response, &metadata) + } + output := &ListDeploymentsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListDeploymentsOutput(&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_deserializeOpErrorListDeployments(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListDeploymentsOutput(v **ListDeploymentsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListDeploymentsOutput + if *v == nil { + sv = &ListDeploymentsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "deployments": + if err := awsRestjson1_deserializeDocumentDeploymentList(&sv.Deployments, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextTokenString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListEffectiveDeployments struct { +} + +func (*awsRestjson1_deserializeOpListEffectiveDeployments) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListEffectiveDeployments) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListEffectiveDeployments(response, &metadata) + } + output := &ListEffectiveDeploymentsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListEffectiveDeploymentsOutput(&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_deserializeOpErrorListEffectiveDeployments(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListEffectiveDeploymentsOutput(v **ListEffectiveDeploymentsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListEffectiveDeploymentsOutput + if *v == nil { + sv = &ListEffectiveDeploymentsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "effectiveDeployments": + if err := awsRestjson1_deserializeDocumentEffectiveDeploymentsList(&sv.EffectiveDeployments, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextTokenString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListInstalledComponents struct { +} + +func (*awsRestjson1_deserializeOpListInstalledComponents) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListInstalledComponents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListInstalledComponents(response, &metadata) + } + output := &ListInstalledComponentsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListInstalledComponentsOutput(&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_deserializeOpErrorListInstalledComponents(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListInstalledComponentsOutput(v **ListInstalledComponentsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListInstalledComponentsOutput + if *v == nil { + sv = &ListInstalledComponentsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "installedComponents": + if err := awsRestjson1_deserializeDocumentInstalledComponentList(&sv.InstalledComponents, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextTokenString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_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_deserializeOpResolveComponentCandidates struct { +} + +func (*awsRestjson1_deserializeOpResolveComponentCandidates) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpResolveComponentCandidates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorResolveComponentCandidates(response, &metadata) + } + output := &ResolveComponentCandidatesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentResolveComponentCandidatesOutput(&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_deserializeOpErrorResolveComponentCandidates(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentResolveComponentCandidatesOutput(v **ResolveComponentCandidatesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ResolveComponentCandidatesOutput + if *v == nil { + sv = &ResolveComponentCandidatesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "resolvedComponentVersions": + if err := awsRestjson1_deserializeDocumentResolvedComponentVersionsList(&sv.ResolvedComponentVersions, 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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsInternalServerException(v *types.InternalServerException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = int32(vv) + } + + return nil +} +func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = int32(vv) + } + + return nil +} +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_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) + + if err := awsRestjson1_deserializeOpHttpBindingsInternalServerException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceQuotaExceededException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_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) + + if err := awsRestjson1_deserializeOpHttpBindingsThrottlingException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + 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_deserializeDocumentCloudComponentStatus(v **types.CloudComponentStatus, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CloudComponentStatus + if *v == nil { + sv = &types.CloudComponentStatus{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "componentState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CloudComponentState to be of type string, got %T instead", value) + } + sv.ComponentState = types.CloudComponentState(jtv) + } + + case "errors": + if err := awsRestjson1_deserializeDocumentStringMap(&sv.Errors, value); err != nil { + return err + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentComponent(v **types.Component, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Component + if *v == nil { + sv = &types.Component{} + } 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 ComponentARN to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "componentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentNameString to be of type string, got %T instead", value) + } + sv.ComponentName = ptr.String(jtv) + } + + case "latestVersion": + if err := awsRestjson1_deserializeDocumentComponentLatestVersion(&sv.LatestVersion, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentComponentConfigurationPathList(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 ComponentConfigurationPath to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentComponentConfigurationUpdate(v **types.ComponentConfigurationUpdate, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ComponentConfigurationUpdate + if *v == nil { + sv = &types.ComponentConfigurationUpdate{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "merge": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentConfigurationString to be of type string, got %T instead", value) + } + sv.Merge = ptr.String(jtv) + } + + case "reset": + if err := awsRestjson1_deserializeDocumentComponentConfigurationPathList(&sv.Reset, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentComponentDeploymentSpecification(v **types.ComponentDeploymentSpecification, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ComponentDeploymentSpecification + if *v == nil { + sv = &types.ComponentDeploymentSpecification{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "componentVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentVersionString to be of type string, got %T instead", value) + } + sv.ComponentVersion = ptr.String(jtv) + } + + case "configurationUpdate": + if err := awsRestjson1_deserializeDocumentComponentConfigurationUpdate(&sv.ConfigurationUpdate, value); err != nil { + return err + } + + case "runWith": + if err := awsRestjson1_deserializeDocumentComponentRunWith(&sv.RunWith, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentComponentDeploymentSpecifications(v *map[string]types.ComponentDeploymentSpecification, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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]types.ComponentDeploymentSpecification + if *v == nil { + mv = map[string]types.ComponentDeploymentSpecification{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.ComponentDeploymentSpecification + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentComponentDeploymentSpecification(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentComponentLatestVersion(v **types.ComponentLatestVersion, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ComponentLatestVersion + if *v == nil { + sv = &types.ComponentLatestVersion{} + } 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 ComponentVersionARN to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "componentVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentVersionString to be of type string, got %T instead", value) + } + sv.ComponentVersion = ptr.String(jtv) + } + + case "creationTimestamp": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "platforms": + if err := awsRestjson1_deserializeDocumentComponentPlatformList(&sv.Platforms, value); err != nil { + return err + } + + case "publisher": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Publisher = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentComponentList(v *[]types.Component, 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.Component + if *v == nil { + cv = []types.Component{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Component + destAddr := &col + if err := awsRestjson1_deserializeDocumentComponent(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentComponentPlatform(v **types.ComponentPlatform, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ComponentPlatform + if *v == nil { + sv = &types.ComponentPlatform{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "attributes": + if err := awsRestjson1_deserializeDocumentPlatformAttributesMap(&sv.Attributes, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentComponentPlatformList(v *[]types.ComponentPlatform, 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.ComponentPlatform + if *v == nil { + cv = []types.ComponentPlatform{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ComponentPlatform + destAddr := &col + if err := awsRestjson1_deserializeDocumentComponentPlatform(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentComponentRunWith(v **types.ComponentRunWith, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ComponentRunWith + if *v == nil { + sv = &types.ComponentRunWith{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "posixUser": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.PosixUser = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentComponentVersionList(v *[]types.ComponentVersionListItem, 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.ComponentVersionListItem + if *v == nil { + cv = []types.ComponentVersionListItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ComponentVersionListItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentComponentVersionListItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentComponentVersionListItem(v **types.ComponentVersionListItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ComponentVersionListItem + if *v == nil { + sv = &types.ComponentVersionListItem{} + } 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 NonEmptyString to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "componentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentNameString to be of type string, got %T instead", value) + } + sv.ComponentName = ptr.String(jtv) + } + + case "componentVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentVersionString to be of type string, got %T instead", value) + } + sv.ComponentVersion = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCoreDevice(v **types.CoreDevice, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CoreDevice + if *v == nil { + sv = &types.CoreDevice{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "coreDeviceThingName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CoreDeviceThingName to be of type string, got %T instead", value) + } + sv.CoreDeviceThingName = ptr.String(jtv) + } + + case "lastStatusUpdateTimestamp": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastStatusUpdateTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CoreDeviceStatus to be of type string, got %T instead", value) + } + sv.Status = types.CoreDeviceStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCoreDevicesList(v *[]types.CoreDevice, 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.CoreDevice + if *v == nil { + cv = []types.CoreDevice{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CoreDevice + destAddr := &col + if err := awsRestjson1_deserializeDocumentCoreDevice(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentDeployment(v **types.Deployment, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Deployment + if *v == nil { + sv = &types.Deployment{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "creationTimestamp": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "deploymentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.DeploymentId = ptr.String(jtv) + } + + case "deploymentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.DeploymentName = ptr.String(jtv) + } + + case "deploymentStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeploymentStatus to be of type string, got %T instead", value) + } + sv.DeploymentStatus = types.DeploymentStatus(jtv) + } + + case "isLatestForTarget": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected IsLatestForTarget to be of type *bool, got %T instead", value) + } + sv.IsLatestForTarget = jtv + } + + case "revisionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RevisionId = ptr.String(jtv) + } + + case "targetArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetARN to be of type string, got %T instead", value) + } + sv.TargetArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDeploymentComponentUpdatePolicy(v **types.DeploymentComponentUpdatePolicy, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DeploymentComponentUpdatePolicy + if *v == nil { + sv = &types.DeploymentComponentUpdatePolicy{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "action": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeploymentComponentUpdatePolicyAction to be of type string, got %T instead", value) + } + sv.Action = types.DeploymentComponentUpdatePolicyAction(jtv) + } + + case "timeoutInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected OptionalInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TimeoutInSeconds = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDeploymentConfigurationValidationPolicy(v **types.DeploymentConfigurationValidationPolicy, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DeploymentConfigurationValidationPolicy + if *v == nil { + sv = &types.DeploymentConfigurationValidationPolicy{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "timeoutInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected OptionalInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TimeoutInSeconds = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDeploymentIoTJobConfiguration(v **types.DeploymentIoTJobConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DeploymentIoTJobConfiguration + if *v == nil { + sv = &types.DeploymentIoTJobConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "abortConfig": + if err := awsRestjson1_deserializeDocumentIoTJobAbortConfig(&sv.AbortConfig, value); err != nil { + return err + } + + case "jobExecutionsRolloutConfig": + if err := awsRestjson1_deserializeDocumentIoTJobExecutionsRolloutConfig(&sv.JobExecutionsRolloutConfig, value); err != nil { + return err + } + + case "timeoutConfig": + if err := awsRestjson1_deserializeDocumentIoTJobTimeoutConfig(&sv.TimeoutConfig, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDeploymentList(v *[]types.Deployment, 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.Deployment + if *v == nil { + cv = []types.Deployment{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Deployment + destAddr := &col + if err := awsRestjson1_deserializeDocumentDeployment(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentDeploymentPolicies(v **types.DeploymentPolicies, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DeploymentPolicies + if *v == nil { + sv = &types.DeploymentPolicies{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "componentUpdatePolicy": + if err := awsRestjson1_deserializeDocumentDeploymentComponentUpdatePolicy(&sv.ComponentUpdatePolicy, value); err != nil { + return err + } + + case "configurationValidationPolicy": + if err := awsRestjson1_deserializeDocumentDeploymentConfigurationValidationPolicy(&sv.ConfigurationValidationPolicy, value); err != nil { + return err + } + + case "failureHandlingPolicy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeploymentFailureHandlingPolicy to be of type string, got %T instead", value) + } + sv.FailureHandlingPolicy = types.DeploymentFailureHandlingPolicy(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEffectiveDeployment(v **types.EffectiveDeployment, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EffectiveDeployment + if *v == nil { + sv = &types.EffectiveDeployment{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "coreDeviceExecutionStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EffectiveDeploymentExecutionStatus to be of type string, got %T instead", value) + } + sv.CoreDeviceExecutionStatus = types.EffectiveDeploymentExecutionStatus(jtv) + } + + case "creationTimestamp": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "deploymentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeploymentID to be of type string, got %T instead", value) + } + sv.DeploymentId = ptr.String(jtv) + } + + case "deploymentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeploymentName to be of type string, got %T instead", value) + } + sv.DeploymentName = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "iotJobArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IoTJobARN to be of type string, got %T instead", value) + } + sv.IotJobArn = ptr.String(jtv) + } + + case "iotJobId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IoTJobId to be of type string, got %T instead", value) + } + sv.IotJobId = ptr.String(jtv) + } + + case "modifiedTimestamp": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ModifiedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Reason to be of type string, got %T instead", value) + } + sv.Reason = ptr.String(jtv) + } + + case "targetArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetARN to be of type string, got %T instead", value) + } + sv.TargetArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEffectiveDeploymentsList(v *[]types.EffectiveDeployment, 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.EffectiveDeployment + if *v == nil { + cv = []types.EffectiveDeployment{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EffectiveDeployment + destAddr := &col + if err := awsRestjson1_deserializeDocumentEffectiveDeployment(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentInstalledComponent(v **types.InstalledComponent, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InstalledComponent + if *v == nil { + sv = &types.InstalledComponent{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "componentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentNameString to be of type string, got %T instead", value) + } + sv.ComponentName = ptr.String(jtv) + } + + case "componentVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentVersionString to be of type string, got %T instead", value) + } + sv.ComponentVersion = ptr.String(jtv) + } + + case "isRoot": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected IsRoot to be of type *bool, got %T instead", value) + } + sv.IsRoot = jtv + } + + case "lifecycleState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InstalledComponentLifecycleState to be of type string, got %T instead", value) + } + sv.LifecycleState = types.InstalledComponentLifecycleState(jtv) + } + + case "lifecycleStateDetails": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LifecycleStateDetails to be of type string, got %T instead", value) + } + sv.LifecycleStateDetails = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInstalledComponentList(v *[]types.InstalledComponent, 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.InstalledComponent + if *v == nil { + cv = []types.InstalledComponent{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.InstalledComponent + destAddr := &col + if err := awsRestjson1_deserializeDocumentInstalledComponent(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + 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 String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "retryAfterSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RetryAfterSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RetryAfterSeconds = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIoTJobAbortConfig(v **types.IoTJobAbortConfig, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.IoTJobAbortConfig + if *v == nil { + sv = &types.IoTJobAbortConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "criteriaList": + if err := awsRestjson1_deserializeDocumentIoTJobAbortCriteriaList(&sv.CriteriaList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIoTJobAbortCriteria(v **types.IoTJobAbortCriteria, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.IoTJobAbortCriteria + if *v == nil { + sv = &types.IoTJobAbortCriteria{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "action": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IoTJobAbortAction to be of type string, got %T instead", value) + } + sv.Action = types.IoTJobAbortAction(jtv) + } + + case "failureType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IoTJobExecutionFailureType to be of type string, got %T instead", value) + } + sv.FailureType = types.IoTJobExecutionFailureType(jtv) + } + + case "minNumberOfExecutedThings": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected IoTJobMinimumNumberOfExecutedThings to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MinNumberOfExecutedThings = int32(i64) + } + + case "thresholdPercentage": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected IoTJobAbortThresholdPercentage to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ThresholdPercentage = f64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIoTJobAbortCriteriaList(v *[]types.IoTJobAbortCriteria, 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.IoTJobAbortCriteria + if *v == nil { + cv = []types.IoTJobAbortCriteria{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.IoTJobAbortCriteria + destAddr := &col + if err := awsRestjson1_deserializeDocumentIoTJobAbortCriteria(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentIoTJobExecutionsRolloutConfig(v **types.IoTJobExecutionsRolloutConfig, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.IoTJobExecutionsRolloutConfig + if *v == nil { + sv = &types.IoTJobExecutionsRolloutConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "exponentialRate": + if err := awsRestjson1_deserializeDocumentIoTJobExponentialRolloutRate(&sv.ExponentialRate, value); err != nil { + return err + } + + case "maximumPerMinute": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected IoTJobMaxExecutionsPerMin to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaximumPerMinute = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIoTJobExponentialRolloutRate(v **types.IoTJobExponentialRolloutRate, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.IoTJobExponentialRolloutRate + if *v == nil { + sv = &types.IoTJobExponentialRolloutRate{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "baseRatePerMinute": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected IoTJobRolloutBaseRatePerMinute to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BaseRatePerMinute = int32(i64) + } + + case "incrementFactor": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected IoTJobRolloutIncrementFactor to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.IncrementFactor = f64 + } + + case "rateIncreaseCriteria": + if err := awsRestjson1_deserializeDocumentIoTJobRateIncreaseCriteria(&sv.RateIncreaseCriteria, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIoTJobRateIncreaseCriteria(v **types.IoTJobRateIncreaseCriteria, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.IoTJobRateIncreaseCriteria + if *v == nil { + sv = &types.IoTJobRateIncreaseCriteria{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "numberOfNotifiedThings": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected IoTJobNumberOfThings to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.NumberOfNotifiedThings = int32(i64) + } + + case "numberOfSucceededThings": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected IoTJobNumberOfThings to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.NumberOfSucceededThings = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIoTJobTimeoutConfig(v **types.IoTJobTimeoutConfig, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.IoTJobTimeoutConfig + if *v == nil { + sv = &types.IoTJobTimeoutConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "inProgressTimeoutInMinutes": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected IoTJobInProgressTimeoutInMinutes to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.InProgressTimeoutInMinutes = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPlatformAttributesMap(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 NonEmptyString to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentResolvedComponentVersion(v **types.ResolvedComponentVersion, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResolvedComponentVersion + if *v == nil { + sv = &types.ResolvedComponentVersion{} + } 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 ComponentVersionARN to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "componentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentNameString to be of type string, got %T instead", value) + } + sv.ComponentName = ptr.String(jtv) + } + + case "componentVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentVersionString to be of type string, got %T instead", value) + } + sv.ComponentVersion = ptr.String(jtv) + } + + case "recipe": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RecipeBlob to be []byte, got %T instead", value) + } + dv, err := base64.StdEncoding.DecodeString(jtv) + if err != nil { + return fmt.Errorf("failed to base64 decode RecipeBlob, %w", err) + } + sv.Recipe = dv + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResolvedComponentVersionsList(v *[]types.ResolvedComponentVersion, 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.ResolvedComponentVersion + if *v == nil { + cv = []types.ResolvedComponentVersion{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ResolvedComponentVersion + destAddr := &col + if err := awsRestjson1_deserializeDocumentResolvedComponentVersion(&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) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ServiceQuotaExceededException + if *v == nil { + sv = &types.ServiceQuotaExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "quotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + case "serviceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ServiceCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentStringMap(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 NonEmptyString to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "quotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "retryAfterSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RetryAfterSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RetryAfterSeconds = int32(i64) + } + + case "serviceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ServiceCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func 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 "fields": + if err := awsRestjson1_deserializeDocumentValidationExceptionFieldList(&sv.Fields, value); err != nil { + return err + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value) + } + sv.Reason = types.ValidationExceptionReason(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationExceptionField + if *v == nil { + sv = &types.ValidationExceptionField{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.ValidationExceptionField + if *v == nil { + cv = []types.ValidationExceptionField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ValidationExceptionField + destAddr := &col + if err := awsRestjson1_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} diff --git a/service/greengrassv2/doc.go b/service/greengrassv2/doc.go new file mode 100644 index 00000000000..7715b02cc97 --- /dev/null +++ b/service/greengrassv2/doc.go @@ -0,0 +1,20 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package greengrassv2 provides the API client, operations, and parameter types +// for AWS IoT Greengrass V2. +// +// AWS IoT Greengrass brings local compute, messaging, data management, sync, and +// ML inference capabilities to edge devices. This enables devices to collect and +// analyze data closer to the source of information, react autonomously to local +// events, and communicate securely with each other on local networks. Local +// devices can also communicate securely with AWS IoT Core and export IoT data to +// the AWS Cloud. AWS IoT Greengrass developers can use AWS Lambda functions and +// components to create and deploy applications to fleets of edge devices for local +// operation. AWS IoT Greengrass Version 2 provides a new major version of the AWS +// IoT Greengrass Core software, new APIs, and a new console. Use this API +// reference to learn how to use the AWS IoT Greengrass V2 API operations to manage +// components, manage deployments, and core devices. For more information, see What +// is AWS IoT Greengrass? +// (https://docs.aws.amazon.com/greengrass/v2/developerguide/what-is-iot-greengrass.html) +// in the AWS IoT Greengrass V2 Developer Guide. +package greengrassv2 diff --git a/service/greengrassv2/endpoints.go b/service/greengrassv2/endpoints.go new file mode 100644 index 00000000000..35f4a3284ea --- /dev/null +++ b/service/greengrassv2/endpoints.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +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/greengrassv2/internal/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/url" +) + +// 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() +} + +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") + } + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), m.Options) + 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 = "greengrass" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + 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.EndpointResolver + 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) + 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) +} + +// 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. +// awsResolver and fallbackResolver must not be nil +func WithEndpointResolver(awsResolver aws.EndpointResolver, fallbackResolver EndpointResolver) EndpointResolver { + return &wrappedEndpointResolver{ + awsResolver: awsResolver, + resolver: fallbackResolver, + } +} diff --git a/service/greengrassv2/go.mod b/service/greengrassv2/go.mod new file mode 100644 index 00000000000..2748f817fe4 --- /dev/null +++ b/service/greengrassv2/go.mod @@ -0,0 +1,10 @@ +module github.com/aws/aws-sdk-go-v2/service/greengrassv2 + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v0.30.1-0.20201222223005-ee883de66531 + github.com/aws/smithy-go v0.4.1-0.20201222001052-74df8ddd8c79 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/greengrassv2/go.sum b/service/greengrassv2/go.sum new file mode 100644 index 00000000000..934e2b5c702 --- /dev/null +++ b/service/greengrassv2/go.sum @@ -0,0 +1,14 @@ +github.com/aws/smithy-go v0.4.1-0.20201222001052-74df8ddd8c79 h1:Ufuk/0gkbBZVZ7jlujsyzn5ruWhdTFBcZDCVIy60tsQ= +github.com/aws/smithy-go v0.4.1-0.20201222001052-74df8ddd8c79/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/greengrassv2/internal/endpoints/endpoints.go b/service/greengrassv2/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..b0b9b8696a4 --- /dev/null +++ b/service/greengrassv2/internal/endpoints/endpoints.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + DisableHTTPS bool +} + +// Resolver GreengrassV2 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 := endpoints.Options{ + DisableHTTPS: options.DisableHTTPS, + } + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: endpoints.Endpoint{ + Hostname: "greengrass.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + "ap-northeast-1": endpoints.Endpoint{}, + "ap-northeast-2": endpoints.Endpoint{}, + "ap-south-1": endpoints.Endpoint{}, + "ap-southeast-1": endpoints.Endpoint{}, + "ap-southeast-2": endpoints.Endpoint{}, + "eu-central-1": endpoints.Endpoint{}, + "eu-west-1": endpoints.Endpoint{}, + "eu-west-2": endpoints.Endpoint{}, + "us-east-1": endpoints.Endpoint{}, + "us-east-2": endpoints.Endpoint{}, + "us-west-2": endpoints.Endpoint{}, + }, + }, + { + ID: "aws-cn", + Defaults: endpoints.Endpoint{ + Hostname: "greengrass.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + "cn-north-1": endpoints.Endpoint{}, + }, + }, + { + ID: "aws-iso", + Defaults: endpoints.Endpoint{ + Hostname: "greengrass.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: endpoints.Endpoint{ + Hostname: "greengrass.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: endpoints.Endpoint{ + Hostname: "greengrass.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + "dataplane-us-gov-east-1": endpoints.Endpoint{ + Hostname: "greengrass-ats.iot.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + }, + "dataplane-us-gov-west-1": endpoints.Endpoint{ + Hostname: "greengrass-ats.iot.us-gov-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-west-1", + }, + }, + "fips-us-gov-east-1": endpoints.Endpoint{ + Hostname: "greengrass-fips.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + }, + "us-gov-east-1": endpoints.Endpoint{}, + "us-gov-west-1": endpoints.Endpoint{ + Hostname: "greengrass.us-gov-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-west-1", + }, + }, + }, + }, +} diff --git a/service/greengrassv2/internal/endpoints/endpoints_test.go b/service/greengrassv2/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/greengrassv2/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/greengrassv2/protocol_test.go b/service/greengrassv2/protocol_test.go new file mode 100644 index 00000000000..7b339492e63 --- /dev/null +++ b/service/greengrassv2/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 diff --git a/service/greengrassv2/serializers.go b/service/greengrassv2/serializers.go new file mode 100644 index 00000000000..975ebe22536 --- /dev/null +++ b/service/greengrassv2/serializers.go @@ -0,0 +1,2160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/greengrassv2/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_serializeOpCancelDeployment struct { +} + +func (*awsRestjson1_serializeOpCancelDeployment) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCancelDeployment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CancelDeploymentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/greengrass/v2/deployments/{deploymentId}/cancel") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsCancelDeploymentInput(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_serializeOpHttpBindingsCancelDeploymentInput(v *CancelDeploymentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DeploymentId == nil || len(*v.DeploymentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member deploymentId must not be empty")} + } + if v.DeploymentId != nil { + if err := encoder.SetURI("deploymentId").String(*v.DeploymentId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateComponentVersion struct { +} + +func (*awsRestjson1_serializeOpCreateComponentVersion) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateComponentVersion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateComponentVersionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/greengrass/v2/createComponentVersion") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpDocumentCreateComponentVersionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateComponentVersionInput(v *CreateComponentVersionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateComponentVersionInput(v *CreateComponentVersionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.InlineRecipe != nil { + ok := object.Key("inlineRecipe") + ok.Base64EncodeBytes(v.InlineRecipe) + } + + if v.LambdaFunction != nil { + ok := object.Key("lambdaFunction") + if err := awsRestjson1_serializeDocumentLambdaFunctionRecipeSource(v.LambdaFunction, 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_serializeOpCreateDeployment struct { +} + +func (*awsRestjson1_serializeOpCreateDeployment) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateDeployment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDeploymentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/greengrass/v2/deployments") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpDocumentCreateDeploymentInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateDeploymentInput(v *CreateDeploymentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateDeploymentInput(v *CreateDeploymentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Components != nil { + ok := object.Key("components") + if err := awsRestjson1_serializeDocumentComponentDeploymentSpecifications(v.Components, ok); err != nil { + return err + } + } + + if v.DeploymentName != nil { + ok := object.Key("deploymentName") + ok.String(*v.DeploymentName) + } + + if v.DeploymentPolicies != nil { + ok := object.Key("deploymentPolicies") + if err := awsRestjson1_serializeDocumentDeploymentPolicies(v.DeploymentPolicies, ok); err != nil { + return err + } + } + + if v.IotJobConfiguration != nil { + ok := object.Key("iotJobConfiguration") + if err := awsRestjson1_serializeDocumentDeploymentIoTJobConfiguration(v.IotJobConfiguration, 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.TargetArn != nil { + ok := object.Key("targetArn") + ok.String(*v.TargetArn) + } + + return nil +} + +type awsRestjson1_serializeOpDeleteComponent struct { +} + +func (*awsRestjson1_serializeOpDeleteComponent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteComponent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteComponentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/greengrass/v2/components/{arn}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteComponentInput(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_serializeOpHttpBindingsDeleteComponentInput(v *DeleteComponentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteCoreDevice struct { +} + +func (*awsRestjson1_serializeOpDeleteCoreDevice) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteCoreDevice) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteCoreDeviceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/greengrass/v2/coreDevices/{coreDeviceThingName}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteCoreDeviceInput(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_serializeOpHttpBindingsDeleteCoreDeviceInput(v *DeleteCoreDeviceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.CoreDeviceThingName == nil || len(*v.CoreDeviceThingName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member coreDeviceThingName must not be empty")} + } + if v.CoreDeviceThingName != nil { + if err := encoder.SetURI("coreDeviceThingName").String(*v.CoreDeviceThingName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDescribeComponent struct { +} + +func (*awsRestjson1_serializeOpDescribeComponent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeComponent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeComponentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/greengrass/v2/components/{arn}/metadata") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDescribeComponentInput(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_serializeOpHttpBindingsDescribeComponentInput(v *DescribeComponentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetComponent struct { +} + +func (*awsRestjson1_serializeOpGetComponent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetComponent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetComponentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/greengrass/v2/components/{arn}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetComponentInput(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_serializeOpHttpBindingsGetComponentInput(v *GetComponentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + if len(v.RecipeOutputFormat) > 0 { + encoder.SetQuery("recipeOutputFormat").String(string(v.RecipeOutputFormat)) + } + + return nil +} + +type awsRestjson1_serializeOpGetComponentVersionArtifact struct { +} + +func (*awsRestjson1_serializeOpGetComponentVersionArtifact) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetComponentVersionArtifact) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetComponentVersionArtifactInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/greengrass/v2/components/{arn}/artifacts/{artifactName+}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetComponentVersionArtifactInput(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_serializeOpHttpBindingsGetComponentVersionArtifactInput(v *GetComponentVersionArtifactInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + if v.ArtifactName == nil || len(*v.ArtifactName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member artifactName must not be empty")} + } + if v.ArtifactName != nil { + if err := encoder.SetURI("artifactName").String(*v.ArtifactName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetCoreDevice struct { +} + +func (*awsRestjson1_serializeOpGetCoreDevice) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetCoreDevice) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetCoreDeviceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/greengrass/v2/coreDevices/{coreDeviceThingName}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetCoreDeviceInput(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_serializeOpHttpBindingsGetCoreDeviceInput(v *GetCoreDeviceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.CoreDeviceThingName == nil || len(*v.CoreDeviceThingName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member coreDeviceThingName must not be empty")} + } + if v.CoreDeviceThingName != nil { + if err := encoder.SetURI("coreDeviceThingName").String(*v.CoreDeviceThingName); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetDeployment struct { +} + +func (*awsRestjson1_serializeOpGetDeployment) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetDeployment) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetDeploymentInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/greengrass/v2/deployments/{deploymentId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetDeploymentInput(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_serializeOpHttpBindingsGetDeploymentInput(v *GetDeploymentInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DeploymentId == nil || len(*v.DeploymentId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member deploymentId must not be empty")} + } + if v.DeploymentId != nil { + if err := encoder.SetURI("deploymentId").String(*v.DeploymentId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListComponents struct { +} + +func (*awsRestjson1_serializeOpListComponents) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListComponents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListComponentsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/greengrass/v2/components") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListComponentsInput(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_serializeOpHttpBindingsListComponentsInput(v *ListComponentsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if len(v.Scope) > 0 { + encoder.SetQuery("scope").String(string(v.Scope)) + } + + return nil +} + +type awsRestjson1_serializeOpListComponentVersions struct { +} + +func (*awsRestjson1_serializeOpListComponentVersions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListComponentVersions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListComponentVersionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/greengrass/v2/components/{arn}/versions") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListComponentVersionsInput(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_serializeOpHttpBindingsListComponentVersionsInput(v *ListComponentVersionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListCoreDevices struct { +} + +func (*awsRestjson1_serializeOpListCoreDevices) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListCoreDevices) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListCoreDevicesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/greengrass/v2/coreDevices") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListCoreDevicesInput(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_serializeOpHttpBindingsListCoreDevicesInput(v *ListCoreDevicesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if len(v.Status) > 0 { + encoder.SetQuery("status").String(string(v.Status)) + } + + if v.ThingGroupArn != nil { + encoder.SetQuery("thingGroupArn").String(*v.ThingGroupArn) + } + + return nil +} + +type awsRestjson1_serializeOpListDeployments struct { +} + +func (*awsRestjson1_serializeOpListDeployments) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListDeployments) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListDeploymentsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/greengrass/v2/deployments") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListDeploymentsInput(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_serializeOpHttpBindingsListDeploymentsInput(v *ListDeploymentsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.HistoryFilter) > 0 { + encoder.SetQuery("historyFilter").String(string(v.HistoryFilter)) + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.TargetArn != nil { + encoder.SetQuery("targetArn").String(*v.TargetArn) + } + + return nil +} + +type awsRestjson1_serializeOpListEffectiveDeployments struct { +} + +func (*awsRestjson1_serializeOpListEffectiveDeployments) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListEffectiveDeployments) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListEffectiveDeploymentsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/greengrass/v2/coreDevices/{coreDeviceThingName}/effectiveDeployments") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListEffectiveDeploymentsInput(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_serializeOpHttpBindingsListEffectiveDeploymentsInput(v *ListEffectiveDeploymentsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.CoreDeviceThingName == nil || len(*v.CoreDeviceThingName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member coreDeviceThingName must not be empty")} + } + if v.CoreDeviceThingName != nil { + if err := encoder.SetURI("coreDeviceThingName").String(*v.CoreDeviceThingName); err != nil { + return err + } + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListInstalledComponents struct { +} + +func (*awsRestjson1_serializeOpListInstalledComponents) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListInstalledComponents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListInstalledComponentsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/greengrass/v2/coreDevices/{coreDeviceThingName}/installedComponents") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListInstalledComponentsInput(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_serializeOpHttpBindingsListInstalledComponentsInput(v *ListInstalledComponentsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.CoreDeviceThingName == nil || len(*v.CoreDeviceThingName) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member coreDeviceThingName must not be empty")} + } + if v.CoreDeviceThingName != nil { + if err := encoder.SetURI("coreDeviceThingName").String(*v.CoreDeviceThingName); err != nil { + return err + } + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListTagsForResource struct { +} + +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpResolveComponentCandidates struct { +} + +func (*awsRestjson1_serializeOpResolveComponentCandidates) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpResolveComponentCandidates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ResolveComponentCandidatesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/greengrass/v2/resolveComponentCandidates") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpDocumentResolveComponentCandidatesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsResolveComponentCandidatesInput(v *ResolveComponentCandidatesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentResolveComponentCandidatesInput(v *ResolveComponentCandidatesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ComponentCandidates != nil { + ok := object.Key("componentCandidates") + if err := awsRestjson1_serializeDocumentComponentCandidateList(v.ComponentCandidates, ok); err != nil { + return err + } + } + + if v.Platform != nil { + ok := object.Key("platform") + if err := awsRestjson1_serializeDocumentComponentPlatform(v.Platform, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpTagResource struct { +} + +func (*awsRestjson1_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{resourceArn}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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 = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + request.URL.RawQuery = opQuery + } + + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("resourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + if v.TagKeys != nil { + for i := range v.TagKeys { + encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + } + } + + return nil +} + +func awsRestjson1_serializeDocumentComponentCandidate(v *types.ComponentCandidate, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ComponentName != nil { + ok := object.Key("componentName") + ok.String(*v.ComponentName) + } + + if v.ComponentVersion != nil { + ok := object.Key("componentVersion") + ok.String(*v.ComponentVersion) + } + + if v.VersionRequirements != nil { + ok := object.Key("versionRequirements") + if err := awsRestjson1_serializeDocumentComponentVersionRequirementMap(v.VersionRequirements, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentComponentCandidateList(v []types.ComponentCandidate, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentComponentCandidate(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentComponentConfigurationPathList(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_serializeDocumentComponentConfigurationUpdate(v *types.ComponentConfigurationUpdate, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Merge != nil { + ok := object.Key("merge") + ok.String(*v.Merge) + } + + if v.Reset != nil { + ok := object.Key("reset") + if err := awsRestjson1_serializeDocumentComponentConfigurationPathList(v.Reset, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentComponentDependencyMap(v map[string]types.ComponentDependencyRequirement, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + mapVar := v[key] + if err := awsRestjson1_serializeDocumentComponentDependencyRequirement(&mapVar, om); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentComponentDependencyRequirement(v *types.ComponentDependencyRequirement, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.DependencyType) > 0 { + ok := object.Key("dependencyType") + ok.String(string(v.DependencyType)) + } + + if v.VersionRequirement != nil { + ok := object.Key("versionRequirement") + ok.String(*v.VersionRequirement) + } + + return nil +} + +func awsRestjson1_serializeDocumentComponentDeploymentSpecification(v *types.ComponentDeploymentSpecification, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ComponentVersion != nil { + ok := object.Key("componentVersion") + ok.String(*v.ComponentVersion) + } + + if v.ConfigurationUpdate != nil { + ok := object.Key("configurationUpdate") + if err := awsRestjson1_serializeDocumentComponentConfigurationUpdate(v.ConfigurationUpdate, ok); err != nil { + return err + } + } + + if v.RunWith != nil { + ok := object.Key("runWith") + if err := awsRestjson1_serializeDocumentComponentRunWith(v.RunWith, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentComponentDeploymentSpecifications(v map[string]types.ComponentDeploymentSpecification, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + mapVar := v[key] + if err := awsRestjson1_serializeDocumentComponentDeploymentSpecification(&mapVar, om); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentComponentPlatform(v *types.ComponentPlatform, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Attributes != nil { + ok := object.Key("attributes") + if err := awsRestjson1_serializeDocumentPlatformAttributesMap(v.Attributes, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + +func awsRestjson1_serializeDocumentComponentPlatformList(v []types.ComponentPlatform, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentComponentPlatform(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentComponentRunWith(v *types.ComponentRunWith, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PosixUser != nil { + ok := object.Key("posixUser") + ok.String(*v.PosixUser) + } + + return nil +} + +func awsRestjson1_serializeDocumentComponentVersionRequirementMap(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_serializeDocumentDeploymentComponentUpdatePolicy(v *types.DeploymentComponentUpdatePolicy, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Action) > 0 { + ok := object.Key("action") + ok.String(string(v.Action)) + } + + if v.TimeoutInSeconds != 0 { + ok := object.Key("timeoutInSeconds") + ok.Integer(v.TimeoutInSeconds) + } + + return nil +} + +func awsRestjson1_serializeDocumentDeploymentConfigurationValidationPolicy(v *types.DeploymentConfigurationValidationPolicy, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.TimeoutInSeconds != 0 { + ok := object.Key("timeoutInSeconds") + ok.Integer(v.TimeoutInSeconds) + } + + return nil +} + +func awsRestjson1_serializeDocumentDeploymentIoTJobConfiguration(v *types.DeploymentIoTJobConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AbortConfig != nil { + ok := object.Key("abortConfig") + if err := awsRestjson1_serializeDocumentIoTJobAbortConfig(v.AbortConfig, ok); err != nil { + return err + } + } + + if v.JobExecutionsRolloutConfig != nil { + ok := object.Key("jobExecutionsRolloutConfig") + if err := awsRestjson1_serializeDocumentIoTJobExecutionsRolloutConfig(v.JobExecutionsRolloutConfig, ok); err != nil { + return err + } + } + + if v.TimeoutConfig != nil { + ok := object.Key("timeoutConfig") + if err := awsRestjson1_serializeDocumentIoTJobTimeoutConfig(v.TimeoutConfig, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentDeploymentPolicies(v *types.DeploymentPolicies, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ComponentUpdatePolicy != nil { + ok := object.Key("componentUpdatePolicy") + if err := awsRestjson1_serializeDocumentDeploymentComponentUpdatePolicy(v.ComponentUpdatePolicy, ok); err != nil { + return err + } + } + + if v.ConfigurationValidationPolicy != nil { + ok := object.Key("configurationValidationPolicy") + if err := awsRestjson1_serializeDocumentDeploymentConfigurationValidationPolicy(v.ConfigurationValidationPolicy, ok); err != nil { + return err + } + } + + if len(v.FailureHandlingPolicy) > 0 { + ok := object.Key("failureHandlingPolicy") + ok.String(string(v.FailureHandlingPolicy)) + } + + return nil +} + +func awsRestjson1_serializeDocumentIoTJobAbortConfig(v *types.IoTJobAbortConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CriteriaList != nil { + ok := object.Key("criteriaList") + if err := awsRestjson1_serializeDocumentIoTJobAbortCriteriaList(v.CriteriaList, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentIoTJobAbortCriteria(v *types.IoTJobAbortCriteria, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Action) > 0 { + ok := object.Key("action") + ok.String(string(v.Action)) + } + + if len(v.FailureType) > 0 { + ok := object.Key("failureType") + ok.String(string(v.FailureType)) + } + + if v.MinNumberOfExecutedThings != 0 { + ok := object.Key("minNumberOfExecutedThings") + ok.Integer(v.MinNumberOfExecutedThings) + } + + if v.ThresholdPercentage != 0 { + ok := object.Key("thresholdPercentage") + ok.Double(v.ThresholdPercentage) + } + + return nil +} + +func awsRestjson1_serializeDocumentIoTJobAbortCriteriaList(v []types.IoTJobAbortCriteria, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentIoTJobAbortCriteria(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentIoTJobExecutionsRolloutConfig(v *types.IoTJobExecutionsRolloutConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ExponentialRate != nil { + ok := object.Key("exponentialRate") + if err := awsRestjson1_serializeDocumentIoTJobExponentialRolloutRate(v.ExponentialRate, ok); err != nil { + return err + } + } + + if v.MaximumPerMinute != 0 { + ok := object.Key("maximumPerMinute") + ok.Integer(v.MaximumPerMinute) + } + + return nil +} + +func awsRestjson1_serializeDocumentIoTJobExponentialRolloutRate(v *types.IoTJobExponentialRolloutRate, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BaseRatePerMinute != 0 { + ok := object.Key("baseRatePerMinute") + ok.Integer(v.BaseRatePerMinute) + } + + if v.IncrementFactor != 0 { + ok := object.Key("incrementFactor") + ok.Double(v.IncrementFactor) + } + + if v.RateIncreaseCriteria != nil { + ok := object.Key("rateIncreaseCriteria") + if err := awsRestjson1_serializeDocumentIoTJobRateIncreaseCriteria(v.RateIncreaseCriteria, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentIoTJobRateIncreaseCriteria(v *types.IoTJobRateIncreaseCriteria, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NumberOfNotifiedThings != 0 { + ok := object.Key("numberOfNotifiedThings") + ok.Integer(v.NumberOfNotifiedThings) + } + + if v.NumberOfSucceededThings != 0 { + ok := object.Key("numberOfSucceededThings") + ok.Integer(v.NumberOfSucceededThings) + } + + return nil +} + +func awsRestjson1_serializeDocumentIoTJobTimeoutConfig(v *types.IoTJobTimeoutConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.InProgressTimeoutInMinutes != 0 { + ok := object.Key("inProgressTimeoutInMinutes") + ok.Long(v.InProgressTimeoutInMinutes) + } + + return nil +} + +func awsRestjson1_serializeDocumentLambdaContainerParams(v *types.LambdaContainerParams, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Devices != nil { + ok := object.Key("devices") + if err := awsRestjson1_serializeDocumentLambdaDeviceList(v.Devices, ok); err != nil { + return err + } + } + + if v.MemorySizeInKB != 0 { + ok := object.Key("memorySizeInKB") + ok.Integer(v.MemorySizeInKB) + } + + if v.MountROSysfs { + ok := object.Key("mountROSysfs") + ok.Boolean(v.MountROSysfs) + } + + if v.Volumes != nil { + ok := object.Key("volumes") + if err := awsRestjson1_serializeDocumentLambdaVolumeList(v.Volumes, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentLambdaDeviceList(v []types.LambdaDeviceMount, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentLambdaDeviceMount(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentLambdaDeviceMount(v *types.LambdaDeviceMount, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AddGroupOwner { + ok := object.Key("addGroupOwner") + ok.Boolean(v.AddGroupOwner) + } + + if v.Path != nil { + ok := object.Key("path") + ok.String(*v.Path) + } + + if len(v.Permission) > 0 { + ok := object.Key("permission") + ok.String(string(v.Permission)) + } + + return nil +} + +func awsRestjson1_serializeDocumentLambdaEnvironmentVariables(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_serializeDocumentLambdaEventSource(v *types.LambdaEventSource, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Topic != nil { + ok := object.Key("topic") + ok.String(*v.Topic) + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsRestjson1_serializeDocumentLambdaEventSourceList(v []types.LambdaEventSource, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentLambdaEventSource(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentLambdaExecArgsList(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_serializeDocumentLambdaExecutionParameters(v *types.LambdaExecutionParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EnvironmentVariables != nil { + ok := object.Key("environmentVariables") + if err := awsRestjson1_serializeDocumentLambdaEnvironmentVariables(v.EnvironmentVariables, ok); err != nil { + return err + } + } + + if v.EventSources != nil { + ok := object.Key("eventSources") + if err := awsRestjson1_serializeDocumentLambdaEventSourceList(v.EventSources, ok); err != nil { + return err + } + } + + if v.ExecArgs != nil { + ok := object.Key("execArgs") + if err := awsRestjson1_serializeDocumentLambdaExecArgsList(v.ExecArgs, ok); err != nil { + return err + } + } + + if len(v.InputPayloadEncodingType) > 0 { + ok := object.Key("inputPayloadEncodingType") + ok.String(string(v.InputPayloadEncodingType)) + } + + if v.LinuxProcessParams != nil { + ok := object.Key("linuxProcessParams") + if err := awsRestjson1_serializeDocumentLambdaLinuxProcessParams(v.LinuxProcessParams, ok); err != nil { + return err + } + } + + if v.MaxIdleTimeInSeconds != 0 { + ok := object.Key("maxIdleTimeInSeconds") + ok.Integer(v.MaxIdleTimeInSeconds) + } + + if v.MaxInstancesCount != 0 { + ok := object.Key("maxInstancesCount") + ok.Integer(v.MaxInstancesCount) + } + + if v.MaxQueueSize != 0 { + ok := object.Key("maxQueueSize") + ok.Integer(v.MaxQueueSize) + } + + if v.Pinned { + ok := object.Key("pinned") + ok.Boolean(v.Pinned) + } + + if v.StatusTimeoutInSeconds != 0 { + ok := object.Key("statusTimeoutInSeconds") + ok.Integer(v.StatusTimeoutInSeconds) + } + + if v.TimeoutInSeconds != 0 { + ok := object.Key("timeoutInSeconds") + ok.Integer(v.TimeoutInSeconds) + } + + return nil +} + +func awsRestjson1_serializeDocumentLambdaFunctionRecipeSource(v *types.LambdaFunctionRecipeSource, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ComponentDependencies != nil { + ok := object.Key("componentDependencies") + if err := awsRestjson1_serializeDocumentComponentDependencyMap(v.ComponentDependencies, ok); err != nil { + return err + } + } + + if v.ComponentLambdaParameters != nil { + ok := object.Key("componentLambdaParameters") + if err := awsRestjson1_serializeDocumentLambdaExecutionParameters(v.ComponentLambdaParameters, ok); err != nil { + return err + } + } + + if v.ComponentName != nil { + ok := object.Key("componentName") + ok.String(*v.ComponentName) + } + + if v.ComponentPlatforms != nil { + ok := object.Key("componentPlatforms") + if err := awsRestjson1_serializeDocumentComponentPlatformList(v.ComponentPlatforms, ok); err != nil { + return err + } + } + + if v.ComponentVersion != nil { + ok := object.Key("componentVersion") + ok.String(*v.ComponentVersion) + } + + if v.LambdaArn != nil { + ok := object.Key("lambdaArn") + ok.String(*v.LambdaArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentLambdaLinuxProcessParams(v *types.LambdaLinuxProcessParams, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ContainerParams != nil { + ok := object.Key("containerParams") + if err := awsRestjson1_serializeDocumentLambdaContainerParams(v.ContainerParams, ok); err != nil { + return err + } + } + + if len(v.IsolationMode) > 0 { + ok := object.Key("isolationMode") + ok.String(string(v.IsolationMode)) + } + + return nil +} + +func awsRestjson1_serializeDocumentLambdaVolumeList(v []types.LambdaVolumeMount, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentLambdaVolumeMount(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentLambdaVolumeMount(v *types.LambdaVolumeMount, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AddGroupOwner { + ok := object.Key("addGroupOwner") + ok.Boolean(v.AddGroupOwner) + } + + if v.DestinationPath != nil { + ok := object.Key("destinationPath") + ok.String(*v.DestinationPath) + } + + if len(v.Permission) > 0 { + ok := object.Key("permission") + ok.String(string(v.Permission)) + } + + if v.SourcePath != nil { + ok := object.Key("sourcePath") + ok.String(*v.SourcePath) + } + + return nil +} + +func awsRestjson1_serializeDocumentPlatformAttributesMap(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_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 +} diff --git a/service/greengrassv2/types/enums.go b/service/greengrassv2/types/enums.go new file mode 100644 index 00000000000..26d14228a48 --- /dev/null +++ b/service/greengrassv2/types/enums.go @@ -0,0 +1,372 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type CloudComponentState string + +// Enum values for CloudComponentState +const ( + CloudComponentStateRequested CloudComponentState = "REQUESTED" + CloudComponentStateInitiated CloudComponentState = "INITIATED" + CloudComponentStateDeployable CloudComponentState = "DEPLOYABLE" + CloudComponentStateFailed CloudComponentState = "FAILED" + CloudComponentStateDeprecated CloudComponentState = "DEPRECATED" +) + +// Values returns all known values for CloudComponentState. 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 (CloudComponentState) Values() []CloudComponentState { + return []CloudComponentState{ + "REQUESTED", + "INITIATED", + "DEPLOYABLE", + "FAILED", + "DEPRECATED", + } +} + +type ComponentDependencyType string + +// Enum values for ComponentDependencyType +const ( + ComponentDependencyTypeHard ComponentDependencyType = "HARD" + ComponentDependencyTypeSoft ComponentDependencyType = "SOFT" +) + +// Values returns all known values for ComponentDependencyType. 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 (ComponentDependencyType) Values() []ComponentDependencyType { + return []ComponentDependencyType{ + "HARD", + "SOFT", + } +} + +type ComponentVisibilityScope string + +// Enum values for ComponentVisibilityScope +const ( + ComponentVisibilityScopePrivate ComponentVisibilityScope = "PRIVATE" + ComponentVisibilityScopePublic ComponentVisibilityScope = "PUBLIC" +) + +// Values returns all known values for ComponentVisibilityScope. 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 (ComponentVisibilityScope) Values() []ComponentVisibilityScope { + return []ComponentVisibilityScope{ + "PRIVATE", + "PUBLIC", + } +} + +type CoreDeviceStatus string + +// Enum values for CoreDeviceStatus +const ( + CoreDeviceStatusHealthy CoreDeviceStatus = "HEALTHY" + CoreDeviceStatusUnhealthy CoreDeviceStatus = "UNHEALTHY" +) + +// Values returns all known values for CoreDeviceStatus. 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 (CoreDeviceStatus) Values() []CoreDeviceStatus { + return []CoreDeviceStatus{ + "HEALTHY", + "UNHEALTHY", + } +} + +type DeploymentComponentUpdatePolicyAction string + +// Enum values for DeploymentComponentUpdatePolicyAction +const ( + DeploymentComponentUpdatePolicyActionNotifyComponents DeploymentComponentUpdatePolicyAction = "NOTIFY_COMPONENTS" + DeploymentComponentUpdatePolicyActionSkipNotifyComponents DeploymentComponentUpdatePolicyAction = "SKIP_NOTIFY_COMPONENTS" +) + +// Values returns all known values for DeploymentComponentUpdatePolicyAction. 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 (DeploymentComponentUpdatePolicyAction) Values() []DeploymentComponentUpdatePolicyAction { + return []DeploymentComponentUpdatePolicyAction{ + "NOTIFY_COMPONENTS", + "SKIP_NOTIFY_COMPONENTS", + } +} + +type DeploymentFailureHandlingPolicy string + +// Enum values for DeploymentFailureHandlingPolicy +const ( + DeploymentFailureHandlingPolicyRollback DeploymentFailureHandlingPolicy = "ROLLBACK" + DeploymentFailureHandlingPolicyDoNothing DeploymentFailureHandlingPolicy = "DO_NOTHING" +) + +// Values returns all known values for DeploymentFailureHandlingPolicy. 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 (DeploymentFailureHandlingPolicy) Values() []DeploymentFailureHandlingPolicy { + return []DeploymentFailureHandlingPolicy{ + "ROLLBACK", + "DO_NOTHING", + } +} + +type DeploymentHistoryFilter string + +// Enum values for DeploymentHistoryFilter +const ( + DeploymentHistoryFilterAll DeploymentHistoryFilter = "ALL" + DeploymentHistoryFilterLatestOnly DeploymentHistoryFilter = "LATEST_ONLY" +) + +// Values returns all known values for DeploymentHistoryFilter. 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 (DeploymentHistoryFilter) Values() []DeploymentHistoryFilter { + return []DeploymentHistoryFilter{ + "ALL", + "LATEST_ONLY", + } +} + +type DeploymentStatus string + +// Enum values for DeploymentStatus +const ( + DeploymentStatusActive DeploymentStatus = "ACTIVE" + DeploymentStatusCompleted DeploymentStatus = "COMPLETED" + DeploymentStatusCanceled DeploymentStatus = "CANCELED" + DeploymentStatusFailed DeploymentStatus = "FAILED" + DeploymentStatusInactive DeploymentStatus = "INACTIVE" +) + +// 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{ + "ACTIVE", + "COMPLETED", + "CANCELED", + "FAILED", + "INACTIVE", + } +} + +type EffectiveDeploymentExecutionStatus string + +// Enum values for EffectiveDeploymentExecutionStatus +const ( + EffectiveDeploymentExecutionStatusInProgress EffectiveDeploymentExecutionStatus = "IN_PROGRESS" + EffectiveDeploymentExecutionStatusQueued EffectiveDeploymentExecutionStatus = "QUEUED" + EffectiveDeploymentExecutionStatusFailed EffectiveDeploymentExecutionStatus = "FAILED" + EffectiveDeploymentExecutionStatusCompleted EffectiveDeploymentExecutionStatus = "COMPLETED" + EffectiveDeploymentExecutionStatusTimedOut EffectiveDeploymentExecutionStatus = "TIMED_OUT" + EffectiveDeploymentExecutionStatusCanceled EffectiveDeploymentExecutionStatus = "CANCELED" + EffectiveDeploymentExecutionStatusRejected EffectiveDeploymentExecutionStatus = "REJECTED" +) + +// Values returns all known values for EffectiveDeploymentExecutionStatus. 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 (EffectiveDeploymentExecutionStatus) Values() []EffectiveDeploymentExecutionStatus { + return []EffectiveDeploymentExecutionStatus{ + "IN_PROGRESS", + "QUEUED", + "FAILED", + "COMPLETED", + "TIMED_OUT", + "CANCELED", + "REJECTED", + } +} + +type InstalledComponentLifecycleState string + +// Enum values for InstalledComponentLifecycleState +const ( + InstalledComponentLifecycleStateNew InstalledComponentLifecycleState = "NEW" + InstalledComponentLifecycleStateInstalled InstalledComponentLifecycleState = "INSTALLED" + InstalledComponentLifecycleStateStarting InstalledComponentLifecycleState = "STARTING" + InstalledComponentLifecycleStateRunning InstalledComponentLifecycleState = "RUNNING" + InstalledComponentLifecycleStateStopping InstalledComponentLifecycleState = "STOPPING" + InstalledComponentLifecycleStateErrored InstalledComponentLifecycleState = "ERRORED" + InstalledComponentLifecycleStateBroken InstalledComponentLifecycleState = "BROKEN" + InstalledComponentLifecycleStateFinished InstalledComponentLifecycleState = "FINISHED" +) + +// Values returns all known values for InstalledComponentLifecycleState. 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 (InstalledComponentLifecycleState) Values() []InstalledComponentLifecycleState { + return []InstalledComponentLifecycleState{ + "NEW", + "INSTALLED", + "STARTING", + "RUNNING", + "STOPPING", + "ERRORED", + "BROKEN", + "FINISHED", + } +} + +type IoTJobAbortAction string + +// Enum values for IoTJobAbortAction +const ( + IoTJobAbortActionCancel IoTJobAbortAction = "CANCEL" +) + +// Values returns all known values for IoTJobAbortAction. 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 (IoTJobAbortAction) Values() []IoTJobAbortAction { + return []IoTJobAbortAction{ + "CANCEL", + } +} + +type IoTJobExecutionFailureType string + +// Enum values for IoTJobExecutionFailureType +const ( + IoTJobExecutionFailureTypeFailed IoTJobExecutionFailureType = "FAILED" + IoTJobExecutionFailureTypeRejected IoTJobExecutionFailureType = "REJECTED" + IoTJobExecutionFailureTypeTimedOut IoTJobExecutionFailureType = "TIMED_OUT" + IoTJobExecutionFailureTypeAll IoTJobExecutionFailureType = "ALL" +) + +// Values returns all known values for IoTJobExecutionFailureType. 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 (IoTJobExecutionFailureType) Values() []IoTJobExecutionFailureType { + return []IoTJobExecutionFailureType{ + "FAILED", + "REJECTED", + "TIMED_OUT", + "ALL", + } +} + +type LambdaEventSourceType string + +// Enum values for LambdaEventSourceType +const ( + LambdaEventSourceTypePubSub LambdaEventSourceType = "PUB_SUB" + LambdaEventSourceTypeIotCore LambdaEventSourceType = "IOT_CORE" +) + +// Values returns all known values for LambdaEventSourceType. 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 (LambdaEventSourceType) Values() []LambdaEventSourceType { + return []LambdaEventSourceType{ + "PUB_SUB", + "IOT_CORE", + } +} + +type LambdaFilesystemPermission string + +// Enum values for LambdaFilesystemPermission +const ( + LambdaFilesystemPermissionRo LambdaFilesystemPermission = "ro" + LambdaFilesystemPermissionRw LambdaFilesystemPermission = "rw" +) + +// Values returns all known values for LambdaFilesystemPermission. 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 (LambdaFilesystemPermission) Values() []LambdaFilesystemPermission { + return []LambdaFilesystemPermission{ + "ro", + "rw", + } +} + +type LambdaInputPayloadEncodingType string + +// Enum values for LambdaInputPayloadEncodingType +const ( + LambdaInputPayloadEncodingTypeJson LambdaInputPayloadEncodingType = "json" + LambdaInputPayloadEncodingTypeBinary LambdaInputPayloadEncodingType = "binary" +) + +// Values returns all known values for LambdaInputPayloadEncodingType. 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 (LambdaInputPayloadEncodingType) Values() []LambdaInputPayloadEncodingType { + return []LambdaInputPayloadEncodingType{ + "json", + "binary", + } +} + +type LambdaIsolationMode string + +// Enum values for LambdaIsolationMode +const ( + LambdaIsolationModeGreengrassContainer LambdaIsolationMode = "GreengrassContainer" + LambdaIsolationModeNoContainer LambdaIsolationMode = "NoContainer" +) + +// Values returns all known values for LambdaIsolationMode. 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 (LambdaIsolationMode) Values() []LambdaIsolationMode { + return []LambdaIsolationMode{ + "GreengrassContainer", + "NoContainer", + } +} + +type RecipeOutputFormat string + +// Enum values for RecipeOutputFormat +const ( + RecipeOutputFormatJson RecipeOutputFormat = "JSON" + RecipeOutputFormatYaml RecipeOutputFormat = "YAML" +) + +// Values returns all known values for RecipeOutputFormat. 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 (RecipeOutputFormat) Values() []RecipeOutputFormat { + return []RecipeOutputFormat{ + "JSON", + "YAML", + } +} + +type ValidationExceptionReason string + +// Enum values for ValidationExceptionReason +const ( + ValidationExceptionReasonUnknownOperation ValidationExceptionReason = "UNKNOWN_OPERATION" + ValidationExceptionReasonCannotParse ValidationExceptionReason = "CANNOT_PARSE" + ValidationExceptionReasonFieldValidationFailed ValidationExceptionReason = "FIELD_VALIDATION_FAILED" + ValidationExceptionReasonOther ValidationExceptionReason = "OTHER" +) + +// Values returns all known values for ValidationExceptionReason. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// The ordering of this slice is not guaranteed to be stable across updates. +func (ValidationExceptionReason) Values() []ValidationExceptionReason { + return []ValidationExceptionReason{ + "UNKNOWN_OPERATION", + "CANNOT_PARSE", + "FIELD_VALIDATION_FAILED", + "OTHER", + } +} diff --git a/service/greengrassv2/types/errors.go b/service/greengrassv2/types/errors.go new file mode 100644 index 00000000000..86fd9874833 --- /dev/null +++ b/service/greengrassv2/types/errors.go @@ -0,0 +1,152 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// You don't have permission to perform the action. +type AccessDeniedException struct { + Message *string +} + +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 { return "AccessDeniedException" } +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Your request has conflicting operations. This can occur if you're trying to +// perform more than one operation on the same resource at the same time. +type ConflictException struct { + Message *string + + ResourceId *string + ResourceType *string +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { return "ConflictException" } +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// AWS IoT Greengrass can't process your request right now. Try again later. +type InternalServerException struct { + Message *string + + RetryAfterSeconds int32 +} + +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 { return "InternalServerException" } +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The requested resource can't be found. +type ResourceNotFoundException struct { + Message *string + + ResourceId *string + ResourceType *string +} + +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 { return "ResourceNotFoundException" } +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Your request exceeds a service quota. For example, you might have the maximum +// number of components that you can create. +type ServiceQuotaExceededException struct { + Message *string + + ResourceId *string + ResourceType *string + QuotaCode *string + ServiceCode *string +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { return "ServiceQuotaExceededException" } +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Your request exceeded a request rate quota. For example, you might have exceeded +// the amount of times that you can retrieve device or deployment status per +// second. +type ThrottlingException struct { + Message *string + + QuotaCode *string + ServiceCode *string + RetryAfterSeconds int32 +} + +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 { return "ThrottlingException" } +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request isn't valid. This can occur if your request contains malformed JSON +// or unsupported characters. +type ValidationException struct { + Message *string + + Reason ValidationExceptionReason + Fields []ValidationExceptionField +} + +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 { return "ValidationException" } +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/greengrassv2/types/types.go b/service/greengrassv2/types/types.go new file mode 100644 index 00000000000..0cd02e1393d --- /dev/null +++ b/service/greengrassv2/types/types.go @@ -0,0 +1,741 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "time" +) + +// Contains the status of a component in the AWS IoT Greengrass service. +type CloudComponentStatus struct { + + // The state of the component. + ComponentState CloudComponentState + + // A dictionary of errors that communicate why the component is in an error state. + // For example, if AWS IoT Greengrass can't access an artifact for the component, + // then errors contains the artifact's URI as a key, and the error message as the + // value for that key. + Errors map[string]string + + // A message that communicates details, such as errors, about the status of the + // component. + Message *string +} + +// Contains information about a component. +type Component struct { + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the component version. + Arn *string + + // The name of the component. + ComponentName *string + + // The latest version of the component and its details. + LatestVersion *ComponentLatestVersion +} + +// Contains information about a component that is a candidate to deploy to a AWS +// IoT Greengrass core device. +type ComponentCandidate struct { + + // The name of the component. + ComponentName *string + + // The version of the component. + ComponentVersion *string + + // The version requirements for the component's dependencies. AWS IoT Greengrass + // core devices get the version requirements from component recipes. AWS IoT + // Greengrass V2 uses semantic version constraints. For more information, see + // Semantic Versioning (https://semver.org/). + VersionRequirements map[string]string +} + +// Contains information about a deployment's update to a component's configuration +// on Greengrass core devices. For more information, see Update component +// configurations +// (https://docs.aws.amazon.com/greengrass/v2/developerguide/update-component-configurations.html) +// in the AWS IoT Greengrass V2 Developer Guide. +type ComponentConfigurationUpdate struct { + + // A serialized JSON string that contains the configuration object to merge to + // target devices. The core device merges this configuration with the component's + // existing configuration. If this is the first time a component deploys on a + // device, the core device merges this configuration with the component's default + // configuration. This means that the core device keeps it's existing configuration + // for keys and values that you don't specify in this object. For more information, + // see Merge configuration updates + // (https://docs.aws.amazon.com/greengrass/v2/developerguide/update-component-configurations.html#merge-configuration-update) + // in the AWS IoT Greengrass V2 Developer Guide. + Merge *string + + // The list of configuration nodes to reset to default values on target devices. + // Use JSON pointers to specify each node to reset. JSON pointers start with a + // forward slash (/) and use forward slashes to separate the key for each level in + // the object. For more information, see the JSON pointer specification + // (https://tools.ietf.org/html/rfc6901) and Reset configuration updates + // (https://docs.aws.amazon.com/greengrass/v2/developerguide/update-component-configurations.html#reset-configuration-update) + // in the AWS IoT Greengrass V2 Developer Guide. + Reset []string +} + +// Contains information about a component dependency for a Lambda function +// component. +type ComponentDependencyRequirement struct { + + // The type of this dependency. Choose from the following options: + // + // * SOFT – The + // component doesn't restart if the dependency changes state. + // + // * HARD – The + // component restarts if the dependency changes state. + // + // Default: HARD + DependencyType ComponentDependencyType + + // The component version requirement for the component dependency. AWS IoT + // Greengrass V2 uses semantic version constraints. For more information, see + // Semantic Versioning (https://semver.org/). + VersionRequirement *string +} + +// Contains information about a component to deploy. +type ComponentDeploymentSpecification struct { + + // The version of the component. + ComponentVersion *string + + // The configuration updates to deploy for the component. You can define reset + // updates and merge updates. A reset updates the keys that you specify to the + // default configuration for the component. A merge updates the core device's + // component configuration with the keys and values that you specify. The AWS IoT + // Greengrass Core software applies reset updates before it applies merge updates. + // For more information, see Update component configurations + // (https://docs.aws.amazon.com/greengrass/v2/developerguide/update-component-configurations.html) + // in the AWS IoT Greengrass V2 Developer Guide. + ConfigurationUpdate *ComponentConfigurationUpdate + + // The system user and group that the AWS IoT Greengrass Core software uses to run + // component processes on the core device. If you omit this parameter, the AWS IoT + // Greengrass Core software uses the system user and group that you configure for + // the core device. For more information, see Configure the user and group that run + // components + // (https://docs.aws.amazon.com/greengrass/v2/developerguide/configure-greengrass-core-v2.html#configure-component-user) + // in the AWS IoT Greengrass V2 Developer Guide. + RunWith *ComponentRunWith +} + +// Contains information about the latest version of a component. +type ComponentLatestVersion struct { + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the component version. + Arn *string + + // The version of the component. + ComponentVersion *string + + // The time at which the component was created, expressed in ISO 8601 format. + CreationTimestamp *time.Time + + // The description of the component version. + Description *string + + // The platforms that the component version supports. + Platforms []ComponentPlatform + + // The publisher of the component version. + Publisher *string +} + +// Contains information about a platform that a component supports. +type ComponentPlatform struct { + + // A dictionary of attributes for the platform. The AWS IoT Greengrass Core + // software defines the os and platform by default. You can specify additional + // platform attributes for a core device when you deploy the AWS IoT Greengrass + // nucleus component. For more information, see the AWS IoT Greengrass nucleus + // component + // (https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html) + // in the AWS IoT Greengrass V2 Developer Guide. + Attributes map[string]string + + // The friendly name of the platform. This name helps you identify the platform. If + // you omit this parameter, AWS IoT Greengrass creates a friendly name from the os + // and architecture of the platform. + Name *string +} + +// Contains information system user and group that the AWS IoT Greengrass Core +// software uses to run component processes on the core device. For more +// information, see Configure the user and group that run components +// (https://docs.aws.amazon.com/greengrass/v2/developerguide/configure-greengrass-core-v2.html#configure-component-user) +// in the AWS IoT Greengrass V2 Developer Guide. +type ComponentRunWith struct { + + // The POSIX system user and (optional) group to use to run this component. Specify + // the user and group separated by a colon (:) in the following format: user:group. + // The group is optional. If you don't specify a group, the AWS IoT Greengrass Core + // software uses the primary user for the group. + PosixUser *string +} + +// Contains information about a component version in a list. +type ComponentVersionListItem struct { + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the component version. + Arn *string + + // The name of the component. + ComponentName *string + + // The version of the component. + ComponentVersion *string +} + +// Contains information about a AWS IoT Greengrass core device, which is an AWS IoT +// thing that runs the AWS IoT Greengrass Core software. +type CoreDevice struct { + + // The name of the core device. This is also the name of the AWS IoT thing. + CoreDeviceThingName *string + + // The time at which the core device's status last updated, expressed in ISO 8601 + // format. + LastStatusUpdateTimestamp *time.Time + + // The status of the core device. Core devices can have the following statuses: + // + // * + // HEALTHY – The AWS IoT Greengrass Core software and all components run on the + // core device without issue. + // + // * UNHEALTHY – The AWS IoT Greengrass Core software + // or a component is in a failed state on the core device. + Status CoreDeviceStatus +} + +// Contains information about a deployment. +type Deployment struct { + + // The time at which the deployment was created, expressed in ISO 8601 format. + CreationTimestamp *time.Time + + // The ID of the deployment. + DeploymentId *string + + // The name of the deployment. You can create deployments without names. If you + // create a deployment without a name, the AWS IoT Greengrass V2 console shows the + // deployment name as :, where targetType and targetName are the type and name of + // the deployment target. + DeploymentName *string + + // The status of the deployment. + DeploymentStatus DeploymentStatus + + // Whether or not the deployment is the latest revision for its target. + IsLatestForTarget bool + + // The revision number of the deployment. + RevisionId *string + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the target AWS IoT thing or thing group. + TargetArn *string +} + +// Contains information about a deployment's policy that defines when components +// are safe to update. Each component on a device can report whether or not it's +// ready to update. After a component and its dependencies are ready, they can +// apply the update in the deployment. You can configure whether or not the +// deployment notifies components of an update and waits for a response. You +// specify the amount of time each component has to respond to the update +// notification. +type DeploymentComponentUpdatePolicy struct { + + // Whether or not to notify components and wait for components to become safe to + // update. Choose from the following options: + // + // * NOTIFY_COMPONENTS – The deployment + // notifies each component before it stops and updates that component. Components + // can use the SubscribeToComponentUpdates + // (https://docs.aws.amazon.com/greengrass/v2/developerguide/interprocess-communication.html#ipc-operation-subscribetocomponentupdates) + // IPC operation to receive these notifications. Then, components can respond with + // the DeferComponentUpdate + // (https://docs.aws.amazon.com/greengrass/v2/developerguide/interprocess-communication.html#ipc-operation-defercomponentupdate) + // IPC operation. For more information, see the Create deployments + // (https://docs.aws.amazon.com/greengrass/v2/latest/developerguide/create-deployments.html) + // in the AWS IoT Greengrass V2 Developer Guide. + // + // * SKIP_NOTIFY_COMPONENTS – The + // deployment doesn't notify components or wait for them to be safe to + // update. + // + // Default: NOTIFY_COMPONENTS + Action DeploymentComponentUpdatePolicyAction + + // The amount of time in seconds that each component on a device has to report that + // it's safe to update. If the component waits for longer than this timeout, then + // the deployment proceeds on the device. Default: 60 + TimeoutInSeconds int32 +} + +// Contains information about how long a component on a core device can validate +// its configuration updates before it times out. Components can use the +// SubscribeToValidateConfigurationUpdates +// (https://docs.aws.amazon.com/greengrass/v2/developerguide/interprocess-communication.html#ipc-operation-subscribetovalidateconfigurationupdates) +// IPC operation to receive notifications when a deployment specifies a +// configuration update. Then, components can respond with the +// SendConfigurationValidityReport +// (https://docs.aws.amazon.com/greengrass/v2/developerguide/interprocess-communication.html#ipc-operation-sendconfigurationvalidityreport) +// IPC operation. For more information, see the Create deployments +// (https://docs.aws.amazon.com/greengrass/v2/latest/developerguide/create-deployments.html) +// in the AWS IoT Greengrass V2 Developer Guide. +type DeploymentConfigurationValidationPolicy struct { + + // The amount of time in seconds that a component can validate its configuration + // updates. If the validation time exceeds this timeout, then the deployment + // proceeds for the device. Default: 30 + TimeoutInSeconds int32 +} + +// Contains information about an AWS IoT job configuration. +type DeploymentIoTJobConfiguration struct { + + // The stop configuration for the job. This configuration defines when and how to + // stop a job rollout. + AbortConfig *IoTJobAbortConfig + + // The rollout configuration for the job. This configuration defines the rate at + // which the job rolls out to the fleet of target devices. + JobExecutionsRolloutConfig *IoTJobExecutionsRolloutConfig + + // The timeout configuration for the job. This configuration defines the amount of + // time each device has to complete the job. + TimeoutConfig *IoTJobTimeoutConfig +} + +// Contains information about policies that define how a deployment updates +// components and handles failure. +type DeploymentPolicies struct { + + // The component update policy for the configuration deployment. This policy + // defines when it's safe to deploy the configuration to devices. + ComponentUpdatePolicy *DeploymentComponentUpdatePolicy + + // The configuration validation policy for the configuration deployment. This + // policy defines how long each component has to validate its configure updates. + ConfigurationValidationPolicy *DeploymentConfigurationValidationPolicy + + // The failure handling policy for the configuration deployment. This policy + // defines what to do if the deployment fails. Default: ROLLBACK + FailureHandlingPolicy DeploymentFailureHandlingPolicy +} + +// Contains information about a deployment job that AWS IoT Greengrass sends to a +// AWS IoT Greengrass core device. +type EffectiveDeployment struct { + + // The status of the deployment job on the AWS IoT Greengrass core device. + // + // This member is required. + CoreDeviceExecutionStatus EffectiveDeploymentExecutionStatus + + // The time at which the deployment was created, expressed in ISO 8601 format. + // + // This member is required. + CreationTimestamp *time.Time + + // The ID of the deployment. + // + // This member is required. + DeploymentId *string + + // The name of the deployment. You can create deployments without names. If you + // create a deployment without a name, the AWS IoT Greengrass V2 console shows the + // deployment name as :, where targetType and targetName are the type and name of + // the deployment target. + // + // This member is required. + DeploymentName *string + + // The time at which the deployment job was last modified, expressed in ISO 8601 + // format. + // + // This member is required. + ModifiedTimestamp *time.Time + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the target AWS IoT thing or thing group. + // + // This member is required. + TargetArn *string + + // The description of the deployment job. + Description *string + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the AWS IoT job that applies the deployment to target devices. + IotJobArn *string + + // The ID of the AWS IoT job that applies the deployment to target devices. + IotJobId *string + + // The reason code for the update, if the job was updated. + Reason *string +} + +// Contains information about a component on a AWS IoT Greengrass core device. +type InstalledComponent struct { + + // The name of the component. + ComponentName *string + + // The version of the component. + ComponentVersion *string + + // Whether or not the component is a root component. + IsRoot bool + + // The lifecycle state of the component. + LifecycleState InstalledComponentLifecycleState + + // The details about the lifecycle state of the component. + LifecycleStateDetails *string +} + +// Contains a list of criteria that define when and how to cancel a configuration +// deployment. +type IoTJobAbortConfig struct { + + // The list of criteria that define when and how to cancel the configuration + // deployment. + // + // This member is required. + CriteriaList []IoTJobAbortCriteria +} + +// Contains criteria that define when and how to cancel a job. The deployment stops +// if the following conditions are true: +// +// * The number of things that receive the +// deployment exceeds the minNumberOfExecutedThings. +// +// * The percentage of failures +// with type failureType exceeds the thresholdPercentage. +type IoTJobAbortCriteria struct { + + // The action to perform when the criteria are met. + // + // This member is required. + Action IoTJobAbortAction + + // The type of job deployment failure that can cancel a job. + // + // This member is required. + FailureType IoTJobExecutionFailureType + + // The minimum number of things that receive the configuration before the job can + // cancel. + // + // This member is required. + MinNumberOfExecutedThings int32 + + // The minimum percentage of failureType failures that occur before the job can + // cancel. This parameter supports up to two digits after the decimal (for example, + // you can specify 10.9 or 10.99, but not 10.999). + // + // This member is required. + ThresholdPercentage float64 +} + +// Contains information about the rollout configuration for a job. This +// configuration defines the rate at which the job deploys a configuration to a +// fleet of target devices. +type IoTJobExecutionsRolloutConfig struct { + + // The exponential rate to increase the job rollout rate. + ExponentialRate *IoTJobExponentialRolloutRate + + // The maximum number of devices that receive a pending job notification, per + // minute. + MaximumPerMinute int32 +} + +// Contains information about an exponential rollout rate for a configuration +// deployment job. +type IoTJobExponentialRolloutRate struct { + + // The minimum number of devices that receive a pending job notification, per + // minute, when the job starts. This parameter defines the initial rollout rate of + // the job. + // + // This member is required. + BaseRatePerMinute int32 + + // The exponential factor to increase the rollout rate for the job. This parameter + // supports up to one digit after the decimal (for example, you can specify 1.5, + // but not 1.55). + // + // This member is required. + IncrementFactor float64 + + // The criteria to increase the rollout rate for the job. + // + // This member is required. + RateIncreaseCriteria *IoTJobRateIncreaseCriteria +} + +// Contains information about criteria to meet before a job increases its rollout +// rate. Specify either numberOfNotifiedThings or numberOfSucceededThings. +type IoTJobRateIncreaseCriteria struct { + + // The number of devices to receive the job notification before the rollout rate + // increases. + NumberOfNotifiedThings int32 + + // The number of devices to successfully run the configuration job before the + // rollout rate increases. + NumberOfSucceededThings int32 +} + +// Contains information about the timeout configuration for a job. +type IoTJobTimeoutConfig struct { + + // The amount of time, in minutes, that devices have to complete the job. The timer + // starts when the job status is set to IN_PROGRESS. If the job status doesn't + // change to a terminal state before the time expires, then the job status is set + // to TIMED_OUT. The timeout interval must be between 1 minute and 7 days (10080 + // minutes). + InProgressTimeoutInMinutes int64 +} + +// Contains information about a container in which AWS Lambda functions run on AWS +// IoT Greengrass core devices. +type LambdaContainerParams struct { + + // The list of system devices that the container can access. + Devices []LambdaDeviceMount + + // The memory size of the container, expressed in kilobytes. Default: 16384 (16 MB) + MemorySizeInKB int32 + + // Whether or not the container can read information from the device's /sys folder. + // Default: false + MountROSysfs bool + + // The list of volumes that the container can access. + Volumes []LambdaVolumeMount +} + +// Contains information about a device that Linux processes in a container can +// access. +type LambdaDeviceMount struct { + + // The mount path for the device in the file system. + // + // This member is required. + Path *string + + // Whether or not to add the component's system user as an owner of the device. + // Default: false + AddGroupOwner bool + + // The permission to access the device: read/only (ro) or read/write (rw). Default: + // ro + Permission LambdaFilesystemPermission +} + +// Contains information about an event source for an AWS Lambda function. The event +// source defines the topics on which this Lambda function subscribes to receive +// messages that run the function. +type LambdaEventSource struct { + + // The topic to which to subscribe to receive event messages. + // + // This member is required. + Topic *string + + // The type of event source. Choose from the following options: + // + // * PUB_SUB – + // Subscribe to local publish/subscribe messages. This event source type doesn't + // support MQTT wildcards (+ and #) in the event source topic. + // + // * IOT_CORE – + // Subscribe to AWS IoT Core MQTT messages. This event source type supports MQTT + // wildcards (+ and #) in the event source topic. + // + // This member is required. + Type LambdaEventSourceType +} + +// Contains parameters for a Lambda function that runs on AWS IoT Greengrass. +type LambdaExecutionParameters struct { + + // The map of environment variables that are available to the Lambda function when + // it runs. + EnvironmentVariables map[string]string + + // The list of event sources to which to subscribe to receive work messages. The + // Lambda function runs when it receives a message from an event source. You can + // subscribe this function to local publish/subscribe messages and AWS IoT Core + // MQTT messages. + EventSources []LambdaEventSource + + // The list of arguments to pass to the Lambda function when it runs. + ExecArgs []string + + // The encoding type that the Lambda function supports. Default: json + InputPayloadEncodingType LambdaInputPayloadEncodingType + + // The parameters for the Linux process that contains the Lambda function. + LinuxProcessParams *LambdaLinuxProcessParams + + // The maximum amount of time in seconds that a non-pinned Lambda function can idle + // before the AWS IoT Greengrass Core software stops its process. + MaxIdleTimeInSeconds int32 + + // The maximum number of instances that a non-pinned Lambda function can run at the + // same time. + MaxInstancesCount int32 + + // The maximum size of the message queue for the Lambda function component. The AWS + // IoT Greengrass core stores messages in a FIFO (first-in-first-out) queue until + // it can run the Lambda function to consume each message. + MaxQueueSize int32 + + // Whether or not the Lambda function is pinned, or long-lived. + // + // * A pinned Lambda + // function starts when AWS IoT Greengrass starts and keeps running in its own + // container. + // + // * A non-pinned Lambda function starts only when it receives a work + // item and exists after it idles for maxIdleTimeInSeconds. If the function has + // multiple work items, the AWS IoT Greengrass Core software creates multiple + // instances of the function. + // + // Default: true + Pinned bool + + // The interval in seconds at which a pinned (also known as long-lived) Lambda + // function component sends status updates to the Lambda manager component. + StatusTimeoutInSeconds int32 + + // The maximum amount of time in seconds that the Lambda function can process a + // work item. + TimeoutInSeconds int32 +} + +// Contains information about an AWS Lambda function to import to create a +// component. +type LambdaFunctionRecipeSource struct { + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the Lambda function. The ARN must include the version of the function to import. + // You can't use version aliases like $LATEST. + // + // This member is required. + LambdaArn *string + + // The component versions on which this Lambda function component depends. + ComponentDependencies map[string]ComponentDependencyRequirement + + // The system and runtime parameters for the Lambda function as it runs on the AWS + // IoT Greengrass core device. + ComponentLambdaParameters *LambdaExecutionParameters + + // The name of the component. Defaults to the name of the Lambda function. + ComponentName *string + + // The platforms that the component version supports. + ComponentPlatforms []ComponentPlatform + + // The version of the component. Defaults to the version of the Lambda function as + // a semantic version. For example, if your function version is 3, the component + // version becomes 3.0.0. + ComponentVersion *string +} + +// Contains parameters for a Linux process that contains an AWS Lambda function. +type LambdaLinuxProcessParams struct { + + // The parameters for the container in which the Lambda function runs. + ContainerParams *LambdaContainerParams + + // The isolation mode for the process that contains the Lambda function. The + // process can run in an isolated runtime environment inside the AWS IoT Greengrass + // container, or as a regular process outside any container. Default: + // GreengrassContainer + IsolationMode LambdaIsolationMode +} + +// Contains information about a volume that Linux processes in a container can +// access. When you define a volume, the AWS IoT Greengrass Core software mounts +// the source files to the destination inside the container. +type LambdaVolumeMount struct { + + // The path to the logical volume in the file system. + // + // This member is required. + DestinationPath *string + + // The path to the physical volume in the file system. + // + // This member is required. + SourcePath *string + + // Whether or not to add the AWS IoT Greengrass user group as an owner of the + // volume. Default: false + AddGroupOwner bool + + // The permission to access the volume: read/only (ro) or read/write (rw). Default: + // ro + Permission LambdaFilesystemPermission +} + +// Contains information about a component version that is compatible to run on a +// AWS IoT Greengrass core device. +type ResolvedComponentVersion struct { + + // The ARN + // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of + // the component version. + Arn *string + + // The name of the component. + ComponentName *string + + // The version of the component. + ComponentVersion *string + + // The recipe of the component version. + Recipe []byte +} + +// Contains information about a validation exception field. +type ValidationExceptionField struct { + + // The message of the exception field. + // + // This member is required. + Message *string + + // The name of the exception field. + // + // This member is required. + Name *string +} diff --git a/service/greengrassv2/validators.go b/service/greengrassv2/validators.go new file mode 100644 index 00000000000..973fa1ab1f9 --- /dev/null +++ b/service/greengrassv2/validators.go @@ -0,0 +1,984 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package greengrassv2 + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/greengrassv2/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCancelDeployment struct { +} + +func (*validateOpCancelDeployment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCancelDeployment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CancelDeploymentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCancelDeploymentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateComponentVersion struct { +} + +func (*validateOpCreateComponentVersion) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateComponentVersion) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateComponentVersionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateComponentVersionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateDeployment struct { +} + +func (*validateOpCreateDeployment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDeployment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDeploymentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDeploymentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteComponent struct { +} + +func (*validateOpDeleteComponent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteComponent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteComponentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteComponentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteCoreDevice struct { +} + +func (*validateOpDeleteCoreDevice) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteCoreDevice) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteCoreDeviceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteCoreDeviceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeComponent struct { +} + +func (*validateOpDescribeComponent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeComponent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeComponentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeComponentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetComponent struct { +} + +func (*validateOpGetComponent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetComponent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetComponentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetComponentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetComponentVersionArtifact struct { +} + +func (*validateOpGetComponentVersionArtifact) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetComponentVersionArtifact) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetComponentVersionArtifactInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetComponentVersionArtifactInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetCoreDevice struct { +} + +func (*validateOpGetCoreDevice) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetCoreDevice) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetCoreDeviceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetCoreDeviceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetDeployment struct { +} + +func (*validateOpGetDeployment) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetDeployment) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetDeploymentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetDeploymentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListComponentVersions struct { +} + +func (*validateOpListComponentVersions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListComponentVersions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListComponentVersionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListComponentVersionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListEffectiveDeployments struct { +} + +func (*validateOpListEffectiveDeployments) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListEffectiveDeployments) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListEffectiveDeploymentsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListEffectiveDeploymentsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListInstalledComponents struct { +} + +func (*validateOpListInstalledComponents) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListInstalledComponents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListInstalledComponentsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListInstalledComponentsInput(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 validateOpResolveComponentCandidates struct { +} + +func (*validateOpResolveComponentCandidates) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpResolveComponentCandidates) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ResolveComponentCandidatesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpResolveComponentCandidatesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpTagResource struct { +} + +func (*validateOpTagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUntagResource struct { +} + +func (*validateOpUntagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUntagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCancelDeploymentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCancelDeployment{}, middleware.After) +} + +func addOpCreateComponentVersionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateComponentVersion{}, middleware.After) +} + +func addOpCreateDeploymentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDeployment{}, middleware.After) +} + +func addOpDeleteComponentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteComponent{}, middleware.After) +} + +func addOpDeleteCoreDeviceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteCoreDevice{}, middleware.After) +} + +func addOpDescribeComponentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeComponent{}, middleware.After) +} + +func addOpGetComponentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetComponent{}, middleware.After) +} + +func addOpGetComponentVersionArtifactValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetComponentVersionArtifact{}, middleware.After) +} + +func addOpGetCoreDeviceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetCoreDevice{}, middleware.After) +} + +func addOpGetDeploymentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetDeployment{}, middleware.After) +} + +func addOpListComponentVersionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListComponentVersions{}, middleware.After) +} + +func addOpListEffectiveDeploymentsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListEffectiveDeployments{}, middleware.After) +} + +func addOpListInstalledComponentsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListInstalledComponents{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpResolveComponentCandidatesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpResolveComponentCandidates{}, 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 validateDeploymentIoTJobConfiguration(v *types.DeploymentIoTJobConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeploymentIoTJobConfiguration"} + if v.JobExecutionsRolloutConfig != nil { + if err := validateIoTJobExecutionsRolloutConfig(v.JobExecutionsRolloutConfig); err != nil { + invalidParams.AddNested("JobExecutionsRolloutConfig", err.(smithy.InvalidParamsError)) + } + } + if v.AbortConfig != nil { + if err := validateIoTJobAbortConfig(v.AbortConfig); err != nil { + invalidParams.AddNested("AbortConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIoTJobAbortConfig(v *types.IoTJobAbortConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IoTJobAbortConfig"} + if v.CriteriaList == nil { + invalidParams.Add(smithy.NewErrParamRequired("CriteriaList")) + } else if v.CriteriaList != nil { + if err := validateIoTJobAbortCriteriaList(v.CriteriaList); err != nil { + invalidParams.AddNested("CriteriaList", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIoTJobAbortCriteria(v *types.IoTJobAbortCriteria) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IoTJobAbortCriteria"} + if len(v.FailureType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("FailureType")) + } + if len(v.Action) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Action")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIoTJobAbortCriteriaList(v []types.IoTJobAbortCriteria) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IoTJobAbortCriteriaList"} + for i := range v { + if err := validateIoTJobAbortCriteria(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIoTJobExecutionsRolloutConfig(v *types.IoTJobExecutionsRolloutConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IoTJobExecutionsRolloutConfig"} + if v.ExponentialRate != nil { + if err := validateIoTJobExponentialRolloutRate(v.ExponentialRate); err != nil { + invalidParams.AddNested("ExponentialRate", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateIoTJobExponentialRolloutRate(v *types.IoTJobExponentialRolloutRate) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IoTJobExponentialRolloutRate"} + if v.RateIncreaseCriteria == nil { + invalidParams.Add(smithy.NewErrParamRequired("RateIncreaseCriteria")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLambdaContainerParams(v *types.LambdaContainerParams) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LambdaContainerParams"} + if v.Volumes != nil { + if err := validateLambdaVolumeList(v.Volumes); err != nil { + invalidParams.AddNested("Volumes", err.(smithy.InvalidParamsError)) + } + } + if v.Devices != nil { + if err := validateLambdaDeviceList(v.Devices); err != nil { + invalidParams.AddNested("Devices", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLambdaDeviceList(v []types.LambdaDeviceMount) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LambdaDeviceList"} + for i := range v { + if err := validateLambdaDeviceMount(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLambdaDeviceMount(v *types.LambdaDeviceMount) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LambdaDeviceMount"} + if v.Path == nil { + invalidParams.Add(smithy.NewErrParamRequired("Path")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLambdaEventSource(v *types.LambdaEventSource) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LambdaEventSource"} + if v.Topic == nil { + invalidParams.Add(smithy.NewErrParamRequired("Topic")) + } + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLambdaEventSourceList(v []types.LambdaEventSource) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LambdaEventSourceList"} + for i := range v { + if err := validateLambdaEventSource(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLambdaExecutionParameters(v *types.LambdaExecutionParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LambdaExecutionParameters"} + if v.EventSources != nil { + if err := validateLambdaEventSourceList(v.EventSources); err != nil { + invalidParams.AddNested("EventSources", err.(smithy.InvalidParamsError)) + } + } + if v.LinuxProcessParams != nil { + if err := validateLambdaLinuxProcessParams(v.LinuxProcessParams); err != nil { + invalidParams.AddNested("LinuxProcessParams", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLambdaFunctionRecipeSource(v *types.LambdaFunctionRecipeSource) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LambdaFunctionRecipeSource"} + if v.LambdaArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("LambdaArn")) + } + if v.ComponentLambdaParameters != nil { + if err := validateLambdaExecutionParameters(v.ComponentLambdaParameters); err != nil { + invalidParams.AddNested("ComponentLambdaParameters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLambdaLinuxProcessParams(v *types.LambdaLinuxProcessParams) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LambdaLinuxProcessParams"} + if v.ContainerParams != nil { + if err := validateLambdaContainerParams(v.ContainerParams); err != nil { + invalidParams.AddNested("ContainerParams", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLambdaVolumeList(v []types.LambdaVolumeMount) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LambdaVolumeList"} + for i := range v { + if err := validateLambdaVolumeMount(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateLambdaVolumeMount(v *types.LambdaVolumeMount) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "LambdaVolumeMount"} + if v.SourcePath == nil { + invalidParams.Add(smithy.NewErrParamRequired("SourcePath")) + } + if v.DestinationPath == nil { + invalidParams.Add(smithy.NewErrParamRequired("DestinationPath")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCancelDeploymentInput(v *CancelDeploymentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CancelDeploymentInput"} + if v.DeploymentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DeploymentId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateComponentVersionInput(v *CreateComponentVersionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateComponentVersionInput"} + if v.LambdaFunction != nil { + if err := validateLambdaFunctionRecipeSource(v.LambdaFunction); err != nil { + invalidParams.AddNested("LambdaFunction", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDeploymentInput(v *CreateDeploymentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDeploymentInput"} + if v.TargetArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetArn")) + } + if v.IotJobConfiguration != nil { + if err := validateDeploymentIoTJobConfiguration(v.IotJobConfiguration); err != nil { + invalidParams.AddNested("IotJobConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteComponentInput(v *DeleteComponentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteComponentInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteCoreDeviceInput(v *DeleteCoreDeviceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteCoreDeviceInput"} + if v.CoreDeviceThingName == nil { + invalidParams.Add(smithy.NewErrParamRequired("CoreDeviceThingName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeComponentInput(v *DescribeComponentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeComponentInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetComponentInput(v *GetComponentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetComponentInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetComponentVersionArtifactInput(v *GetComponentVersionArtifactInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetComponentVersionArtifactInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if v.ArtifactName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ArtifactName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetCoreDeviceInput(v *GetCoreDeviceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetCoreDeviceInput"} + if v.CoreDeviceThingName == nil { + invalidParams.Add(smithy.NewErrParamRequired("CoreDeviceThingName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetDeploymentInput(v *GetDeploymentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetDeploymentInput"} + if v.DeploymentId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DeploymentId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListComponentVersionsInput(v *ListComponentVersionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListComponentVersionsInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListEffectiveDeploymentsInput(v *ListEffectiveDeploymentsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListEffectiveDeploymentsInput"} + if v.CoreDeviceThingName == nil { + invalidParams.Add(smithy.NewErrParamRequired("CoreDeviceThingName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListInstalledComponentsInput(v *ListInstalledComponentsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListInstalledComponentsInput"} + if v.CoreDeviceThingName == nil { + invalidParams.Add(smithy.NewErrParamRequired("CoreDeviceThingName")) + } + 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 validateOpResolveComponentCandidatesInput(v *ResolveComponentCandidatesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResolveComponentCandidatesInput"} + if v.Platform == nil { + invalidParams.Add(smithy.NewErrParamRequired("Platform")) + } + if v.ComponentCandidates == nil { + invalidParams.Add(smithy.NewErrParamRequired("ComponentCandidates")) + } + 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 + } +} diff --git a/service/iam/types/enums.go b/service/iam/types/enums.go index 205b024a49d..e7cb1c47b35 100644 --- a/service/iam/types/enums.go +++ b/service/iam/types/enums.go @@ -23,6 +23,13 @@ func (AccessAdvisorUsageGranularityType) Values() []AccessAdvisorUsageGranularit type AssignmentStatusType string +// Enum values for AssignmentStatusType +const ( + AssignmentStatusTypeAssigned AssignmentStatusType = "Assigned" + AssignmentStatusTypeUnassigned AssignmentStatusType = "Unassigned" + AssignmentStatusTypeAny AssignmentStatusType = "Any" +) + // Values returns all known values for AssignmentStatusType. 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. @@ -96,6 +103,12 @@ func (DeletionTaskStatusType) Values() []DeletionTaskStatusType { type EncodingType string +// Enum values for EncodingType +const ( + EncodingTypeSsh EncodingType = "SSH" + EncodingTypePem EncodingType = "PEM" +) + // Values returns all known values for EncodingType. 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. @@ -150,6 +163,13 @@ func (GlobalEndpointTokenVersion) Values() []GlobalEndpointTokenVersion { type JobStatusType string +// Enum values for JobStatusType +const ( + JobStatusTypeInProgress JobStatusType = "IN_PROGRESS" + JobStatusTypeCompleted JobStatusType = "COMPLETED" + JobStatusTypeFailed JobStatusType = "FAILED" +) + // Values returns all known values for JobStatusType. 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. @@ -286,6 +306,12 @@ func (PolicyType) Values() []PolicyType { type PolicyUsageType string +// Enum values for PolicyUsageType +const ( + PolicyUsageTypePermissionspolicy PolicyUsageType = "PermissionsPolicy" + PolicyUsageTypePermissionsboundary PolicyUsageType = "PermissionsBoundary" +) + // Values returns all known values for PolicyUsageType. 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. @@ -298,6 +324,11 @@ func (PolicyUsageType) Values() []PolicyUsageType { type ReportFormatType string +// Enum values for ReportFormatType +const ( + ReportFormatTypeTextCsv ReportFormatType = "text/csv" +) + // Values returns all known values for ReportFormatType. 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. @@ -351,6 +382,12 @@ func (SortKeyType) Values() []SortKeyType { type StatusType string +// Enum values for StatusType +const ( + StatusTypeActive StatusType = "Active" + StatusTypeInactive StatusType = "Inactive" +) + // Values returns all known values for StatusType. 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. @@ -363,6 +400,36 @@ func (StatusType) Values() []StatusType { type SummaryKeyType string +// Enum values for SummaryKeyType +const ( + SummaryKeyTypeUsers SummaryKeyType = "Users" + SummaryKeyTypeUsersquota SummaryKeyType = "UsersQuota" + SummaryKeyTypeGroups SummaryKeyType = "Groups" + SummaryKeyTypeGroupsquota SummaryKeyType = "GroupsQuota" + SummaryKeyTypeServercertificates SummaryKeyType = "ServerCertificates" + SummaryKeyTypeServercertificatesquota SummaryKeyType = "ServerCertificatesQuota" + SummaryKeyTypeUserpolicysizequota SummaryKeyType = "UserPolicySizeQuota" + SummaryKeyTypeGrouppolicysizequota SummaryKeyType = "GroupPolicySizeQuota" + SummaryKeyTypeGroupsperuserquota SummaryKeyType = "GroupsPerUserQuota" + SummaryKeyTypeSigningcertificatesperuserquota SummaryKeyType = "SigningCertificatesPerUserQuota" + SummaryKeyTypeAccesskeysperuserquota SummaryKeyType = "AccessKeysPerUserQuota" + SummaryKeyTypeMfadevices SummaryKeyType = "MFADevices" + SummaryKeyTypeMfadevicesinuse SummaryKeyType = "MFADevicesInUse" + SummaryKeyTypeAccountmfaenabled SummaryKeyType = "AccountMFAEnabled" + SummaryKeyTypeAccountaccesskeyspresent SummaryKeyType = "AccountAccessKeysPresent" + SummaryKeyTypeAccountsigningcertificatespresent SummaryKeyType = "AccountSigningCertificatesPresent" + SummaryKeyTypeAttachedpoliciespergroupquota SummaryKeyType = "AttachedPoliciesPerGroupQuota" + SummaryKeyTypeAttachedpoliciesperrolequota SummaryKeyType = "AttachedPoliciesPerRoleQuota" + SummaryKeyTypeAttachedpoliciesperuserquota SummaryKeyType = "AttachedPoliciesPerUserQuota" + SummaryKeyTypePolicies SummaryKeyType = "Policies" + SummaryKeyTypePoliciesquota SummaryKeyType = "PoliciesQuota" + SummaryKeyTypePolicysizequota SummaryKeyType = "PolicySizeQuota" + SummaryKeyTypePolicyversionsinuse SummaryKeyType = "PolicyVersionsInUse" + SummaryKeyTypePolicyversionsinusequota SummaryKeyType = "PolicyVersionsInUseQuota" + SummaryKeyTypeVersionsperpolicyquota SummaryKeyType = "VersionsPerPolicyQuota" + SummaryKeyTypeGlobalendpointtokenversion SummaryKeyType = "GlobalEndpointTokenVersion" +) + // Values returns all known values for SummaryKeyType. 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. diff --git a/service/imagebuilder/api_op_CreateContainerRecipe.go b/service/imagebuilder/api_op_CreateContainerRecipe.go new file mode 100644 index 00000000000..2e22c08ea3b --- /dev/null +++ b/service/imagebuilder/api_op_CreateContainerRecipe.go @@ -0,0 +1,215 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package imagebuilder + +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/imagebuilder/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new container recipe. Container recipes define how images are +// configured, tested, and assessed. +func (c *Client) CreateContainerRecipe(ctx context.Context, params *CreateContainerRecipeInput, optFns ...func(*Options)) (*CreateContainerRecipeOutput, error) { + if params == nil { + params = &CreateContainerRecipeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateContainerRecipe", params, optFns, addOperationCreateContainerRecipeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateContainerRecipeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateContainerRecipeInput struct { + + // The client token used to make this request idempotent. + // + // This member is required. + ClientToken *string + + // Components for build and test that are included in the container recipe. + // + // This member is required. + Components []types.ComponentConfiguration + + // The type of container to create. + // + // This member is required. + ContainerType types.ContainerType + + // The Dockerfile template used to build your image as an inline data blob. + // + // This member is required. + DockerfileTemplateData *string + + // The name of the container recipe. + // + // This member is required. + Name *string + + // The source image for the container recipe. + // + // This member is required. + ParentImage *string + + // The semantic version of the container recipe (..). + // + // This member is required. + SemanticVersion *string + + // The destination repository for the container image. + // + // This member is required. + TargetRepository *types.TargetContainerRepository + + // The description of the container recipe. + Description *string + + // The S3 URI for the Dockerfile that will be used to build your container image. + DockerfileTemplateUri *string + + // Specifies the operating system version for the source image. + ImageOsVersionOverride *string + + // Identifies which KMS key is used to encrypt the container image. + KmsKeyId *string + + // Specifies the operating system platform when you use a custom source image. + PlatformOverride types.Platform + + // Tags that are attached to the container recipe. + Tags map[string]string + + // The working directory for use during build and test workflows. + WorkingDirectory *string +} + +type CreateContainerRecipeOutput struct { + + // The client token used to make this request idempotent. + ClientToken *string + + // Returns the Amazon Resource Name (ARN) of the container recipe that the request + // created. + ContainerRecipeArn *string + + // The request ID that uniquely identifies this request. + RequestId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCreateContainerRecipeMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateContainerRecipe{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateContainerRecipe{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opCreateContainerRecipeMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateContainerRecipeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateContainerRecipe(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateContainerRecipe struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateContainerRecipe) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateContainerRecipe) 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.(*CreateContainerRecipeInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateContainerRecipeInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateContainerRecipeMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateContainerRecipe{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateContainerRecipe(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "imagebuilder", + OperationName: "CreateContainerRecipe", + } +} diff --git a/service/imagebuilder/api_op_CreateImage.go b/service/imagebuilder/api_op_CreateImage.go index 888e4d917cd..261a5860c98 100644 --- a/service/imagebuilder/api_op_CreateImage.go +++ b/service/imagebuilder/api_op_CreateImage.go @@ -36,18 +36,16 @@ type CreateImageInput struct { // This member is required. ClientToken *string - // The Amazon Resource Name (ARN) of the image recipe that defines how images are - // configured, tested, and assessed. - // - // This member is required. - ImageRecipeArn *string - // The Amazon Resource Name (ARN) of the infrastructure configuration that defines // the environment in which your image will be built and tested. // // This member is required. InfrastructureConfigurationArn *string + // The Amazon Resource Name (ARN) of the container recipe that defines how images + // are configured and tested. + ContainerRecipeArn *string + // The Amazon Resource Name (ARN) of the distribution configuration that defines // and configures the outputs of your pipeline. DistributionConfigurationArn *string @@ -57,6 +55,10 @@ type CreateImageInput struct { // enhance the overall experience of using EC2 Image Builder. Enabled by default. EnhancedImageMetadataEnabled bool + // The Amazon Resource Name (ARN) of the image recipe that defines how images are + // configured, tested, and assessed. + ImageRecipeArn *string + // The image tests configuration of the image. ImageTestsConfiguration *types.ImageTestsConfiguration diff --git a/service/imagebuilder/api_op_CreateImagePipeline.go b/service/imagebuilder/api_op_CreateImagePipeline.go index 7d242c34a1c..c982edb2906 100644 --- a/service/imagebuilder/api_op_CreateImagePipeline.go +++ b/service/imagebuilder/api_op_CreateImagePipeline.go @@ -36,12 +36,6 @@ type CreateImagePipelineInput struct { // This member is required. ClientToken *string - // The Amazon Resource Name (ARN) of the image recipe that will be used to - // configure images created by this image pipeline. - // - // This member is required. - ImageRecipeArn *string - // The Amazon Resource Name (ARN) of the infrastructure configuration that will be // used to build images created by this image pipeline. // @@ -53,6 +47,10 @@ type CreateImagePipelineInput struct { // This member is required. Name *string + // The Amazon Resource Name (ARN) of the container recipe that is used to configure + // images created by this container pipeline. + ContainerRecipeArn *string + // The description of the image pipeline. Description *string @@ -65,6 +63,10 @@ type CreateImagePipelineInput struct { // enhance the overall experience of using EC2 Image Builder. Enabled by default. EnhancedImageMetadataEnabled bool + // The Amazon Resource Name (ARN) of the image recipe that will be used to + // configure images created by this image pipeline. + ImageRecipeArn *string + // The image test configuration of the image pipeline. ImageTestsConfiguration *types.ImageTestsConfiguration diff --git a/service/imagebuilder/api_op_DeleteContainerRecipe.go b/service/imagebuilder/api_op_DeleteContainerRecipe.go new file mode 100644 index 00000000000..27246c8fdc5 --- /dev/null +++ b/service/imagebuilder/api_op_DeleteContainerRecipe.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package imagebuilder + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a container recipe. +func (c *Client) DeleteContainerRecipe(ctx context.Context, params *DeleteContainerRecipeInput, optFns ...func(*Options)) (*DeleteContainerRecipeOutput, error) { + if params == nil { + params = &DeleteContainerRecipeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteContainerRecipe", params, optFns, addOperationDeleteContainerRecipeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteContainerRecipeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteContainerRecipeInput struct { + + // The Amazon Resource Name (ARN) of the container recipe to delete. + // + // This member is required. + ContainerRecipeArn *string +} + +type DeleteContainerRecipeOutput struct { + + // The Amazon Resource Name (ARN) of the container recipe that was deleted. + ContainerRecipeArn *string + + // The request ID that uniquely identifies this request. + RequestId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteContainerRecipeMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteContainerRecipe{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteContainerRecipe{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteContainerRecipeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteContainerRecipe(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDeleteContainerRecipe(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "imagebuilder", + OperationName: "DeleteContainerRecipe", + } +} diff --git a/service/imagebuilder/api_op_GetContainerRecipe.go b/service/imagebuilder/api_op_GetContainerRecipe.go new file mode 100644 index 00000000000..ba296b6760e --- /dev/null +++ b/service/imagebuilder/api_op_GetContainerRecipe.go @@ -0,0 +1,117 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package imagebuilder + +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/imagebuilder/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a container recipe. +func (c *Client) GetContainerRecipe(ctx context.Context, params *GetContainerRecipeInput, optFns ...func(*Options)) (*GetContainerRecipeOutput, error) { + if params == nil { + params = &GetContainerRecipeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetContainerRecipe", params, optFns, addOperationGetContainerRecipeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetContainerRecipeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetContainerRecipeInput struct { + + // The Amazon Resource Name (ARN) of the container recipe to retrieve. + // + // This member is required. + ContainerRecipeArn *string +} + +type GetContainerRecipeOutput struct { + + // The container recipe object that is returned. + ContainerRecipe *types.ContainerRecipe + + // The request ID that uniquely identifies this request. + RequestId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetContainerRecipeMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetContainerRecipe{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetContainerRecipe{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetContainerRecipeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetContainerRecipe(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetContainerRecipe(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "imagebuilder", + OperationName: "GetContainerRecipe", + } +} diff --git a/service/imagebuilder/api_op_GetContainerRecipePolicy.go b/service/imagebuilder/api_op_GetContainerRecipePolicy.go new file mode 100644 index 00000000000..b26391fe977 --- /dev/null +++ b/service/imagebuilder/api_op_GetContainerRecipePolicy.go @@ -0,0 +1,117 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package imagebuilder + +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" +) + +// Retrieves the policy for a container recipe. +func (c *Client) GetContainerRecipePolicy(ctx context.Context, params *GetContainerRecipePolicyInput, optFns ...func(*Options)) (*GetContainerRecipePolicyOutput, error) { + if params == nil { + params = &GetContainerRecipePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetContainerRecipePolicy", params, optFns, addOperationGetContainerRecipePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetContainerRecipePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetContainerRecipePolicyInput struct { + + // The Amazon Resource Name (ARN) of the container recipe for the policy being + // requested. + // + // This member is required. + ContainerRecipeArn *string +} + +type GetContainerRecipePolicyOutput struct { + + // The container recipe policy object that is returned. + Policy *string + + // The request ID that uniquely identifies this request. + RequestId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetContainerRecipePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetContainerRecipePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetContainerRecipePolicy{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetContainerRecipePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetContainerRecipePolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetContainerRecipePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "imagebuilder", + OperationName: "GetContainerRecipePolicy", + } +} diff --git a/service/imagebuilder/api_op_ListComponents.go b/service/imagebuilder/api_op_ListComponents.go index cb8d48a5c72..a6828e3ebdd 100644 --- a/service/imagebuilder/api_op_ListComponents.go +++ b/service/imagebuilder/api_op_ListComponents.go @@ -29,6 +29,9 @@ func (c *Client) ListComponents(ctx context.Context, params *ListComponentsInput type ListComponentsInput struct { + // Returns the list of component build versions for the specified semantic version. + ByName bool + // The filters. Filters []types.Filter diff --git a/service/imagebuilder/api_op_ListContainerRecipes.go b/service/imagebuilder/api_op_ListContainerRecipes.go new file mode 100644 index 00000000000..dffe08528c6 --- /dev/null +++ b/service/imagebuilder/api_op_ListContainerRecipes.go @@ -0,0 +1,131 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package imagebuilder + +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/imagebuilder/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of container recipes. +func (c *Client) ListContainerRecipes(ctx context.Context, params *ListContainerRecipesInput, optFns ...func(*Options)) (*ListContainerRecipesOutput, error) { + if params == nil { + params = &ListContainerRecipesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListContainerRecipes", params, optFns, addOperationListContainerRecipesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListContainerRecipesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListContainerRecipesInput struct { + + // Request filters that are used to narrow the list of container images that are + // returned. + Filters []types.Filter + + // The maximum number of results to return in the list. + MaxResults int32 + + // Provides a token for pagination, which determines where to begin the next set of + // results when the current set reaches the maximum for one request. + NextToken *string + + // Returns container recipes belonging to the specified owner, that have been + // shared with you. You can omit this field to return container recipes belonging + // to your account. + Owner types.Ownership +} + +type ListContainerRecipesOutput struct { + + // The list of container recipes returned for the request. + ContainerRecipeSummaryList []types.ContainerRecipeSummary + + // The next token field is used for paginated responses. When this is not empty, + // there are additional container recipes that the service has not included in this + // response. Use this token with the next request to retrieve additional list + // items. + NextToken *string + + // The request ID that uniquely identifies this request. + RequestId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListContainerRecipesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListContainerRecipes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListContainerRecipes{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListContainerRecipes(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opListContainerRecipes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "imagebuilder", + OperationName: "ListContainerRecipes", + } +} diff --git a/service/imagebuilder/api_op_ListImages.go b/service/imagebuilder/api_op_ListImages.go index 9c4927f8346..5a23dd419ee 100644 --- a/service/imagebuilder/api_op_ListImages.go +++ b/service/imagebuilder/api_op_ListImages.go @@ -29,9 +29,15 @@ func (c *Client) ListImages(ctx context.Context, params *ListImagesInput, optFns type ListImagesInput struct { + // Requests a list of images with a specific recipe name. + ByName bool + // The filters. Filters []types.Filter + // Includes deprecated images in the response list. + IncludeDeprecated bool + // The maximum items to return in a request. MaxResults int32 diff --git a/service/imagebuilder/api_op_PutContainerRecipePolicy.go b/service/imagebuilder/api_op_PutContainerRecipePolicy.go new file mode 100644 index 00000000000..758221b0711 --- /dev/null +++ b/service/imagebuilder/api_op_PutContainerRecipePolicy.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package imagebuilder + +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" +) + +// Applies a policy to a container image. We recommend that you call the RAM API +// CreateResourceShare +// (https://docs.aws.amazon.com/ram/latest/APIReference/API_CreateResourceShare.html) +// to share resources. If you call the Image Builder API PutContainerImagePolicy, +// you must also call the RAM API PromoteResourceShareCreatedFromPolicy +// (https://docs.aws.amazon.com/ram/latest/APIReference/API_PromoteResourceShareCreatedFromPolicy.html) +// in order for the resource to be visible to all principals with whom the resource +// is shared. +func (c *Client) PutContainerRecipePolicy(ctx context.Context, params *PutContainerRecipePolicyInput, optFns ...func(*Options)) (*PutContainerRecipePolicyOutput, error) { + if params == nil { + params = &PutContainerRecipePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutContainerRecipePolicy", params, optFns, addOperationPutContainerRecipePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutContainerRecipePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutContainerRecipePolicyInput struct { + + // The Amazon Resource Name (ARN) of the container recipe that this policy should + // be applied to. + // + // This member is required. + ContainerRecipeArn *string + + // The policy to apply to the container recipe. + // + // This member is required. + Policy *string +} + +type PutContainerRecipePolicyOutput struct { + + // The Amazon Resource Name (ARN) of the container recipe that this policy was + // applied to. + ContainerRecipeArn *string + + // The request ID that uniquely identifies this request. + RequestId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationPutContainerRecipePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutContainerRecipePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutContainerRecipePolicy{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutContainerRecipePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutContainerRecipePolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opPutContainerRecipePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "imagebuilder", + OperationName: "PutContainerRecipePolicy", + } +} diff --git a/service/imagebuilder/api_op_UpdateImagePipeline.go b/service/imagebuilder/api_op_UpdateImagePipeline.go index c423885cb8a..b91f0d73c55 100644 --- a/service/imagebuilder/api_op_UpdateImagePipeline.go +++ b/service/imagebuilder/api_op_UpdateImagePipeline.go @@ -41,18 +41,15 @@ type UpdateImagePipelineInput struct { // This member is required. ImagePipelineArn *string - // The Amazon Resource Name (ARN) of the image recipe that will be used to - // configure images updated by this image pipeline. - // - // This member is required. - ImageRecipeArn *string - // The Amazon Resource Name (ARN) of the infrastructure configuration that will be // used to build images updated by this image pipeline. // // This member is required. InfrastructureConfigurationArn *string + // The Amazon Resource Name (ARN) of the container pipeline to update. + ContainerRecipeArn *string + // The description of the image pipeline. Description *string @@ -65,6 +62,10 @@ type UpdateImagePipelineInput struct { // enhance the overall experience of using EC2 Image Builder. Enabled by default. EnhancedImageMetadataEnabled bool + // The Amazon Resource Name (ARN) of the image recipe that will be used to + // configure images updated by this image pipeline. + ImageRecipeArn *string + // The image test configuration of the image pipeline. ImageTestsConfiguration *types.ImageTestsConfiguration diff --git a/service/imagebuilder/deserializers.go b/service/imagebuilder/deserializers.go index 98851108b55..7db5ec454e4 100644 --- a/service/imagebuilder/deserializers.go +++ b/service/imagebuilder/deserializers.go @@ -407,6 +407,205 @@ func awsRestjson1_deserializeOpDocumentCreateComponentOutput(v **CreateComponent return nil } +type awsRestjson1_deserializeOpCreateContainerRecipe struct { +} + +func (*awsRestjson1_deserializeOpCreateContainerRecipe) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateContainerRecipe) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateContainerRecipe(response, &metadata) + } + output := &CreateContainerRecipeOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateContainerRecipeOutput(&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_deserializeOpErrorCreateContainerRecipe(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("CallRateLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) + + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("IdempotentParameterMismatchException", errorCode): + return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("InvalidVersionNumberException", errorCode): + return awsRestjson1_deserializeErrorInvalidVersionNumberException(response, errorBody) + + case strings.EqualFold("ResourceAlreadyExistsException", errorCode): + return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + + case strings.EqualFold("ServiceException", errorCode): + return awsRestjson1_deserializeErrorServiceException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateContainerRecipeOutput(v **CreateContainerRecipeOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateContainerRecipeOutput + if *v == nil { + sv = &CreateContainerRecipeOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "clientToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + } + sv.ClientToken = ptr.String(jtv) + } + + case "containerRecipeArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContainerRecipeArn to be of type string, got %T instead", value) + } + sv.ContainerRecipeArn = ptr.String(jtv) + } + + case "requestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpCreateDistributionConfiguration struct { } @@ -1568,14 +1767,14 @@ func awsRestjson1_deserializeOpDocumentDeleteComponentOutput(v **DeleteComponent return nil } -type awsRestjson1_deserializeOpDeleteDistributionConfiguration struct { +type awsRestjson1_deserializeOpDeleteContainerRecipe struct { } -func (*awsRestjson1_deserializeOpDeleteDistributionConfiguration) ID() string { +func (*awsRestjson1_deserializeOpDeleteContainerRecipe) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteDistributionConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteContainerRecipe) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1589,9 +1788,9 @@ func (m *awsRestjson1_deserializeOpDeleteDistributionConfiguration) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteDistributionConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteContainerRecipe(response, &metadata) } - output := &DeleteDistributionConfigurationOutput{} + output := &DeleteContainerRecipeOutput{} out.Result = output var buff [1024]byte @@ -1612,7 +1811,7 @@ func (m *awsRestjson1_deserializeOpDeleteDistributionConfiguration) HandleDeseri return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteDistributionConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteContainerRecipeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1625,7 +1824,7 @@ func (m *awsRestjson1_deserializeOpDeleteDistributionConfiguration) HandleDeseri return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteDistributionConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteContainerRecipe(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1697,7 +1896,7 @@ func awsRestjson1_deserializeOpErrorDeleteDistributionConfiguration(response *sm } } -func awsRestjson1_deserializeOpDocumentDeleteDistributionConfigurationOutput(v **DeleteDistributionConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteContainerRecipeOutput(v **DeleteContainerRecipeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1710,22 +1909,22 @@ func awsRestjson1_deserializeOpDocumentDeleteDistributionConfigurationOutput(v * return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteDistributionConfigurationOutput + var sv *DeleteContainerRecipeOutput if *v == nil { - sv = &DeleteDistributionConfigurationOutput{} + sv = &DeleteContainerRecipeOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "distributionConfigurationArn": + case "containerRecipeArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DistributionConfigurationArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ContainerRecipeArn to be of type string, got %T instead", value) } - sv.DistributionConfigurationArn = ptr.String(jtv) + sv.ContainerRecipeArn = ptr.String(jtv) } case "requestId": @@ -1746,14 +1945,14 @@ func awsRestjson1_deserializeOpDocumentDeleteDistributionConfigurationOutput(v * return nil } -type awsRestjson1_deserializeOpDeleteImage struct { +type awsRestjson1_deserializeOpDeleteDistributionConfiguration struct { } -func (*awsRestjson1_deserializeOpDeleteImage) ID() string { +func (*awsRestjson1_deserializeOpDeleteDistributionConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteImage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteDistributionConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1767,9 +1966,9 @@ func (m *awsRestjson1_deserializeOpDeleteImage) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteImage(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteDistributionConfiguration(response, &metadata) } - output := &DeleteImageOutput{} + output := &DeleteDistributionConfigurationOutput{} out.Result = output var buff [1024]byte @@ -1790,7 +1989,7 @@ func (m *awsRestjson1_deserializeOpDeleteImage) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteImageOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteDistributionConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1803,7 +2002,7 @@ func (m *awsRestjson1_deserializeOpDeleteImage) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteImage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteDistributionConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1875,7 +2074,7 @@ func awsRestjson1_deserializeOpErrorDeleteImage(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentDeleteImageOutput(v **DeleteImageOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteDistributionConfigurationOutput(v **DeleteDistributionConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1888,22 +2087,22 @@ func awsRestjson1_deserializeOpDocumentDeleteImageOutput(v **DeleteImageOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteImageOutput + var sv *DeleteDistributionConfigurationOutput if *v == nil { - sv = &DeleteImageOutput{} + sv = &DeleteDistributionConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "imageBuildVersionArn": + case "distributionConfigurationArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) + return fmt.Errorf("expected DistributionConfigurationArn to be of type string, got %T instead", value) } - sv.ImageBuildVersionArn = ptr.String(jtv) + sv.DistributionConfigurationArn = ptr.String(jtv) } case "requestId": @@ -1924,14 +2123,14 @@ func awsRestjson1_deserializeOpDocumentDeleteImageOutput(v **DeleteImageOutput, return nil } -type awsRestjson1_deserializeOpDeleteImagePipeline struct { +type awsRestjson1_deserializeOpDeleteImage struct { } -func (*awsRestjson1_deserializeOpDeleteImagePipeline) ID() string { +func (*awsRestjson1_deserializeOpDeleteImage) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteImagePipeline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteImage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1945,9 +2144,9 @@ func (m *awsRestjson1_deserializeOpDeleteImagePipeline) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteImagePipeline(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteImage(response, &metadata) } - output := &DeleteImagePipelineOutput{} + output := &DeleteImageOutput{} out.Result = output var buff [1024]byte @@ -1968,7 +2167,7 @@ func (m *awsRestjson1_deserializeOpDeleteImagePipeline) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteImagePipelineOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteImageOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1981,7 +2180,7 @@ func (m *awsRestjson1_deserializeOpDeleteImagePipeline) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteImagePipeline(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteImage(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2053,7 +2252,7 @@ func awsRestjson1_deserializeOpErrorDeleteImagePipeline(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentDeleteImagePipelineOutput(v **DeleteImagePipelineOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteImageOutput(v **DeleteImageOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2066,22 +2265,22 @@ func awsRestjson1_deserializeOpDocumentDeleteImagePipelineOutput(v **DeleteImage return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteImagePipelineOutput + var sv *DeleteImageOutput if *v == nil { - sv = &DeleteImagePipelineOutput{} + sv = &DeleteImageOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "imagePipelineArn": + case "imageBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ImagePipelineArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) } - sv.ImagePipelineArn = ptr.String(jtv) + sv.ImageBuildVersionArn = ptr.String(jtv) } case "requestId": @@ -2102,14 +2301,14 @@ func awsRestjson1_deserializeOpDocumentDeleteImagePipelineOutput(v **DeleteImage return nil } -type awsRestjson1_deserializeOpDeleteImageRecipe struct { +type awsRestjson1_deserializeOpDeleteImagePipeline struct { } -func (*awsRestjson1_deserializeOpDeleteImageRecipe) ID() string { +func (*awsRestjson1_deserializeOpDeleteImagePipeline) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteImageRecipe) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteImagePipeline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2123,9 +2322,9 @@ func (m *awsRestjson1_deserializeOpDeleteImageRecipe) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteImageRecipe(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteImagePipeline(response, &metadata) } - output := &DeleteImageRecipeOutput{} + output := &DeleteImagePipelineOutput{} out.Result = output var buff [1024]byte @@ -2146,7 +2345,7 @@ func (m *awsRestjson1_deserializeOpDeleteImageRecipe) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteImageRecipeOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteImagePipelineOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2159,7 +2358,7 @@ func (m *awsRestjson1_deserializeOpDeleteImageRecipe) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteImageRecipe(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteImagePipeline(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2231,7 +2430,7 @@ func awsRestjson1_deserializeOpErrorDeleteImageRecipe(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentDeleteImageRecipeOutput(v **DeleteImageRecipeOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteImagePipelineOutput(v **DeleteImagePipelineOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2244,22 +2443,22 @@ func awsRestjson1_deserializeOpDocumentDeleteImageRecipeOutput(v **DeleteImageRe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteImageRecipeOutput + var sv *DeleteImagePipelineOutput if *v == nil { - sv = &DeleteImageRecipeOutput{} + sv = &DeleteImagePipelineOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "imageRecipeArn": + case "imagePipelineArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ImageRecipeArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ImagePipelineArn to be of type string, got %T instead", value) } - sv.ImageRecipeArn = ptr.String(jtv) + sv.ImagePipelineArn = ptr.String(jtv) } case "requestId": @@ -2280,14 +2479,14 @@ func awsRestjson1_deserializeOpDocumentDeleteImageRecipeOutput(v **DeleteImageRe return nil } -type awsRestjson1_deserializeOpDeleteInfrastructureConfiguration struct { +type awsRestjson1_deserializeOpDeleteImageRecipe struct { } -func (*awsRestjson1_deserializeOpDeleteInfrastructureConfiguration) ID() string { +func (*awsRestjson1_deserializeOpDeleteImageRecipe) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteInfrastructureConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteImageRecipe) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2301,9 +2500,9 @@ func (m *awsRestjson1_deserializeOpDeleteInfrastructureConfiguration) HandleDese } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteInfrastructureConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteImageRecipe(response, &metadata) } - output := &DeleteInfrastructureConfigurationOutput{} + output := &DeleteImageRecipeOutput{} out.Result = output var buff [1024]byte @@ -2324,7 +2523,7 @@ func (m *awsRestjson1_deserializeOpDeleteInfrastructureConfiguration) HandleDese return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteInfrastructureConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteImageRecipeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2337,7 +2536,7 @@ func (m *awsRestjson1_deserializeOpDeleteInfrastructureConfiguration) HandleDese return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteInfrastructureConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteImageRecipe(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2409,7 +2608,7 @@ func awsRestjson1_deserializeOpErrorDeleteInfrastructureConfiguration(response * } } -func awsRestjson1_deserializeOpDocumentDeleteInfrastructureConfigurationOutput(v **DeleteInfrastructureConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteImageRecipeOutput(v **DeleteImageRecipeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2422,22 +2621,22 @@ func awsRestjson1_deserializeOpDocumentDeleteInfrastructureConfigurationOutput(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteInfrastructureConfigurationOutput + var sv *DeleteImageRecipeOutput if *v == nil { - sv = &DeleteInfrastructureConfigurationOutput{} + sv = &DeleteImageRecipeOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "infrastructureConfigurationArn": + case "imageRecipeArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected InfrastructureConfigurationArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ImageRecipeArn to be of type string, got %T instead", value) } - sv.InfrastructureConfigurationArn = ptr.String(jtv) + sv.ImageRecipeArn = ptr.String(jtv) } case "requestId": @@ -2458,14 +2657,14 @@ func awsRestjson1_deserializeOpDocumentDeleteInfrastructureConfigurationOutput(v return nil } -type awsRestjson1_deserializeOpGetComponent struct { +type awsRestjson1_deserializeOpDeleteInfrastructureConfiguration struct { } -func (*awsRestjson1_deserializeOpGetComponent) ID() string { +func (*awsRestjson1_deserializeOpDeleteInfrastructureConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetComponent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteInfrastructureConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2479,9 +2678,9 @@ func (m *awsRestjson1_deserializeOpGetComponent) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetComponent(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteInfrastructureConfiguration(response, &metadata) } - output := &GetComponentOutput{} + output := &DeleteInfrastructureConfigurationOutput{} out.Result = output var buff [1024]byte @@ -2502,7 +2701,7 @@ func (m *awsRestjson1_deserializeOpGetComponent) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetComponentOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteInfrastructureConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2515,7 +2714,7 @@ func (m *awsRestjson1_deserializeOpGetComponent) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetComponent(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteInfrastructureConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2568,6 +2767,9 @@ func awsRestjson1_deserializeOpErrorGetComponent(response *smithyhttp.Response, case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceDependencyException", errorCode): + return awsRestjson1_deserializeErrorResourceDependencyException(response, errorBody) + case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -2584,7 +2786,7 @@ func awsRestjson1_deserializeOpErrorGetComponent(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentGetComponentOutput(v **GetComponentOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteInfrastructureConfigurationOutput(v **DeleteInfrastructureConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2597,18 +2799,22 @@ func awsRestjson1_deserializeOpDocumentGetComponentOutput(v **GetComponentOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetComponentOutput + var sv *DeleteInfrastructureConfigurationOutput if *v == nil { - sv = &GetComponentOutput{} + sv = &DeleteInfrastructureConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "component": - if err := awsRestjson1_deserializeDocumentComponent(&sv.Component, value); err != nil { - return err + case "infrastructureConfigurationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InfrastructureConfigurationArn to be of type string, got %T instead", value) + } + sv.InfrastructureConfigurationArn = ptr.String(jtv) } case "requestId": @@ -2629,14 +2835,14 @@ func awsRestjson1_deserializeOpDocumentGetComponentOutput(v **GetComponentOutput return nil } -type awsRestjson1_deserializeOpGetComponentPolicy struct { +type awsRestjson1_deserializeOpGetComponent struct { } -func (*awsRestjson1_deserializeOpGetComponentPolicy) ID() string { +func (*awsRestjson1_deserializeOpGetComponent) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetComponentPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetComponent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2650,9 +2856,9 @@ func (m *awsRestjson1_deserializeOpGetComponentPolicy) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetComponentPolicy(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetComponent(response, &metadata) } - output := &GetComponentPolicyOutput{} + output := &GetComponentOutput{} out.Result = output var buff [1024]byte @@ -2673,7 +2879,7 @@ func (m *awsRestjson1_deserializeOpGetComponentPolicy) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetComponentPolicyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetComponentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2686,7 +2892,7 @@ func (m *awsRestjson1_deserializeOpGetComponentPolicy) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetComponentPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetComponent(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2730,15 +2936,15 @@ func awsRestjson1_deserializeOpErrorGetComponentPolicy(response *smithyhttp.Resp case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) + case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -2755,7 +2961,7 @@ func awsRestjson1_deserializeOpErrorGetComponentPolicy(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentGetComponentPolicyOutput(v **GetComponentPolicyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetComponentOutput(v **GetComponentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2768,22 +2974,18 @@ func awsRestjson1_deserializeOpDocumentGetComponentPolicyOutput(v **GetComponent return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetComponentPolicyOutput + var sv *GetComponentOutput if *v == nil { - sv = &GetComponentPolicyOutput{} + sv = &GetComponentOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "policy": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourcePolicyDocument to be of type string, got %T instead", value) - } - sv.Policy = ptr.String(jtv) + case "component": + if err := awsRestjson1_deserializeDocumentComponent(&sv.Component, value); err != nil { + return err } case "requestId": @@ -2804,14 +3006,14 @@ func awsRestjson1_deserializeOpDocumentGetComponentPolicyOutput(v **GetComponent return nil } -type awsRestjson1_deserializeOpGetDistributionConfiguration struct { +type awsRestjson1_deserializeOpGetComponentPolicy struct { } -func (*awsRestjson1_deserializeOpGetDistributionConfiguration) ID() string { +func (*awsRestjson1_deserializeOpGetComponentPolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetDistributionConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetComponentPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2825,9 +3027,9 @@ func (m *awsRestjson1_deserializeOpGetDistributionConfiguration) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetDistributionConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetComponentPolicy(response, &metadata) } - output := &GetDistributionConfigurationOutput{} + output := &GetComponentPolicyOutput{} out.Result = output var buff [1024]byte @@ -2848,7 +3050,7 @@ func (m *awsRestjson1_deserializeOpGetDistributionConfiguration) HandleDeseriali return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetDistributionConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetComponentPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2861,7 +3063,7 @@ func (m *awsRestjson1_deserializeOpGetDistributionConfiguration) HandleDeseriali return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetDistributionConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetComponentPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2905,15 +3107,15 @@ func awsRestjson1_deserializeOpErrorGetDistributionConfiguration(response *smith case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -2930,7 +3132,7 @@ func awsRestjson1_deserializeOpErrorGetDistributionConfiguration(response *smith } } -func awsRestjson1_deserializeOpDocumentGetDistributionConfigurationOutput(v **GetDistributionConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetComponentPolicyOutput(v **GetComponentPolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2943,18 +3145,22 @@ func awsRestjson1_deserializeOpDocumentGetDistributionConfigurationOutput(v **Ge return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetDistributionConfigurationOutput + var sv *GetComponentPolicyOutput if *v == nil { - sv = &GetDistributionConfigurationOutput{} + sv = &GetComponentPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "distributionConfiguration": - if err := awsRestjson1_deserializeDocumentDistributionConfiguration(&sv.DistributionConfiguration, value); err != nil { - return err + case "policy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourcePolicyDocument to be of type string, got %T instead", value) + } + sv.Policy = ptr.String(jtv) } case "requestId": @@ -2975,14 +3181,14 @@ func awsRestjson1_deserializeOpDocumentGetDistributionConfigurationOutput(v **Ge return nil } -type awsRestjson1_deserializeOpGetImage struct { +type awsRestjson1_deserializeOpGetContainerRecipe struct { } -func (*awsRestjson1_deserializeOpGetImage) ID() string { +func (*awsRestjson1_deserializeOpGetContainerRecipe) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetImage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetContainerRecipe) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2996,9 +3202,9 @@ func (m *awsRestjson1_deserializeOpGetImage) HandleDeserialize(ctx context.Conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetImage(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetContainerRecipe(response, &metadata) } - output := &GetImageOutput{} + output := &GetContainerRecipeOutput{} out.Result = output var buff [1024]byte @@ -3019,7 +3225,7 @@ func (m *awsRestjson1_deserializeOpGetImage) HandleDeserialize(ctx context.Conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetImageOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetContainerRecipeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3032,7 +3238,7 @@ func (m *awsRestjson1_deserializeOpGetImage) HandleDeserialize(ctx context.Conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetImage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetContainerRecipe(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3101,7 +3307,7 @@ func awsRestjson1_deserializeOpErrorGetImage(response *smithyhttp.Response, meta } } -func awsRestjson1_deserializeOpDocumentGetImageOutput(v **GetImageOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetContainerRecipeOutput(v **GetContainerRecipeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3114,17 +3320,17 @@ func awsRestjson1_deserializeOpDocumentGetImageOutput(v **GetImageOutput, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetImageOutput + var sv *GetContainerRecipeOutput if *v == nil { - sv = &GetImageOutput{} + sv = &GetContainerRecipeOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "image": - if err := awsRestjson1_deserializeDocumentImage(&sv.Image, value); err != nil { + case "containerRecipe": + if err := awsRestjson1_deserializeDocumentContainerRecipe(&sv.ContainerRecipe, value); err != nil { return err } @@ -3146,14 +3352,14 @@ func awsRestjson1_deserializeOpDocumentGetImageOutput(v **GetImageOutput, value return nil } -type awsRestjson1_deserializeOpGetImagePipeline struct { +type awsRestjson1_deserializeOpGetContainerRecipePolicy struct { } -func (*awsRestjson1_deserializeOpGetImagePipeline) ID() string { +func (*awsRestjson1_deserializeOpGetContainerRecipePolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetImagePipeline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetContainerRecipePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3167,9 +3373,9 @@ func (m *awsRestjson1_deserializeOpGetImagePipeline) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetImagePipeline(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetContainerRecipePolicy(response, &metadata) } - output := &GetImagePipelineOutput{} + output := &GetContainerRecipePolicyOutput{} out.Result = output var buff [1024]byte @@ -3190,7 +3396,7 @@ func (m *awsRestjson1_deserializeOpGetImagePipeline) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetImagePipelineOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetContainerRecipePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3203,7 +3409,7 @@ func (m *awsRestjson1_deserializeOpGetImagePipeline) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetImagePipeline(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetContainerRecipePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3247,15 +3453,15 @@ func awsRestjson1_deserializeOpErrorGetImagePipeline(response *smithyhttp.Respon case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -3272,7 +3478,7 @@ func awsRestjson1_deserializeOpErrorGetImagePipeline(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentGetImagePipelineOutput(v **GetImagePipelineOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetContainerRecipePolicyOutput(v **GetContainerRecipePolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3285,18 +3491,22 @@ func awsRestjson1_deserializeOpDocumentGetImagePipelineOutput(v **GetImagePipeli return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetImagePipelineOutput + var sv *GetContainerRecipePolicyOutput if *v == nil { - sv = &GetImagePipelineOutput{} + sv = &GetContainerRecipePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "imagePipeline": - if err := awsRestjson1_deserializeDocumentImagePipeline(&sv.ImagePipeline, value); err != nil { - return err + case "policy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourcePolicyDocument to be of type string, got %T instead", value) + } + sv.Policy = ptr.String(jtv) } case "requestId": @@ -3317,14 +3527,14 @@ func awsRestjson1_deserializeOpDocumentGetImagePipelineOutput(v **GetImagePipeli return nil } -type awsRestjson1_deserializeOpGetImagePolicy struct { +type awsRestjson1_deserializeOpGetDistributionConfiguration struct { } -func (*awsRestjson1_deserializeOpGetImagePolicy) ID() string { +func (*awsRestjson1_deserializeOpGetDistributionConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetImagePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetDistributionConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3338,9 +3548,9 @@ func (m *awsRestjson1_deserializeOpGetImagePolicy) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetImagePolicy(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetDistributionConfiguration(response, &metadata) } - output := &GetImagePolicyOutput{} + output := &GetDistributionConfigurationOutput{} out.Result = output var buff [1024]byte @@ -3361,7 +3571,7 @@ func (m *awsRestjson1_deserializeOpGetImagePolicy) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetImagePolicyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetDistributionConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3374,7 +3584,7 @@ func (m *awsRestjson1_deserializeOpGetImagePolicy) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetImagePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetDistributionConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3418,15 +3628,15 @@ func awsRestjson1_deserializeOpErrorGetImagePolicy(response *smithyhttp.Response case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) + case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -3443,7 +3653,7 @@ func awsRestjson1_deserializeOpErrorGetImagePolicy(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentGetImagePolicyOutput(v **GetImagePolicyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetDistributionConfigurationOutput(v **GetDistributionConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3456,22 +3666,18 @@ func awsRestjson1_deserializeOpDocumentGetImagePolicyOutput(v **GetImagePolicyOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetImagePolicyOutput + var sv *GetDistributionConfigurationOutput if *v == nil { - sv = &GetImagePolicyOutput{} + sv = &GetDistributionConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "policy": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourcePolicyDocument to be of type string, got %T instead", value) - } - sv.Policy = ptr.String(jtv) + case "distributionConfiguration": + if err := awsRestjson1_deserializeDocumentDistributionConfiguration(&sv.DistributionConfiguration, value); err != nil { + return err } case "requestId": @@ -3492,14 +3698,14 @@ func awsRestjson1_deserializeOpDocumentGetImagePolicyOutput(v **GetImagePolicyOu return nil } -type awsRestjson1_deserializeOpGetImageRecipe struct { +type awsRestjson1_deserializeOpGetImage struct { } -func (*awsRestjson1_deserializeOpGetImageRecipe) ID() string { +func (*awsRestjson1_deserializeOpGetImage) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetImageRecipe) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetImage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3513,9 +3719,9 @@ func (m *awsRestjson1_deserializeOpGetImageRecipe) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetImageRecipe(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetImage(response, &metadata) } - output := &GetImageRecipeOutput{} + output := &GetImageOutput{} out.Result = output var buff [1024]byte @@ -3536,7 +3742,7 @@ func (m *awsRestjson1_deserializeOpGetImageRecipe) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetImageRecipeOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetImageOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3549,7 +3755,7 @@ func (m *awsRestjson1_deserializeOpGetImageRecipe) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetImageRecipe(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetImage(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3618,7 +3824,7 @@ func awsRestjson1_deserializeOpErrorGetImageRecipe(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentGetImageRecipeOutput(v **GetImageRecipeOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetImageOutput(v **GetImageOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3631,17 +3837,17 @@ func awsRestjson1_deserializeOpDocumentGetImageRecipeOutput(v **GetImageRecipeOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetImageRecipeOutput + var sv *GetImageOutput if *v == nil { - sv = &GetImageRecipeOutput{} + sv = &GetImageOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "imageRecipe": - if err := awsRestjson1_deserializeDocumentImageRecipe(&sv.ImageRecipe, value); err != nil { + case "image": + if err := awsRestjson1_deserializeDocumentImage(&sv.Image, value); err != nil { return err } @@ -3663,14 +3869,14 @@ func awsRestjson1_deserializeOpDocumentGetImageRecipeOutput(v **GetImageRecipeOu return nil } -type awsRestjson1_deserializeOpGetImageRecipePolicy struct { +type awsRestjson1_deserializeOpGetImagePipeline struct { } -func (*awsRestjson1_deserializeOpGetImageRecipePolicy) ID() string { +func (*awsRestjson1_deserializeOpGetImagePipeline) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetImageRecipePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetImagePipeline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3684,9 +3890,9 @@ func (m *awsRestjson1_deserializeOpGetImageRecipePolicy) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetImageRecipePolicy(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetImagePipeline(response, &metadata) } - output := &GetImageRecipePolicyOutput{} + output := &GetImagePipelineOutput{} out.Result = output var buff [1024]byte @@ -3707,7 +3913,7 @@ func (m *awsRestjson1_deserializeOpGetImageRecipePolicy) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetImageRecipePolicyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetImagePipelineOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3720,7 +3926,7 @@ func (m *awsRestjson1_deserializeOpGetImageRecipePolicy) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetImageRecipePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetImagePipeline(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3764,15 +3970,15 @@ func awsRestjson1_deserializeOpErrorGetImageRecipePolicy(response *smithyhttp.Re case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) + case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -3789,7 +3995,7 @@ func awsRestjson1_deserializeOpErrorGetImageRecipePolicy(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentGetImageRecipePolicyOutput(v **GetImageRecipePolicyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetImagePipelineOutput(v **GetImagePipelineOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3802,22 +4008,18 @@ func awsRestjson1_deserializeOpDocumentGetImageRecipePolicyOutput(v **GetImageRe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetImageRecipePolicyOutput + var sv *GetImagePipelineOutput if *v == nil { - sv = &GetImageRecipePolicyOutput{} + sv = &GetImagePipelineOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "policy": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourcePolicyDocument to be of type string, got %T instead", value) - } - sv.Policy = ptr.String(jtv) + case "imagePipeline": + if err := awsRestjson1_deserializeDocumentImagePipeline(&sv.ImagePipeline, value); err != nil { + return err } case "requestId": @@ -3838,14 +4040,14 @@ func awsRestjson1_deserializeOpDocumentGetImageRecipePolicyOutput(v **GetImageRe return nil } -type awsRestjson1_deserializeOpGetInfrastructureConfiguration struct { +type awsRestjson1_deserializeOpGetImagePolicy struct { } -func (*awsRestjson1_deserializeOpGetInfrastructureConfiguration) ID() string { +func (*awsRestjson1_deserializeOpGetImagePolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetInfrastructureConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetImagePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3859,9 +4061,9 @@ func (m *awsRestjson1_deserializeOpGetInfrastructureConfiguration) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetInfrastructureConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetImagePolicy(response, &metadata) } - output := &GetInfrastructureConfigurationOutput{} + output := &GetImagePolicyOutput{} out.Result = output var buff [1024]byte @@ -3882,7 +4084,7 @@ func (m *awsRestjson1_deserializeOpGetInfrastructureConfiguration) HandleDeseria return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetInfrastructureConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetImagePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3895,7 +4097,7 @@ func (m *awsRestjson1_deserializeOpGetInfrastructureConfiguration) HandleDeseria return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetInfrastructureConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetImagePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3939,15 +4141,15 @@ func awsRestjson1_deserializeOpErrorGetInfrastructureConfiguration(response *smi case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -3964,7 +4166,7 @@ func awsRestjson1_deserializeOpErrorGetInfrastructureConfiguration(response *smi } } -func awsRestjson1_deserializeOpDocumentGetInfrastructureConfigurationOutput(v **GetInfrastructureConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetImagePolicyOutput(v **GetImagePolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3977,18 +4179,22 @@ func awsRestjson1_deserializeOpDocumentGetInfrastructureConfigurationOutput(v ** return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetInfrastructureConfigurationOutput + var sv *GetImagePolicyOutput if *v == nil { - sv = &GetInfrastructureConfigurationOutput{} + sv = &GetImagePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "infrastructureConfiguration": - if err := awsRestjson1_deserializeDocumentInfrastructureConfiguration(&sv.InfrastructureConfiguration, value); err != nil { - return err + case "policy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourcePolicyDocument to be of type string, got %T instead", value) + } + sv.Policy = ptr.String(jtv) } case "requestId": @@ -4009,14 +4215,14 @@ func awsRestjson1_deserializeOpDocumentGetInfrastructureConfigurationOutput(v ** return nil } -type awsRestjson1_deserializeOpImportComponent struct { +type awsRestjson1_deserializeOpGetImageRecipe struct { } -func (*awsRestjson1_deserializeOpImportComponent) ID() string { +func (*awsRestjson1_deserializeOpGetImageRecipe) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpImportComponent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetImageRecipe) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4030,9 +4236,9 @@ func (m *awsRestjson1_deserializeOpImportComponent) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorImportComponent(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetImageRecipe(response, &metadata) } - output := &ImportComponentOutput{} + output := &GetImageRecipeOutput{} out.Result = output var buff [1024]byte @@ -4053,7 +4259,7 @@ func (m *awsRestjson1_deserializeOpImportComponent) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentImportComponentOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetImageRecipeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4066,7 +4272,7 @@ func (m *awsRestjson1_deserializeOpImportComponent) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorImportComponent(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetImageRecipe(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4116,21 +4322,9 @@ func awsRestjson1_deserializeOpErrorImportComponent(response *smithyhttp.Respons case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - case strings.EqualFold("IdempotentParameterMismatchException", errorCode): - return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) - - case strings.EqualFold("InvalidParameterCombinationException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterCombinationException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("InvalidVersionNumberException", errorCode): - return awsRestjson1_deserializeErrorInvalidVersionNumberException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -4147,7 +4341,7 @@ func awsRestjson1_deserializeOpErrorImportComponent(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentImportComponentOutput(v **ImportComponentOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetImageRecipeOutput(v **GetImageRecipeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4160,31 +4354,18 @@ func awsRestjson1_deserializeOpDocumentImportComponentOutput(v **ImportComponent return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ImportComponentOutput + var sv *GetImageRecipeOutput if *v == nil { - sv = &ImportComponentOutput{} + sv = &GetImageRecipeOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "clientToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) - } - sv.ClientToken = ptr.String(jtv) - } - - case "componentBuildVersionArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ComponentBuildVersionArn to be of type string, got %T instead", value) - } - sv.ComponentBuildVersionArn = ptr.String(jtv) + case "imageRecipe": + if err := awsRestjson1_deserializeDocumentImageRecipe(&sv.ImageRecipe, value); err != nil { + return err } case "requestId": @@ -4205,14 +4386,14 @@ func awsRestjson1_deserializeOpDocumentImportComponentOutput(v **ImportComponent return nil } -type awsRestjson1_deserializeOpListComponentBuildVersions struct { +type awsRestjson1_deserializeOpGetImageRecipePolicy struct { } -func (*awsRestjson1_deserializeOpListComponentBuildVersions) ID() string { +func (*awsRestjson1_deserializeOpGetImageRecipePolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListComponentBuildVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetImageRecipePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4226,9 +4407,9 @@ func (m *awsRestjson1_deserializeOpListComponentBuildVersions) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListComponentBuildVersions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetImageRecipePolicy(response, &metadata) } - output := &ListComponentBuildVersionsOutput{} + output := &GetImageRecipePolicyOutput{} out.Result = output var buff [1024]byte @@ -4249,7 +4430,7 @@ func (m *awsRestjson1_deserializeOpListComponentBuildVersions) HandleDeserialize return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListComponentBuildVersionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetImageRecipePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4262,7 +4443,7 @@ func (m *awsRestjson1_deserializeOpListComponentBuildVersions) HandleDeserialize return out, metadata, err } -func awsRestjson1_deserializeOpErrorListComponentBuildVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetImageRecipePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4306,18 +4487,15 @@ func awsRestjson1_deserializeOpErrorListComponentBuildVersions(response *smithyh case strings.EqualFold("CallRateLimitExceededException", errorCode): return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - case strings.EqualFold("InvalidPaginationTokenException", errorCode): - return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -4334,7 +4512,7 @@ func awsRestjson1_deserializeOpErrorListComponentBuildVersions(response *smithyh } } -func awsRestjson1_deserializeOpDocumentListComponentBuildVersionsOutput(v **ListComponentBuildVersionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetImageRecipePolicyOutput(v **GetImageRecipePolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4347,27 +4525,22 @@ func awsRestjson1_deserializeOpDocumentListComponentBuildVersionsOutput(v **List return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListComponentBuildVersionsOutput + var sv *GetImageRecipePolicyOutput if *v == nil { - sv = &ListComponentBuildVersionsOutput{} + sv = &GetImageRecipePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "componentSummaryList": - if err := awsRestjson1_deserializeDocumentComponentSummaryList(&sv.ComponentSummaryList, value); err != nil { - return err - } - - case "nextToken": + case "policy": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + return fmt.Errorf("expected ResourcePolicyDocument to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.Policy = ptr.String(jtv) } case "requestId": @@ -4388,14 +4561,14 @@ func awsRestjson1_deserializeOpDocumentListComponentBuildVersionsOutput(v **List return nil } -type awsRestjson1_deserializeOpListComponents struct { +type awsRestjson1_deserializeOpGetInfrastructureConfiguration struct { } -func (*awsRestjson1_deserializeOpListComponents) ID() string { +func (*awsRestjson1_deserializeOpGetInfrastructureConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListComponents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetInfrastructureConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4409,9 +4582,9 @@ func (m *awsRestjson1_deserializeOpListComponents) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListComponents(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetInfrastructureConfiguration(response, &metadata) } - output := &ListComponentsOutput{} + output := &GetInfrastructureConfigurationOutput{} out.Result = output var buff [1024]byte @@ -4432,7 +4605,7 @@ func (m *awsRestjson1_deserializeOpListComponents) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListComponentsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetInfrastructureConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4445,7 +4618,7 @@ func (m *awsRestjson1_deserializeOpListComponents) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListComponents(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetInfrastructureConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4495,9 +4668,6 @@ func awsRestjson1_deserializeOpErrorListComponents(response *smithyhttp.Response case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - case strings.EqualFold("InvalidPaginationTokenException", errorCode): - return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) @@ -4517,7 +4687,7 @@ func awsRestjson1_deserializeOpErrorListComponents(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListComponentsOutput(v **ListComponentsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetInfrastructureConfigurationOutput(v **GetInfrastructureConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4530,29 +4700,20 @@ func awsRestjson1_deserializeOpDocumentListComponentsOutput(v **ListComponentsOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListComponentsOutput + var sv *GetInfrastructureConfigurationOutput if *v == nil { - sv = &ListComponentsOutput{} + sv = &GetInfrastructureConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "componentVersionList": - if err := awsRestjson1_deserializeDocumentComponentVersionList(&sv.ComponentVersionList, value); err != nil { + case "infrastructureConfiguration": + if err := awsRestjson1_deserializeDocumentInfrastructureConfiguration(&sv.InfrastructureConfiguration, 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) - } - case "requestId": if value != nil { jtv, ok := value.(string) @@ -4571,14 +4732,14 @@ func awsRestjson1_deserializeOpDocumentListComponentsOutput(v **ListComponentsOu return nil } -type awsRestjson1_deserializeOpListDistributionConfigurations struct { +type awsRestjson1_deserializeOpImportComponent struct { } -func (*awsRestjson1_deserializeOpListDistributionConfigurations) ID() string { +func (*awsRestjson1_deserializeOpImportComponent) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListDistributionConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpImportComponent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4592,9 +4753,9 @@ func (m *awsRestjson1_deserializeOpListDistributionConfigurations) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListDistributionConfigurations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorImportComponent(response, &metadata) } - output := &ListDistributionConfigurationsOutput{} + output := &ImportComponentOutput{} out.Result = output var buff [1024]byte @@ -4615,7 +4776,7 @@ func (m *awsRestjson1_deserializeOpListDistributionConfigurations) HandleDeseria return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListDistributionConfigurationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentImportComponentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4628,7 +4789,7 @@ func (m *awsRestjson1_deserializeOpListDistributionConfigurations) HandleDeseria return out, metadata, err } -func awsRestjson1_deserializeOpErrorListDistributionConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorImportComponent(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4678,12 +4839,21 @@ func awsRestjson1_deserializeOpErrorListDistributionConfigurations(response *smi case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - case strings.EqualFold("InvalidPaginationTokenException", errorCode): - return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) + case strings.EqualFold("IdempotentParameterMismatchException", errorCode): + return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) + + case strings.EqualFold("InvalidParameterCombinationException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterCombinationException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("InvalidVersionNumberException", errorCode): + return awsRestjson1_deserializeErrorInvalidVersionNumberException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -4700,7 +4870,7 @@ func awsRestjson1_deserializeOpErrorListDistributionConfigurations(response *smi } } -func awsRestjson1_deserializeOpDocumentListDistributionConfigurationsOutput(v **ListDistributionConfigurationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentImportComponentOutput(v **ImportComponentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4713,27 +4883,31 @@ func awsRestjson1_deserializeOpDocumentListDistributionConfigurationsOutput(v ** return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListDistributionConfigurationsOutput + var sv *ImportComponentOutput if *v == nil { - sv = &ListDistributionConfigurationsOutput{} + sv = &ImportComponentOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "distributionConfigurationSummaryList": - if err := awsRestjson1_deserializeDocumentDistributionConfigurationSummaryList(&sv.DistributionConfigurationSummaryList, value); err != nil { - return err + case "clientToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + } + sv.ClientToken = ptr.String(jtv) } - case "nextToken": + case "componentBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + return fmt.Errorf("expected ComponentBuildVersionArn to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.ComponentBuildVersionArn = ptr.String(jtv) } case "requestId": @@ -4754,14 +4928,14 @@ func awsRestjson1_deserializeOpDocumentListDistributionConfigurationsOutput(v ** return nil } -type awsRestjson1_deserializeOpListImageBuildVersions struct { +type awsRestjson1_deserializeOpListComponentBuildVersions struct { } -func (*awsRestjson1_deserializeOpListImageBuildVersions) ID() string { +func (*awsRestjson1_deserializeOpListComponentBuildVersions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListImageBuildVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListComponentBuildVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4775,9 +4949,9 @@ func (m *awsRestjson1_deserializeOpListImageBuildVersions) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListImageBuildVersions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListComponentBuildVersions(response, &metadata) } - output := &ListImageBuildVersionsOutput{} + output := &ListComponentBuildVersionsOutput{} out.Result = output var buff [1024]byte @@ -4798,7 +4972,7 @@ func (m *awsRestjson1_deserializeOpListImageBuildVersions) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListImageBuildVersionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListComponentBuildVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4811,7 +4985,7 @@ func (m *awsRestjson1_deserializeOpListImageBuildVersions) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListImageBuildVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListComponentBuildVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4883,7 +5057,7 @@ func awsRestjson1_deserializeOpErrorListImageBuildVersions(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentListImageBuildVersionsOutput(v **ListImageBuildVersionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListComponentBuildVersionsOutput(v **ListComponentBuildVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4896,17 +5070,17 @@ func awsRestjson1_deserializeOpDocumentListImageBuildVersionsOutput(v **ListImag return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListImageBuildVersionsOutput + var sv *ListComponentBuildVersionsOutput if *v == nil { - sv = &ListImageBuildVersionsOutput{} + sv = &ListComponentBuildVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "imageSummaryList": - if err := awsRestjson1_deserializeDocumentImageSummaryList(&sv.ImageSummaryList, value); err != nil { + case "componentSummaryList": + if err := awsRestjson1_deserializeDocumentComponentSummaryList(&sv.ComponentSummaryList, value); err != nil { return err } @@ -4937,14 +5111,14 @@ func awsRestjson1_deserializeOpDocumentListImageBuildVersionsOutput(v **ListImag return nil } -type awsRestjson1_deserializeOpListImagePipelineImages struct { +type awsRestjson1_deserializeOpListComponents struct { } -func (*awsRestjson1_deserializeOpListImagePipelineImages) ID() string { +func (*awsRestjson1_deserializeOpListComponents) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListImagePipelineImages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListComponents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4958,9 +5132,9 @@ func (m *awsRestjson1_deserializeOpListImagePipelineImages) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListImagePipelineImages(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListComponents(response, &metadata) } - output := &ListImagePipelineImagesOutput{} + output := &ListComponentsOutput{} out.Result = output var buff [1024]byte @@ -4981,7 +5155,7 @@ func (m *awsRestjson1_deserializeOpListImagePipelineImages) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListImagePipelineImagesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListComponentsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4994,7 +5168,7 @@ func (m *awsRestjson1_deserializeOpListImagePipelineImages) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorListImagePipelineImages(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListComponents(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5050,9 +5224,6 @@ func awsRestjson1_deserializeOpErrorListImagePipelineImages(response *smithyhttp case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -5069,7 +5240,7 @@ func awsRestjson1_deserializeOpErrorListImagePipelineImages(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentListImagePipelineImagesOutput(v **ListImagePipelineImagesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListComponentsOutput(v **ListComponentsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5082,17 +5253,17 @@ func awsRestjson1_deserializeOpDocumentListImagePipelineImagesOutput(v **ListIma return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListImagePipelineImagesOutput + var sv *ListComponentsOutput if *v == nil { - sv = &ListImagePipelineImagesOutput{} + sv = &ListComponentsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "imageSummaryList": - if err := awsRestjson1_deserializeDocumentImageSummaryList(&sv.ImageSummaryList, value); err != nil { + case "componentVersionList": + if err := awsRestjson1_deserializeDocumentComponentVersionList(&sv.ComponentVersionList, value); err != nil { return err } @@ -5123,14 +5294,14 @@ func awsRestjson1_deserializeOpDocumentListImagePipelineImagesOutput(v **ListIma return nil } -type awsRestjson1_deserializeOpListImagePipelines struct { +type awsRestjson1_deserializeOpListContainerRecipes struct { } -func (*awsRestjson1_deserializeOpListImagePipelines) ID() string { +func (*awsRestjson1_deserializeOpListContainerRecipes) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListImagePipelines) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListContainerRecipes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5144,9 +5315,9 @@ func (m *awsRestjson1_deserializeOpListImagePipelines) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListImagePipelines(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListContainerRecipes(response, &metadata) } - output := &ListImagePipelinesOutput{} + output := &ListContainerRecipesOutput{} out.Result = output var buff [1024]byte @@ -5167,7 +5338,7 @@ func (m *awsRestjson1_deserializeOpListImagePipelines) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListImagePipelinesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListContainerRecipesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5180,7 +5351,7 @@ func (m *awsRestjson1_deserializeOpListImagePipelines) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListImagePipelines(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListContainerRecipes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5252,7 +5423,7 @@ func awsRestjson1_deserializeOpErrorListImagePipelines(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentListImagePipelinesOutput(v **ListImagePipelinesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListContainerRecipesOutput(v **ListContainerRecipesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5265,17 +5436,17 @@ func awsRestjson1_deserializeOpDocumentListImagePipelinesOutput(v **ListImagePip return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListImagePipelinesOutput + var sv *ListContainerRecipesOutput if *v == nil { - sv = &ListImagePipelinesOutput{} + sv = &ListContainerRecipesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "imagePipelineList": - if err := awsRestjson1_deserializeDocumentImagePipelineList(&sv.ImagePipelineList, value); err != nil { + case "containerRecipeSummaryList": + if err := awsRestjson1_deserializeDocumentContainerRecipeSummaryList(&sv.ContainerRecipeSummaryList, value); err != nil { return err } @@ -5283,7 +5454,7 @@ func awsRestjson1_deserializeOpDocumentListImagePipelinesOutput(v **ListImagePip if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } @@ -5306,14 +5477,14 @@ func awsRestjson1_deserializeOpDocumentListImagePipelinesOutput(v **ListImagePip return nil } -type awsRestjson1_deserializeOpListImageRecipes struct { +type awsRestjson1_deserializeOpListDistributionConfigurations struct { } -func (*awsRestjson1_deserializeOpListImageRecipes) ID() string { +func (*awsRestjson1_deserializeOpListDistributionConfigurations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListImageRecipes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListDistributionConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5327,9 +5498,9 @@ func (m *awsRestjson1_deserializeOpListImageRecipes) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListImageRecipes(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListDistributionConfigurations(response, &metadata) } - output := &ListImageRecipesOutput{} + output := &ListDistributionConfigurationsOutput{} out.Result = output var buff [1024]byte @@ -5350,7 +5521,7 @@ func (m *awsRestjson1_deserializeOpListImageRecipes) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListImageRecipesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListDistributionConfigurationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5363,7 +5534,7 @@ func (m *awsRestjson1_deserializeOpListImageRecipes) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorListImageRecipes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListDistributionConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5435,7 +5606,7 @@ func awsRestjson1_deserializeOpErrorListImageRecipes(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentListImageRecipesOutput(v **ListImageRecipesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListDistributionConfigurationsOutput(v **ListDistributionConfigurationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5448,17 +5619,17 @@ func awsRestjson1_deserializeOpDocumentListImageRecipesOutput(v **ListImageRecip return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListImageRecipesOutput + var sv *ListDistributionConfigurationsOutput if *v == nil { - sv = &ListImageRecipesOutput{} + sv = &ListDistributionConfigurationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "imageRecipeSummaryList": - if err := awsRestjson1_deserializeDocumentImageRecipeSummaryList(&sv.ImageRecipeSummaryList, value); err != nil { + case "distributionConfigurationSummaryList": + if err := awsRestjson1_deserializeDocumentDistributionConfigurationSummaryList(&sv.DistributionConfigurationSummaryList, value); err != nil { return err } @@ -5489,14 +5660,14 @@ func awsRestjson1_deserializeOpDocumentListImageRecipesOutput(v **ListImageRecip return nil } -type awsRestjson1_deserializeOpListImages struct { +type awsRestjson1_deserializeOpListImageBuildVersions struct { } -func (*awsRestjson1_deserializeOpListImages) ID() string { +func (*awsRestjson1_deserializeOpListImageBuildVersions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListImages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListImageBuildVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5510,9 +5681,9 @@ func (m *awsRestjson1_deserializeOpListImages) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListImages(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListImageBuildVersions(response, &metadata) } - output := &ListImagesOutput{} + output := &ListImageBuildVersionsOutput{} out.Result = output var buff [1024]byte @@ -5533,7 +5704,7 @@ func (m *awsRestjson1_deserializeOpListImages) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListImagesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListImageBuildVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5546,7 +5717,7 @@ func (m *awsRestjson1_deserializeOpListImages) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListImages(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListImageBuildVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5618,7 +5789,7 @@ func awsRestjson1_deserializeOpErrorListImages(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentListImagesOutput(v **ListImagesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListImageBuildVersionsOutput(v **ListImageBuildVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5631,17 +5802,17 @@ func awsRestjson1_deserializeOpDocumentListImagesOutput(v **ListImagesOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListImagesOutput + var sv *ListImageBuildVersionsOutput if *v == nil { - sv = &ListImagesOutput{} + sv = &ListImageBuildVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "imageVersionList": - if err := awsRestjson1_deserializeDocumentImageVersionList(&sv.ImageVersionList, value); err != nil { + case "imageSummaryList": + if err := awsRestjson1_deserializeDocumentImageSummaryList(&sv.ImageSummaryList, value); err != nil { return err } @@ -5672,14 +5843,14 @@ func awsRestjson1_deserializeOpDocumentListImagesOutput(v **ListImagesOutput, va return nil } -type awsRestjson1_deserializeOpListInfrastructureConfigurations struct { +type awsRestjson1_deserializeOpListImagePipelineImages struct { } -func (*awsRestjson1_deserializeOpListInfrastructureConfigurations) ID() string { +func (*awsRestjson1_deserializeOpListImagePipelineImages) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListInfrastructureConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListImagePipelineImages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5693,9 +5864,9 @@ func (m *awsRestjson1_deserializeOpListInfrastructureConfigurations) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListInfrastructureConfigurations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListImagePipelineImages(response, &metadata) } - output := &ListInfrastructureConfigurationsOutput{} + output := &ListImagePipelineImagesOutput{} out.Result = output var buff [1024]byte @@ -5716,7 +5887,7 @@ func (m *awsRestjson1_deserializeOpListInfrastructureConfigurations) HandleDeser return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListInfrastructureConfigurationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListImagePipelineImagesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5729,7 +5900,7 @@ func (m *awsRestjson1_deserializeOpListInfrastructureConfigurations) HandleDeser return out, metadata, err } -func awsRestjson1_deserializeOpErrorListInfrastructureConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListImagePipelineImages(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5785,6 +5956,9 @@ func awsRestjson1_deserializeOpErrorListInfrastructureConfigurations(response *s case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -5801,7 +5975,7 @@ func awsRestjson1_deserializeOpErrorListInfrastructureConfigurations(response *s } } -func awsRestjson1_deserializeOpDocumentListInfrastructureConfigurationsOutput(v **ListInfrastructureConfigurationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListImagePipelineImagesOutput(v **ListImagePipelineImagesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5814,17 +5988,17 @@ func awsRestjson1_deserializeOpDocumentListInfrastructureConfigurationsOutput(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListInfrastructureConfigurationsOutput + var sv *ListImagePipelineImagesOutput if *v == nil { - sv = &ListInfrastructureConfigurationsOutput{} + sv = &ListImagePipelineImagesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "infrastructureConfigurationSummaryList": - if err := awsRestjson1_deserializeDocumentInfrastructureConfigurationSummaryList(&sv.InfrastructureConfigurationSummaryList, value); err != nil { + case "imageSummaryList": + if err := awsRestjson1_deserializeDocumentImageSummaryList(&sv.ImageSummaryList, value); err != nil { return err } @@ -5855,14 +6029,14 @@ func awsRestjson1_deserializeOpDocumentListInfrastructureConfigurationsOutput(v return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpListImagePipelines struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpListImagePipelines) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListImagePipelines) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5876,9 +6050,9 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListImagePipelines(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListImagePipelinesOutput{} out.Result = output var buff [1024]byte @@ -5899,7 +6073,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListImagePipelinesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5912,7 +6086,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListImagePipelines(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5953,15 +6127,27 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("CallRateLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("InvalidPaginationTokenException", errorCode): + return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5972,7 +6158,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListImagePipelinesOutput(v **ListImagePipelinesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5985,20 +6171,38 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *ListImagePipelinesOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &ListImagePipelinesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + case "imagePipelineList": + if err := awsRestjson1_deserializeDocumentImagePipelineList(&sv.ImagePipelineList, 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) + } + + case "requestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + default: _, _ = key, value @@ -6008,14 +6212,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpPutComponentPolicy struct { +type awsRestjson1_deserializeOpListImageRecipes struct { } -func (*awsRestjson1_deserializeOpPutComponentPolicy) ID() string { +func (*awsRestjson1_deserializeOpListImageRecipes) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPutComponentPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListImageRecipes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6029,9 +6233,9 @@ func (m *awsRestjson1_deserializeOpPutComponentPolicy) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutComponentPolicy(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListImageRecipes(response, &metadata) } - output := &PutComponentPolicyOutput{} + output := &ListImageRecipesOutput{} out.Result = output var buff [1024]byte @@ -6052,7 +6256,7 @@ func (m *awsRestjson1_deserializeOpPutComponentPolicy) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentPutComponentPolicyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListImageRecipesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6065,7 +6269,7 @@ func (m *awsRestjson1_deserializeOpPutComponentPolicy) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorPutComponentPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListImageRecipes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6115,15 +6319,12 @@ func awsRestjson1_deserializeOpErrorPutComponentPolicy(response *smithyhttp.Resp case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - case strings.EqualFold("InvalidParameterValueException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) + case strings.EqualFold("InvalidPaginationTokenException", errorCode): + return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -6140,7 +6341,7 @@ func awsRestjson1_deserializeOpErrorPutComponentPolicy(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentPutComponentPolicyOutput(v **PutComponentPolicyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListImageRecipesOutput(v **ListImageRecipesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6153,22 +6354,27 @@ func awsRestjson1_deserializeOpDocumentPutComponentPolicyOutput(v **PutComponent return fmt.Errorf("unexpected JSON type %v", value) } - var sv *PutComponentPolicyOutput + var sv *ListImageRecipesOutput if *v == nil { - sv = &PutComponentPolicyOutput{} + sv = &ListImageRecipesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "componentArn": + case "imageRecipeSummaryList": + if err := awsRestjson1_deserializeDocumentImageRecipeSummaryList(&sv.ImageRecipeSummaryList, value); err != nil { + return err + } + + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ComponentBuildVersionArn to be of type string, got %T instead", value) + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } - sv.ComponentArn = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } case "requestId": @@ -6189,14 +6395,14 @@ func awsRestjson1_deserializeOpDocumentPutComponentPolicyOutput(v **PutComponent return nil } -type awsRestjson1_deserializeOpPutImagePolicy struct { +type awsRestjson1_deserializeOpListImages struct { } -func (*awsRestjson1_deserializeOpPutImagePolicy) ID() string { +func (*awsRestjson1_deserializeOpListImages) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPutImagePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListImages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6210,9 +6416,9 @@ func (m *awsRestjson1_deserializeOpPutImagePolicy) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutImagePolicy(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListImages(response, &metadata) } - output := &PutImagePolicyOutput{} + output := &ListImagesOutput{} out.Result = output var buff [1024]byte @@ -6233,7 +6439,7 @@ func (m *awsRestjson1_deserializeOpPutImagePolicy) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentPutImagePolicyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListImagesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6246,7 +6452,7 @@ func (m *awsRestjson1_deserializeOpPutImagePolicy) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorPutImagePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListImages(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6296,15 +6502,12 @@ func awsRestjson1_deserializeOpErrorPutImagePolicy(response *smithyhttp.Response case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - case strings.EqualFold("InvalidParameterValueException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) + case strings.EqualFold("InvalidPaginationTokenException", errorCode): + return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -6321,7 +6524,7 @@ func awsRestjson1_deserializeOpErrorPutImagePolicy(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentPutImagePolicyOutput(v **PutImagePolicyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListImagesOutput(v **ListImagesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6334,22 +6537,27 @@ func awsRestjson1_deserializeOpDocumentPutImagePolicyOutput(v **PutImagePolicyOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *PutImagePolicyOutput + var sv *ListImagesOutput if *v == nil { - sv = &PutImagePolicyOutput{} + sv = &ListImagesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "imageArn": - if value != nil { - jtv, ok := value.(string) + case "imageVersionList": + if err := awsRestjson1_deserializeDocumentImageVersionList(&sv.ImageVersionList, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } - sv.ImageArn = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } case "requestId": @@ -6370,14 +6578,14 @@ func awsRestjson1_deserializeOpDocumentPutImagePolicyOutput(v **PutImagePolicyOu return nil } -type awsRestjson1_deserializeOpPutImageRecipePolicy struct { +type awsRestjson1_deserializeOpListInfrastructureConfigurations struct { } -func (*awsRestjson1_deserializeOpPutImageRecipePolicy) ID() string { +func (*awsRestjson1_deserializeOpListInfrastructureConfigurations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPutImageRecipePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListInfrastructureConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6391,9 +6599,9 @@ func (m *awsRestjson1_deserializeOpPutImageRecipePolicy) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutImageRecipePolicy(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListInfrastructureConfigurations(response, &metadata) } - output := &PutImageRecipePolicyOutput{} + output := &ListInfrastructureConfigurationsOutput{} out.Result = output var buff [1024]byte @@ -6414,7 +6622,7 @@ func (m *awsRestjson1_deserializeOpPutImageRecipePolicy) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentPutImageRecipePolicyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListInfrastructureConfigurationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6427,7 +6635,7 @@ func (m *awsRestjson1_deserializeOpPutImageRecipePolicy) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorPutImageRecipePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListInfrastructureConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6477,15 +6685,12 @@ func awsRestjson1_deserializeOpErrorPutImageRecipePolicy(response *smithyhttp.Re case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - case strings.EqualFold("InvalidParameterValueException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) + case strings.EqualFold("InvalidPaginationTokenException", errorCode): + return awsRestjson1_deserializeErrorInvalidPaginationTokenException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -6502,7 +6707,7 @@ func awsRestjson1_deserializeOpErrorPutImageRecipePolicy(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentPutImageRecipePolicyOutput(v **PutImageRecipePolicyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListInfrastructureConfigurationsOutput(v **ListInfrastructureConfigurationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6515,22 +6720,27 @@ func awsRestjson1_deserializeOpDocumentPutImageRecipePolicyOutput(v **PutImageRe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *PutImageRecipePolicyOutput + var sv *ListInfrastructureConfigurationsOutput if *v == nil { - sv = &PutImageRecipePolicyOutput{} + sv = &ListInfrastructureConfigurationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "imageRecipeArn": + case "infrastructureConfigurationSummaryList": + if err := awsRestjson1_deserializeDocumentInfrastructureConfigurationSummaryList(&sv.InfrastructureConfigurationSummaryList, value); err != nil { + return err + } + + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ImageRecipeArn to be of type string, got %T instead", value) + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) } - sv.ImageRecipeArn = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } case "requestId": @@ -6551,14 +6761,14 @@ func awsRestjson1_deserializeOpDocumentPutImageRecipePolicyOutput(v **PutImageRe return nil } -type awsRestjson1_deserializeOpStartImagePipelineExecution struct { +type awsRestjson1_deserializeOpListTagsForResource struct { } -func (*awsRestjson1_deserializeOpStartImagePipelineExecution) ID() string { +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpStartImagePipelineExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -6572,9 +6782,9 @@ func (m *awsRestjson1_deserializeOpStartImagePipelineExecution) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStartImagePipelineExecution(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &StartImagePipelineExecutionOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -6595,7 +6805,7 @@ func (m *awsRestjson1_deserializeOpStartImagePipelineExecution) HandleDeserializ return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentStartImagePipelineExecutionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6608,7 +6818,7 @@ func (m *awsRestjson1_deserializeOpStartImagePipelineExecution) HandleDeserializ return out, metadata, err } -func awsRestjson1_deserializeOpErrorStartImagePipelineExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { +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)} @@ -6649,23 +6859,8 @@ func awsRestjson1_deserializeOpErrorStartImagePipelineExecution(response *smithy } switch { - case strings.EqualFold("CallRateLimitExceededException", errorCode): - return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) - - case strings.EqualFold("ClientException", errorCode): - return awsRestjson1_deserializeErrorClientException(response, errorBody) - - case strings.EqualFold("ForbiddenException", errorCode): - return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - - case strings.EqualFold("IdempotentParameterMismatchException", errorCode): - return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -6673,9 +6868,6 @@ func awsRestjson1_deserializeOpErrorStartImagePipelineExecution(response *smithy case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -6686,7 +6878,7 @@ func awsRestjson1_deserializeOpErrorStartImagePipelineExecution(response *smithy } } -func awsRestjson1_deserializeOpDocumentStartImagePipelineExecutionOutput(v **StartImagePipelineExecutionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6699,40 +6891,18 @@ func awsRestjson1_deserializeOpDocumentStartImagePipelineExecutionOutput(v **Sta return fmt.Errorf("unexpected JSON type %v", value) } - var sv *StartImagePipelineExecutionOutput + var sv *ListTagsForResourceOutput if *v == nil { - sv = &StartImagePipelineExecutionOutput{} + sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "clientToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) - } - sv.ClientToken = ptr.String(jtv) - } - - case "imageBuildVersionArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) - } - sv.ImageBuildVersionArn = ptr.String(jtv) - } - - case "requestId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.RequestId = ptr.String(jtv) + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err } default: @@ -6744,14 +6914,14 @@ func awsRestjson1_deserializeOpDocumentStartImagePipelineExecutionOutput(v **Sta return nil } -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpPutComponentPolicy struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpPutComponentPolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpPutComponentPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6765,15 +6935,43 @@ func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorPutComponentPolicy(response, &metadata) } - output := &TagResourceOutput{} + output := &PutComponentPolicyOutput{} out.Result = output + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentPutComponentPolicyOutput(&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_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorPutComponentPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6814,8 +7012,20 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("CallRateLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) + + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -6823,6 +7033,9 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -6833,14 +7046,63 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpUntagResource struct { +func awsRestjson1_deserializeOpDocumentPutComponentPolicyOutput(v **PutComponentPolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutComponentPolicyOutput + if *v == nil { + sv = &PutComponentPolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "componentArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentBuildVersionArn to be of type string, got %T instead", value) + } + sv.ComponentArn = ptr.String(jtv) + } + + case "requestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUntagResource) ID() string { +type awsRestjson1_deserializeOpPutContainerRecipePolicy struct { +} + +func (*awsRestjson1_deserializeOpPutContainerRecipePolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpPutContainerRecipePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6854,37 +7116,65 @@ func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorPutContainerRecipePolicy(response, &metadata) } - output := &UntagResourceOutput{} + output := &PutContainerRecipePolicyOutput{} 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 - - code := response.Header.Get("X-Amzn-ErrorType") - if len(code) != 0 { - errorCode = restjson.SanitizeErrorCode(code) - } - var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() - code, message, err := restjson.GetErrorInfo(decoder) - if err != nil { + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentPutContainerRecipePolicyOutput(&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_deserializeOpErrorPutContainerRecipePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -6903,8 +7193,20 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("CallRateLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) + + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -6912,6 +7214,9 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -6922,14 +7227,63 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpUpdateDistributionConfiguration struct { +func awsRestjson1_deserializeOpDocumentPutContainerRecipePolicyOutput(v **PutContainerRecipePolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutContainerRecipePolicyOutput + if *v == nil { + sv = &PutContainerRecipePolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "containerRecipeArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContainerRecipeArn to be of type string, got %T instead", value) + } + sv.ContainerRecipeArn = ptr.String(jtv) + } + + case "requestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateDistributionConfiguration) ID() string { +type awsRestjson1_deserializeOpPutImagePolicy struct { +} + +func (*awsRestjson1_deserializeOpPutImagePolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateDistributionConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpPutImagePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6943,9 +7297,9 @@ func (m *awsRestjson1_deserializeOpUpdateDistributionConfiguration) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateDistributionConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorPutImagePolicy(response, &metadata) } - output := &UpdateDistributionConfigurationOutput{} + output := &PutImagePolicyOutput{} out.Result = output var buff [1024]byte @@ -6966,7 +7320,7 @@ func (m *awsRestjson1_deserializeOpUpdateDistributionConfiguration) HandleDeseri return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateDistributionConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentPutImagePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6979,7 +7333,7 @@ func (m *awsRestjson1_deserializeOpUpdateDistributionConfiguration) HandleDeseri return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateDistributionConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorPutImagePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7029,17 +7383,14 @@ func awsRestjson1_deserializeOpErrorUpdateDistributionConfiguration(response *sm case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - case strings.EqualFold("IdempotentParameterMismatchException", errorCode): - return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) - - case strings.EqualFold("InvalidParameterCombinationException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterCombinationException(response, errorBody) + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -7057,7 +7408,7 @@ func awsRestjson1_deserializeOpErrorUpdateDistributionConfiguration(response *sm } } -func awsRestjson1_deserializeOpDocumentUpdateDistributionConfigurationOutput(v **UpdateDistributionConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentPutImagePolicyOutput(v **PutImagePolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7070,31 +7421,22 @@ func awsRestjson1_deserializeOpDocumentUpdateDistributionConfigurationOutput(v * return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateDistributionConfigurationOutput + var sv *PutImagePolicyOutput if *v == nil { - sv = &UpdateDistributionConfigurationOutput{} + sv = &PutImagePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "clientToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) - } - sv.ClientToken = ptr.String(jtv) - } - - case "distributionConfigurationArn": + case "imageArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DistributionConfigurationArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) } - sv.DistributionConfigurationArn = ptr.String(jtv) + sv.ImageArn = ptr.String(jtv) } case "requestId": @@ -7115,14 +7457,14 @@ func awsRestjson1_deserializeOpDocumentUpdateDistributionConfigurationOutput(v * return nil } -type awsRestjson1_deserializeOpUpdateImagePipeline struct { +type awsRestjson1_deserializeOpPutImageRecipePolicy struct { } -func (*awsRestjson1_deserializeOpUpdateImagePipeline) ID() string { +func (*awsRestjson1_deserializeOpPutImageRecipePolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateImagePipeline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpPutImageRecipePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7136,9 +7478,9 @@ func (m *awsRestjson1_deserializeOpUpdateImagePipeline) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateImagePipeline(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorPutImageRecipePolicy(response, &metadata) } - output := &UpdateImagePipelineOutput{} + output := &PutImageRecipePolicyOutput{} out.Result = output var buff [1024]byte @@ -7159,7 +7501,7 @@ func (m *awsRestjson1_deserializeOpUpdateImagePipeline) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateImagePipelineOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentPutImageRecipePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7172,7 +7514,7 @@ func (m *awsRestjson1_deserializeOpUpdateImagePipeline) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateImagePipeline(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorPutImageRecipePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7222,14 +7564,14 @@ func awsRestjson1_deserializeOpErrorUpdateImagePipeline(response *smithyhttp.Res case strings.EqualFold("ForbiddenException", errorCode): return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - case strings.EqualFold("IdempotentParameterMismatchException", errorCode): - return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -7247,7 +7589,7 @@ func awsRestjson1_deserializeOpErrorUpdateImagePipeline(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentUpdateImagePipelineOutput(v **UpdateImagePipelineOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentPutImageRecipePolicyOutput(v **PutImageRecipePolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7260,31 +7602,22 @@ func awsRestjson1_deserializeOpDocumentUpdateImagePipelineOutput(v **UpdateImage return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateImagePipelineOutput + var sv *PutImageRecipePolicyOutput if *v == nil { - sv = &UpdateImagePipelineOutput{} + sv = &PutImageRecipePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "clientToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) - } - sv.ClientToken = ptr.String(jtv) - } - - case "imagePipelineArn": + case "imageRecipeArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ImagePipelineArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ImageRecipeArn to be of type string, got %T instead", value) } - sv.ImagePipelineArn = ptr.String(jtv) + sv.ImageRecipeArn = ptr.String(jtv) } case "requestId": @@ -7305,14 +7638,14 @@ func awsRestjson1_deserializeOpDocumentUpdateImagePipelineOutput(v **UpdateImage return nil } -type awsRestjson1_deserializeOpUpdateInfrastructureConfiguration struct { +type awsRestjson1_deserializeOpStartImagePipelineExecution struct { } -func (*awsRestjson1_deserializeOpUpdateInfrastructureConfiguration) ID() string { +func (*awsRestjson1_deserializeOpStartImagePipelineExecution) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateInfrastructureConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStartImagePipelineExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7326,9 +7659,9 @@ func (m *awsRestjson1_deserializeOpUpdateInfrastructureConfiguration) HandleDese } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateInfrastructureConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorStartImagePipelineExecution(response, &metadata) } - output := &UpdateInfrastructureConfigurationOutput{} + output := &StartImagePipelineExecutionOutput{} out.Result = output var buff [1024]byte @@ -7349,7 +7682,7 @@ func (m *awsRestjson1_deserializeOpUpdateInfrastructureConfiguration) HandleDese return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateInfrastructureConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentStartImagePipelineExecutionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7362,7 +7695,7 @@ func (m *awsRestjson1_deserializeOpUpdateInfrastructureConfiguration) HandleDese return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateInfrastructureConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorStartImagePipelineExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7421,6 +7754,9 @@ func awsRestjson1_deserializeOpErrorUpdateInfrastructureConfiguration(response * case strings.EqualFold("ResourceInUseException", errorCode): return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceException", errorCode): return awsRestjson1_deserializeErrorServiceException(response, errorBody) @@ -7437,7 +7773,7 @@ func awsRestjson1_deserializeOpErrorUpdateInfrastructureConfiguration(response * } } -func awsRestjson1_deserializeOpDocumentUpdateInfrastructureConfigurationOutput(v **UpdateInfrastructureConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentStartImagePipelineExecutionOutput(v **StartImagePipelineExecutionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7450,9 +7786,9 @@ func awsRestjson1_deserializeOpDocumentUpdateInfrastructureConfigurationOutput(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateInfrastructureConfigurationOutput + var sv *StartImagePipelineExecutionOutput if *v == nil { - sv = &UpdateInfrastructureConfigurationOutput{} + sv = &StartImagePipelineExecutionOutput{} } else { sv = *v } @@ -7468,13 +7804,13 @@ func awsRestjson1_deserializeOpDocumentUpdateInfrastructureConfigurationOutput(v sv.ClientToken = ptr.String(jtv) } - case "infrastructureConfigurationArn": + case "imageBuildVersionArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected InfrastructureConfigurationArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ImageBuildVersionArn to be of type string, got %T instead", value) } - sv.InfrastructureConfigurationArn = ptr.String(jtv) + sv.ImageBuildVersionArn = ptr.String(jtv) } case "requestId": @@ -7495,63 +7831,57 @@ func awsRestjson1_deserializeOpDocumentUpdateInfrastructureConfigurationOutput(v return nil } -func awsRestjson1_deserializeErrorCallRateLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.CallRateLimitExceededException{} - 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 - } +type awsRestjson1_deserializeOpTagResource struct { +} - err := awsRestjson1_deserializeDocumentCallRateLimitExceededException(&output, shape) +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 { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } - return output + 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_deserializeErrorClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ClientException{} +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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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_deserializeDocumentClientException(&output, shape) - + code, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7563,56 +7893,85 @@ func awsRestjson1_deserializeErrorClientException(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } - return output -} + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) -func awsRestjson1_deserializeErrorForbiddenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ForbiddenException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - 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(), + case strings.EqualFold("ServiceException", errorCode): + return awsRestjson1_deserializeErrorServiceException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - err := awsRestjson1_deserializeDocumentForbiddenException(&output, shape) +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 { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } - return output + 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_deserializeErrorIdempotentParameterMismatchException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.IdempotentParameterMismatchException{} +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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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 { + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -7622,29 +7981,65 @@ func awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response return err } - err := awsRestjson1_deserializeDocumentIdempotentParameterMismatchException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceException", errorCode): + return awsRestjson1_deserializeErrorServiceException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) +type awsRestjson1_deserializeOpUpdateDistributionConfiguration struct { +} - return output +func (*awsRestjson1_deserializeOpUpdateDistributionConfiguration) ID() string { + return "OperationDeserializer" } -func awsRestjson1_deserializeErrorInvalidPaginationTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidPaginationTokenException{} +func (m *awsRestjson1_deserializeOpUpdateDistributionConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateDistributionConfiguration(response, &metadata) + } + output := &UpdateDistributionConfigurationOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -7655,47 +8050,44 @@ func awsRestjson1_deserializeErrorInvalidPaginationTokenException(response *smit Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentInvalidPaginationTokenException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentUpdateDistributionConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } - return err } - errorBody.Seek(0, io.SeekStart) - - return output + return out, metadata, err } -func awsRestjson1_deserializeErrorInvalidParameterCombinationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidParameterCombinationException{} +func awsRestjson1_deserializeOpErrorUpdateDistributionConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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_deserializeDocumentInvalidParameterCombinationException(&output, shape) - + code, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7707,160 +8099,140 @@ func awsRestjson1_deserializeErrorInvalidParameterCombinationException(response } errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } - return output -} - -func awsRestjson1_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidParameterException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + switch { + case strings.EqualFold("CallRateLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) - 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 - } + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) - err := awsRestjson1_deserializeDocumentInvalidParameterException(&output, shape) + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } + case strings.EqualFold("IdempotentParameterMismatchException", errorCode): + return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) - errorBody.Seek(0, io.SeekStart) + case strings.EqualFold("InvalidParameterCombinationException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterCombinationException(response, errorBody) - return output -} + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) -func awsRestjson1_deserializeErrorInvalidParameterValueException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidParameterValueException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - 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 - } + case strings.EqualFold("ServiceException", errorCode): + return awsRestjson1_deserializeErrorServiceException(response, errorBody) - err := awsRestjson1_deserializeDocumentInvalidParameterValueException(&output, shape) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err - } - - errorBody.Seek(0, io.SeekStart) + return genericError - return output + } } -func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidRequestException{} - 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 +func awsRestjson1_deserializeOpDocumentUpdateDistributionConfigurationOutput(v **UpdateDistributionConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil } - err := awsRestjson1_deserializeDocumentInvalidRequestException(&output, shape) + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + var sv *UpdateDistributionConfigurationOutput + if *v == nil { + sv = &UpdateDistributionConfigurationOutput{} + } else { + sv = *v } - errorBody.Seek(0, io.SeekStart) + for key, value := range shape { + switch key { + case "clientToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + } + sv.ClientToken = ptr.String(jtv) + } - return output -} + case "distributionConfigurationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DistributionConfigurationArn to be of type string, got %T instead", value) + } + sv.DistributionConfigurationArn = ptr.String(jtv) + } -func awsRestjson1_deserializeErrorInvalidVersionNumberException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidVersionNumberException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case "requestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + default: + _, _ = key, value - 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 } + *v = sv + return nil +} - err := awsRestjson1_deserializeDocumentInvalidVersionNumberException(&output, shape) +type awsRestjson1_deserializeOpUpdateImagePipeline struct { +} + +func (*awsRestjson1_deserializeOpUpdateImagePipeline) ID() string { + return "OperationDeserializer" +} +func (m *awsRestjson1_deserializeOpUpdateImagePipeline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } - return output -} + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateImagePipeline(response, &metadata) + } + output := &UpdateImagePipelineOutput{} + out.Result = 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) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -7871,47 +8243,44 @@ func awsRestjson1_deserializeErrorResourceAlreadyExistsException(response *smith Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentResourceAlreadyExistsException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentUpdateImagePipelineOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } - return err } - errorBody.Seek(0, io.SeekStart) - - return output + return out, metadata, err } -func awsRestjson1_deserializeErrorResourceDependencyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceDependencyException{} +func awsRestjson1_deserializeOpErrorUpdateImagePipeline(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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_deserializeDocumentResourceDependencyException(&output, shape) - + code, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7923,124 +8292,137 @@ func awsRestjson1_deserializeErrorResourceDependencyException(response *smithyht } errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } - return output -} + switch { + case strings.EqualFold("CallRateLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) -func awsRestjson1_deserializeErrorResourceInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceInUseException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) - 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 - } + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) - err := awsRestjson1_deserializeDocumentResourceInUseException(&output, shape) + case strings.EqualFold("IdempotentParameterMismatchException", errorCode): + return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - errorBody.Seek(0, io.SeekStart) + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - return output -} + case strings.EqualFold("ServiceException", errorCode): + return awsRestjson1_deserializeErrorServiceException(response, errorBody) -func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ResourceNotFoundException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - 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(), + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) +func awsRestjson1_deserializeOpDocumentUpdateImagePipelineOutput(v **UpdateImagePipelineOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - errorBody.Seek(0, io.SeekStart) + var sv *UpdateImagePipelineOutput + if *v == nil { + sv = &UpdateImagePipelineOutput{} + } else { + sv = *v + } - return output -} + for key, value := range shape { + switch key { + case "clientToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + } + sv.ClientToken = ptr.String(jtv) + } -func awsRestjson1_deserializeErrorServiceException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ServiceException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case "imagePipelineArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImagePipelineArn to be of type string, got %T instead", value) + } + sv.ImagePipelineArn = ptr.String(jtv) + } + + case "requestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + default: + _, _ = key, value - 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 } + *v = sv + return nil +} - err := awsRestjson1_deserializeDocumentServiceException(&output, shape) +type awsRestjson1_deserializeOpUpdateInfrastructureConfiguration struct { +} + +func (*awsRestjson1_deserializeOpUpdateInfrastructureConfiguration) ID() string { + return "OperationDeserializer" +} +func (m *awsRestjson1_deserializeOpUpdateInfrastructureConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } - return output -} + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateInfrastructureConfiguration(response, &metadata) + } + output := &UpdateInfrastructureConfigurationOutput{} + out.Result = output -func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ServiceQuotaExceededException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -8051,47 +8433,44 @@ func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithy Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) - + err = awsRestjson1_deserializeOpDocumentUpdateInfrastructureConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), Snapshot: snapshot.Bytes(), } - return err } - errorBody.Seek(0, io.SeekStart) - - return output + return out, metadata, err } -func awsRestjson1_deserializeErrorServiceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ServiceUnavailableException{} +func awsRestjson1_deserializeOpErrorUpdateInfrastructureConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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) - + code, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8103,47 +8482,1023 @@ func awsRestjson1_deserializeErrorServiceUnavailableException(response *smithyht } errorBody.Seek(0, io.SeekStart) - - return output -} - -func awsRestjson1_deserializeDocumentAccountList(v *[]string, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) } - if value == nil { - return nil + if len(message) != 0 { + errorMessage = message } - shape, ok := value.([]interface{}) + switch { + case strings.EqualFold("CallRateLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorCallRateLimitExceededException(response, errorBody) + + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("IdempotentParameterMismatchException", errorCode): + return awsRestjson1_deserializeErrorIdempotentParameterMismatchException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + + case strings.EqualFold("ServiceException", errorCode): + return awsRestjson1_deserializeErrorServiceException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateInfrastructureConfigurationOutput(v **UpdateInfrastructureConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateInfrastructureConfigurationOutput + if *v == nil { + sv = &UpdateInfrastructureConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "clientToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ClientToken to be of type string, got %T instead", value) + } + sv.ClientToken = ptr.String(jtv) + } + + case "infrastructureConfigurationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InfrastructureConfigurationArn to be of type string, got %T instead", value) + } + sv.InfrastructureConfigurationArn = ptr.String(jtv) + } + + case "requestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeErrorCallRateLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.CallRateLimitExceededException{} + 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_deserializeDocumentCallRateLimitExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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_deserializeErrorClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ClientException{} + 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_deserializeDocumentClientException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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_deserializeErrorForbiddenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ForbiddenException{} + 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_deserializeDocumentForbiddenException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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_deserializeErrorInvalidPaginationTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidPaginationTokenException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInvalidPaginationTokenException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInvalidParameterCombinationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidParameterCombinationException{} + 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_deserializeDocumentInvalidParameterCombinationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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_deserializeErrorInvalidParameterValueException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidParameterValueException{} + 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_deserializeDocumentInvalidParameterValueException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidRequestException{} + 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_deserializeDocumentInvalidRequestException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInvalidVersionNumberException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidVersionNumberException{} + 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_deserializeDocumentInvalidVersionNumberException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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_deserializeErrorResourceDependencyException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceDependencyException{} + 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_deserializeDocumentResourceDependencyException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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_deserializeErrorResourceInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceInUseException{} + 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_deserializeDocumentResourceInUseException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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_deserializeErrorServiceException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceException{} + 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_deserializeDocumentServiceException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceQuotaExceededException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_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_deserializeDocumentAccountList(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 AccountId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAmi(v **types.Ami, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Ami + if *v == nil { + sv = &types.Ami{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "image": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Image = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "state": + if err := awsRestjson1_deserializeDocumentImageState(&sv.State, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAmiDistributionConfiguration(v **types.AmiDistributionConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AmiDistributionConfiguration + if *v == nil { + sv = &types.AmiDistributionConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "amiTags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.AmiTags, value); err != nil { + return err + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "kmsKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.KmsKeyId = ptr.String(jtv) + } + + case "launchPermission": + if err := awsRestjson1_deserializeDocumentLaunchPermissionConfiguration(&sv.LaunchPermission, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AmiNameString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "targetAccountIds": + if err := awsRestjson1_deserializeDocumentAccountList(&sv.TargetAccountIds, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAmiList(v *[]types.Ami, 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.Ami + if *v == nil { + cv = []types.Ami{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Ami + destAddr := &col + if err := awsRestjson1_deserializeDocumentAmi(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCallRateLimitExceededException(v **types.CallRateLimitExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.CallRateLimitExceededException + if *v == nil { + sv = &types.CallRateLimitExceededException{} + } 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_deserializeDocumentClientException(v **types.ClientException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var sv *types.ClientException if *v == nil { - cv = []string{} + sv = &types.ClientException{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + 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) } - col = jtv - } - cv = append(cv, col) + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentAmi(v **types.Ami, value interface{}) error { +func awsRestjson1_deserializeDocumentComponent(v **types.Component, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8156,22 +9511,49 @@ func awsRestjson1_deserializeDocumentAmi(v **types.Ami, value interface{}) error return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Ami + var sv *types.Component if *v == nil { - sv = &types.Ami{} + sv = &types.Component{} } else { sv = *v } for key, value := range shape { switch key { - case "accountId": + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "changeDescription": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.AccountId = ptr.String(jtv) + sv.ChangeDescription = ptr.String(jtv) + } + + case "data": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentData to be of type string, got %T instead", value) + } + sv.Data = ptr.String(jtv) + } + + case "dateCreated": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + } + sv.DateCreated = ptr.String(jtv) } case "description": @@ -8183,38 +9565,79 @@ func awsRestjson1_deserializeDocumentAmi(v **types.Ami, value interface{}) error sv.Description = ptr.String(jtv) } - case "image": + case "encrypted": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + } + sv.Encrypted = jtv + } + + case "kmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Image = ptr.String(jtv) + sv.KmsKeyId = ptr.String(jtv) } case "name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) } sv.Name = ptr.String(jtv) } - case "region": + case "owner": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Region = ptr.String(jtv) + sv.Owner = ptr.String(jtv) } - case "state": - if err := awsRestjson1_deserializeDocumentImageState(&sv.State, value); err != nil { + case "platform": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Platform to be of type string, got %T instead", value) + } + sv.Platform = types.Platform(jtv) + } + + case "supportedOsVersions": + if err := awsRestjson1_deserializeDocumentOsVersionList(&sv.SupportedOsVersions, value); err != nil { + return err + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentType to be of type string, got %T instead", value) + } + sv.Type = types.ComponentType(jtv) + } + + case "version": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) + } + sv.Version = ptr.String(jtv) + } + default: _, _ = key, value @@ -8224,7 +9647,7 @@ func awsRestjson1_deserializeDocumentAmi(v **types.Ami, value interface{}) error return nil } -func awsRestjson1_deserializeDocumentAmiDistributionConfiguration(v **types.AmiDistributionConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentComponentConfiguration(v **types.ComponentConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8237,55 +9660,22 @@ func awsRestjson1_deserializeDocumentAmiDistributionConfiguration(v **types.AmiD return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AmiDistributionConfiguration + var sv *types.ComponentConfiguration if *v == nil { - sv = &types.AmiDistributionConfiguration{} + sv = &types.ComponentConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "amiTags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.AmiTags, value); err != nil { - return err - } - - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "kmsKeyId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.KmsKeyId = ptr.String(jtv) - } - - case "launchPermission": - if err := awsRestjson1_deserializeDocumentLaunchPermissionConfiguration(&sv.LaunchPermission, value); err != nil { - return err - } - - case "name": + case "componentArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AmiNameString to be of type string, got %T instead", value) + return fmt.Errorf("expected ComponentVersionArnOrBuildVersionArn to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) - } - - case "targetAccountIds": - if err := awsRestjson1_deserializeDocumentAccountList(&sv.TargetAccountIds, value); err != nil { - return err + sv.ComponentArn = ptr.String(jtv) } default: @@ -8297,7 +9687,7 @@ func awsRestjson1_deserializeDocumentAmiDistributionConfiguration(v **types.AmiD return nil } -func awsRestjson1_deserializeDocumentAmiList(v *[]types.Ami, value interface{}) error { +func awsRestjson1_deserializeDocumentComponentConfigurationList(v *[]types.ComponentConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8310,56 +9700,138 @@ func awsRestjson1_deserializeDocumentAmiList(v *[]types.Ami, value interface{}) return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Ami + var cv []types.ComponentConfiguration if *v == nil { - cv = []types.Ami{} + cv = []types.ComponentConfiguration{} } else { cv = *v } for _, value := range shape { - var col types.Ami + var col types.ComponentConfiguration destAddr := &col - if err := awsRestjson1_deserializeDocumentAmi(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentComponentConfiguration(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) - } - *v = cv - return nil -} + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentComponentSummary(v **types.ComponentSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ComponentSummary + if *v == nil { + sv = &types.ComponentSummary{} + } 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 ImageBuilderArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "changeDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ChangeDescription = ptr.String(jtv) + } + + case "dateCreated": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + } + sv.DateCreated = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "owner": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Owner = ptr.String(jtv) + } + + case "platform": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Platform to be of type string, got %T instead", value) + } + sv.Platform = types.Platform(jtv) + } -func awsRestjson1_deserializeDocumentCallRateLimitExceededException(v **types.CallRateLimitExceededException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } + case "supportedOsVersions": + if err := awsRestjson1_deserializeDocumentOsVersionList(&sv.SupportedOsVersions, value); err != nil { + return err + } - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } - var sv *types.CallRateLimitExceededException - if *v == nil { - sv = &types.CallRateLimitExceededException{} - } else { - sv = *v - } + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComponentType to be of type string, got %T instead", value) + } + sv.Type = types.ComponentType(jtv) + } - for key, value := range shape { - switch key { - case "message": + case "version": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Version = ptr.String(jtv) } default: @@ -8371,7 +9843,7 @@ func awsRestjson1_deserializeDocumentCallRateLimitExceededException(v **types.Ca return nil } -func awsRestjson1_deserializeDocumentClientException(v **types.ClientException, value interface{}) error { +func awsRestjson1_deserializeDocumentComponentSummaryList(v *[]types.ComponentSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8379,39 +9851,33 @@ func awsRestjson1_deserializeDocumentClientException(v **types.ClientException, return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ClientException + var cv []types.ComponentSummary if *v == nil { - sv = &types.ClientException{} + cv = []types.ComponentSummary{} } else { - sv = *v + cv = *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 - + for _, value := range shape { + var col types.ComponentSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentComponentSummary(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentComponent(v **types.Component, value interface{}) error { +func awsRestjson1_deserializeDocumentComponentVersion(v **types.ComponentVersion, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8424,9 +9890,9 @@ func awsRestjson1_deserializeDocumentComponent(v **types.Component, value interf return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Component + var sv *types.ComponentVersion if *v == nil { - sv = &types.Component{} + sv = &types.ComponentVersion{} } else { sv = *v } @@ -8442,24 +9908,6 @@ func awsRestjson1_deserializeDocumentComponent(v **types.Component, value interf sv.Arn = ptr.String(jtv) } - case "changeDescription": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.ChangeDescription = ptr.String(jtv) - } - - case "data": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ComponentData to be of type string, got %T instead", value) - } - sv.Data = ptr.String(jtv) - } - case "dateCreated": if value != nil { jtv, ok := value.(string) @@ -8478,24 +9926,6 @@ func awsRestjson1_deserializeDocumentComponent(v **types.Component, value interf sv.Description = ptr.String(jtv) } - case "encrypted": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) - } - sv.Encrypted = jtv - } - - case "kmsKeyId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.KmsKeyId = ptr.String(jtv) - } - case "name": if value != nil { jtv, ok := value.(string) @@ -8528,11 +9958,6 @@ func awsRestjson1_deserializeDocumentComponent(v **types.Component, value interf return err } - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { - return err - } - case "type": if value != nil { jtv, ok := value.(string) @@ -8560,7 +9985,41 @@ func awsRestjson1_deserializeDocumentComponent(v **types.Component, value interf return nil } -func awsRestjson1_deserializeDocumentComponentConfiguration(v **types.ComponentConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentComponentVersionList(v *[]types.ComponentVersion, 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.ComponentVersion + if *v == nil { + cv = []types.ComponentVersion{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ComponentVersion + destAddr := &col + if err := awsRestjson1_deserializeDocumentComponentVersion(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentContainer(v **types.Container, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8573,22 +10032,27 @@ func awsRestjson1_deserializeDocumentComponentConfiguration(v **types.ComponentC return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ComponentConfiguration + var sv *types.Container if *v == nil { - sv = &types.ComponentConfiguration{} + sv = &types.Container{} } else { sv = *v } for key, value := range shape { switch key { - case "componentArn": + case "imageUris": + if err := awsRestjson1_deserializeDocumentStringList(&sv.ImageUris, value); err != nil { + return err + } + + case "region": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ComponentVersionArnOrBuildVersionArn to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.ComponentArn = ptr.String(jtv) + sv.Region = ptr.String(jtv) } default: @@ -8600,7 +10064,57 @@ func awsRestjson1_deserializeDocumentComponentConfiguration(v **types.ComponentC return nil } -func awsRestjson1_deserializeDocumentComponentConfigurationList(v *[]types.ComponentConfiguration, value interface{}) error { +func awsRestjson1_deserializeDocumentContainerDistributionConfiguration(v **types.ContainerDistributionConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ContainerDistributionConfiguration + if *v == nil { + sv = &types.ContainerDistributionConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "containerTags": + if err := awsRestjson1_deserializeDocumentStringList(&sv.ContainerTags, value); err != nil { + return err + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "targetRepository": + if err := awsRestjson1_deserializeDocumentTargetContainerRepository(&sv.TargetRepository, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentContainerList(v *[]types.Container, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8613,17 +10127,17 @@ func awsRestjson1_deserializeDocumentComponentConfigurationList(v *[]types.Compo return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ComponentConfiguration + var cv []types.Container if *v == nil { - cv = []types.ComponentConfiguration{} + cv = []types.Container{} } else { cv = *v } for _, value := range shape { - var col types.ComponentConfiguration + var col types.Container destAddr := &col - if err := awsRestjson1_deserializeDocumentComponentConfiguration(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentContainer(&destAddr, value); err != nil { return err } col = *destAddr @@ -8634,7 +10148,7 @@ func awsRestjson1_deserializeDocumentComponentConfigurationList(v *[]types.Compo return nil } -func awsRestjson1_deserializeDocumentComponentSummary(v **types.ComponentSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentContainerRecipe(v **types.ContainerRecipe, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8647,49 +10161,81 @@ func awsRestjson1_deserializeDocumentComponentSummary(v **types.ComponentSummary return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ComponentSummary + var sv *types.ContainerRecipe if *v == nil { - sv = &types.ComponentSummary{} + sv = &types.ContainerRecipe{} } else { sv = *v } - for key, value := range shape { - switch key { - case "arn": + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "components": + if err := awsRestjson1_deserializeDocumentComponentConfigurationList(&sv.Components, value); err != nil { + return err + } + + case "containerType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContainerType to be of type string, got %T instead", value) + } + sv.ContainerType = types.ContainerType(jtv) + } + + case "dateCreated": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ImageBuilderArn to be of type string, got %T instead", value) + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } - sv.Arn = ptr.String(jtv) + sv.DateCreated = ptr.String(jtv) } - case "changeDescription": + case "description": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.ChangeDescription = ptr.String(jtv) + sv.Description = ptr.String(jtv) } - case "dateCreated": + case "dockerfileTemplateData": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + return fmt.Errorf("expected DockerFileTemplate to be of type string, got %T instead", value) } - sv.DateCreated = ptr.String(jtv) + sv.DockerfileTemplateData = ptr.String(jtv) } - case "description": + case "encrypted": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + } + sv.Encrypted = jtv + } + + case "kmsKeyId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.KmsKeyId = ptr.String(jtv) } case "name": @@ -8710,6 +10256,15 @@ func awsRestjson1_deserializeDocumentComponentSummary(v **types.ComponentSummary sv.Owner = ptr.String(jtv) } + case "parentImage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ParentImage = ptr.String(jtv) + } + case "platform": if value != nil { jtv, ok := value.(string) @@ -8719,32 +10274,32 @@ func awsRestjson1_deserializeDocumentComponentSummary(v **types.ComponentSummary sv.Platform = types.Platform(jtv) } - case "supportedOsVersions": - if err := awsRestjson1_deserializeDocumentOsVersionList(&sv.SupportedOsVersions, value); err != nil { + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err } - case "tags": - if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + case "targetRepository": + if err := awsRestjson1_deserializeDocumentTargetContainerRepository(&sv.TargetRepository, value); err != nil { return err } - case "type": + case "version": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ComponentType to be of type string, got %T instead", value) + return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) } - sv.Type = types.ComponentType(jtv) + sv.Version = ptr.String(jtv) } - case "version": + case "workingDirectory": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Version = ptr.String(jtv) + sv.WorkingDirectory = ptr.String(jtv) } default: @@ -8756,41 +10311,7 @@ func awsRestjson1_deserializeDocumentComponentSummary(v **types.ComponentSummary return nil } -func awsRestjson1_deserializeDocumentComponentSummaryList(v *[]types.ComponentSummary, 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.ComponentSummary - if *v == nil { - cv = []types.ComponentSummary{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ComponentSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentComponentSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsRestjson1_deserializeDocumentComponentVersion(v **types.ComponentVersion, value interface{}) error { +func awsRestjson1_deserializeDocumentContainerRecipeSummary(v **types.ContainerRecipeSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8803,9 +10324,9 @@ func awsRestjson1_deserializeDocumentComponentVersion(v **types.ComponentVersion return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ComponentVersion + var sv *types.ContainerRecipeSummary if *v == nil { - sv = &types.ComponentVersion{} + sv = &types.ContainerRecipeSummary{} } else { sv = *v } @@ -8821,22 +10342,22 @@ func awsRestjson1_deserializeDocumentComponentVersion(v **types.ComponentVersion sv.Arn = ptr.String(jtv) } - case "dateCreated": + case "containerType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) + return fmt.Errorf("expected ContainerType to be of type string, got %T instead", value) } - sv.DateCreated = ptr.String(jtv) + sv.ContainerType = types.ContainerType(jtv) } - case "description": + case "dateCreated": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected DateTime to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.DateCreated = ptr.String(jtv) } case "name": @@ -8857,36 +10378,27 @@ func awsRestjson1_deserializeDocumentComponentVersion(v **types.ComponentVersion sv.Owner = ptr.String(jtv) } - case "platform": + case "parentImage": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Platform to be of type string, got %T instead", value) + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Platform = types.Platform(jtv) - } - - case "supportedOsVersions": - if err := awsRestjson1_deserializeDocumentOsVersionList(&sv.SupportedOsVersions, value); err != nil { - return err + sv.ParentImage = ptr.String(jtv) } - case "type": + case "platform": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ComponentType to be of type string, got %T instead", value) + return fmt.Errorf("expected Platform to be of type string, got %T instead", value) } - sv.Type = types.ComponentType(jtv) + sv.Platform = types.Platform(jtv) } - case "version": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected VersionNumber to be of type string, got %T instead", value) - } - sv.Version = ptr.String(jtv) + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err } default: @@ -8898,7 +10410,7 @@ func awsRestjson1_deserializeDocumentComponentVersion(v **types.ComponentVersion return nil } -func awsRestjson1_deserializeDocumentComponentVersionList(v *[]types.ComponentVersion, value interface{}) error { +func awsRestjson1_deserializeDocumentContainerRecipeSummaryList(v *[]types.ContainerRecipeSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8911,17 +10423,17 @@ func awsRestjson1_deserializeDocumentComponentVersionList(v *[]types.ComponentVe return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ComponentVersion + var cv []types.ContainerRecipeSummary if *v == nil { - cv = []types.ComponentVersion{} + cv = []types.ContainerRecipeSummary{} } else { cv = *v } for _, value := range shape { - var col types.ComponentVersion + var col types.ContainerRecipeSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentComponentVersion(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentContainerRecipeSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -8959,6 +10471,11 @@ func awsRestjson1_deserializeDocumentDistribution(v **types.Distribution, value return err } + case "containerDistributionConfiguration": + if err := awsRestjson1_deserializeDocumentContainerDistributionConfiguration(&sv.ContainerDistributionConfiguration, value); err != nil { + return err + } + case "licenseConfigurationArns": if err := awsRestjson1_deserializeDocumentLicenseConfigurationArnList(&sv.LicenseConfigurationArns, value); err != nil { return err @@ -9148,6 +10665,11 @@ func awsRestjson1_deserializeDocumentDistributionConfigurationSummary(v **types. sv.Name = ptr.String(jtv) } + case "regions": + if err := awsRestjson1_deserializeDocumentRegionList(&sv.Regions, value); err != nil { + return err + } + case "tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err @@ -9443,6 +10965,11 @@ func awsRestjson1_deserializeDocumentImage(v **types.Image, value interface{}) e sv.Arn = ptr.String(jtv) } + case "containerRecipe": + if err := awsRestjson1_deserializeDocumentContainerRecipe(&sv.ContainerRecipe, value); err != nil { + return err + } + case "dateCreated": if value != nil { jtv, ok := value.(string) @@ -9541,6 +11068,15 @@ func awsRestjson1_deserializeDocumentImage(v **types.Image, value interface{}) e return err } + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImageType to be of type string, got %T instead", value) + } + sv.Type = types.ImageType(jtv) + } + case "version": if value != nil { jtv, ok := value.(string) @@ -9590,6 +11126,15 @@ func awsRestjson1_deserializeDocumentImagePipeline(v **types.ImagePipeline, valu sv.Arn = ptr.String(jtv) } + case "containerRecipeArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ContainerRecipeArn = ptr.String(jtv) + } + case "dateCreated": if value != nil { jtv, ok := value.(string) @@ -9856,6 +11401,15 @@ func awsRestjson1_deserializeDocumentImageRecipe(v **types.ImageRecipe, value in return err } + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImageType to be of type string, got %T instead", value) + } + sv.Type = types.ImageType(jtv) + } + case "version": if value != nil { jtv, ok := value.(string) @@ -10147,6 +11701,15 @@ func awsRestjson1_deserializeDocumentImageSummary(v **types.ImageSummary, value return err } + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImageType to be of type string, got %T instead", value) + } + sv.Type = types.ImageType(jtv) + } + case "version": if value != nil { jtv, ok := value.(string) @@ -10328,6 +11891,15 @@ func awsRestjson1_deserializeDocumentImageVersion(v **types.ImageVersion, value sv.Platform = types.Platform(jtv) } + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImageType to be of type string, got %T instead", value) + } + sv.Type = types.ImageType(jtv) + } + case "version": if value != nil { jtv, ok := value.(string) @@ -11195,6 +12767,11 @@ func awsRestjson1_deserializeDocumentOutputResources(v **types.OutputResources, return err } + case "containers": + if err := awsRestjson1_deserializeDocumentContainerList(&sv.Containers, value); err != nil { + return err + } + default: _, _ = key, value @@ -11204,6 +12781,42 @@ func awsRestjson1_deserializeDocumentOutputResources(v **types.OutputResources, return nil } +func awsRestjson1_deserializeDocumentRegionList(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_deserializeDocumentResourceAlreadyExistsException(v **types.ResourceAlreadyExistsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11725,3 +13338,52 @@ func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interfac *v = mv return nil } + +func awsRestjson1_deserializeDocumentTargetContainerRepository(v **types.TargetContainerRepository, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TargetContainerRepository + if *v == nil { + sv = &types.TargetContainerRepository{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "repositoryName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RepositoryName = ptr.String(jtv) + } + + case "service": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ContainerRepositoryService to be of type string, got %T instead", value) + } + sv.Service = types.ContainerRepositoryService(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/imagebuilder/doc.go b/service/imagebuilder/doc.go index e8ccab93d2c..9630f762725 100644 --- a/service/imagebuilder/doc.go +++ b/service/imagebuilder/doc.go @@ -5,6 +5,6 @@ // // EC2 Image Builder is a fully managed AWS service that makes it easier to // automate the creation, management, and deployment of customized, secure, and -// up-to-date “golden” server images that are pre-installed and pre-configured with +// up-to-date "golden" server images that are pre-installed and pre-configured with // software and settings to meet specific IT standards. package imagebuilder diff --git a/service/imagebuilder/serializers.go b/service/imagebuilder/serializers.go index 388c48735ab..c22bc1162a9 100644 --- a/service/imagebuilder/serializers.go +++ b/service/imagebuilder/serializers.go @@ -219,6 +219,155 @@ func awsRestjson1_serializeOpDocumentCreateComponentInput(v *CreateComponentInpu return nil } +type awsRestjson1_serializeOpCreateContainerRecipe struct { +} + +func (*awsRestjson1_serializeOpCreateContainerRecipe) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateContainerRecipe) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateContainerRecipeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/CreateContainerRecipe") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + request.URL.RawQuery = opQuery + } + + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateContainerRecipeInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateContainerRecipeInput(v *CreateContainerRecipeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateContainerRecipeInput(v *CreateContainerRecipeInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Components != nil { + ok := object.Key("components") + if err := awsRestjson1_serializeDocumentComponentConfigurationList(v.Components, ok); err != nil { + return err + } + } + + if len(v.ContainerType) > 0 { + ok := object.Key("containerType") + ok.String(string(v.ContainerType)) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.DockerfileTemplateData != nil { + ok := object.Key("dockerfileTemplateData") + ok.String(*v.DockerfileTemplateData) + } + + if v.DockerfileTemplateUri != nil { + ok := object.Key("dockerfileTemplateUri") + ok.String(*v.DockerfileTemplateUri) + } + + if v.ImageOsVersionOverride != nil { + ok := object.Key("imageOsVersionOverride") + ok.String(*v.ImageOsVersionOverride) + } + + if v.KmsKeyId != nil { + ok := object.Key("kmsKeyId") + ok.String(*v.KmsKeyId) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.ParentImage != nil { + ok := object.Key("parentImage") + ok.String(*v.ParentImage) + } + + if len(v.PlatformOverride) > 0 { + ok := object.Key("platformOverride") + ok.String(string(v.PlatformOverride)) + } + + if v.SemanticVersion != nil { + ok := object.Key("semanticVersion") + ok.String(*v.SemanticVersion) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + if v.TargetRepository != nil { + ok := object.Key("targetRepository") + if err := awsRestjson1_serializeDocumentTargetContainerRepository(v.TargetRepository, ok); err != nil { + return err + } + } + + if v.WorkingDirectory != nil { + ok := object.Key("workingDirectory") + ok.String(*v.WorkingDirectory) + } + + return nil +} + type awsRestjson1_serializeOpCreateDistributionConfiguration struct { } @@ -386,6 +535,11 @@ func awsRestjson1_serializeOpDocumentCreateImageInput(v *CreateImageInput, value ok.String(*v.ClientToken) } + if v.ContainerRecipeArn != nil { + ok := object.Key("containerRecipeArn") + ok.String(*v.ContainerRecipeArn) + } + if v.DistributionConfigurationArn != nil { ok := object.Key("distributionConfigurationArn") ok.String(*v.DistributionConfigurationArn) @@ -493,6 +647,11 @@ func awsRestjson1_serializeOpDocumentCreateImagePipelineInput(v *CreateImagePipe ok.String(*v.ClientToken) } + if v.ContainerRecipeArn != nil { + ok := object.Key("containerRecipeArn") + ok.String(*v.ContainerRecipeArn) + } + if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) @@ -872,6 +1031,64 @@ func awsRestjson1_serializeOpHttpBindingsDeleteComponentInput(v *DeleteComponent return nil } +type awsRestjson1_serializeOpDeleteContainerRecipe struct { +} + +func (*awsRestjson1_serializeOpDeleteContainerRecipe) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteContainerRecipe) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteContainerRecipeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/DeleteContainerRecipe") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteContainerRecipeInput(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_serializeOpHttpBindingsDeleteContainerRecipeInput(v *DeleteContainerRecipeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ContainerRecipeArn != nil { + encoder.SetQuery("containerRecipeArn").String(*v.ContainerRecipeArn) + } + + return nil +} + type awsRestjson1_serializeOpDeleteDistributionConfiguration struct { } @@ -1278,6 +1495,122 @@ func awsRestjson1_serializeOpHttpBindingsGetComponentPolicyInput(v *GetComponent return nil } +type awsRestjson1_serializeOpGetContainerRecipe struct { +} + +func (*awsRestjson1_serializeOpGetContainerRecipe) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetContainerRecipe) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetContainerRecipeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/GetContainerRecipe") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetContainerRecipeInput(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_serializeOpHttpBindingsGetContainerRecipeInput(v *GetContainerRecipeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ContainerRecipeArn != nil { + encoder.SetQuery("containerRecipeArn").String(*v.ContainerRecipeArn) + } + + return nil +} + +type awsRestjson1_serializeOpGetContainerRecipePolicy struct { +} + +func (*awsRestjson1_serializeOpGetContainerRecipePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetContainerRecipePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetContainerRecipePolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/GetContainerRecipePolicy") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetContainerRecipePolicyInput(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_serializeOpHttpBindingsGetContainerRecipePolicyInput(v *GetContainerRecipePolicyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ContainerRecipeArn != nil { + encoder.SetQuery("containerRecipeArn").String(*v.ContainerRecipeArn) + } + + return nil +} + type awsRestjson1_serializeOpGetDistributionConfiguration struct { } @@ -1962,6 +2295,101 @@ func awsRestjson1_serializeOpDocumentListComponentsInput(v *ListComponentsInput, object := value.Object() defer object.Close() + if v.ByName { + ok := object.Key("byName") + ok.Boolean(v.ByName) + } + + if v.Filters != nil { + ok := object.Key("filters") + if err := awsRestjson1_serializeDocumentFilterList(v.Filters, ok); err != nil { + return err + } + } + + if v.MaxResults != 0 { + ok := object.Key("maxResults") + ok.Integer(v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if len(v.Owner) > 0 { + ok := object.Key("owner") + ok.String(string(v.Owner)) + } + + return nil +} + +type awsRestjson1_serializeOpListContainerRecipes struct { +} + +func (*awsRestjson1_serializeOpListContainerRecipes) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListContainerRecipes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListContainerRecipesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/ListContainerRecipes") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpDocumentListContainerRecipesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListContainerRecipesInput(v *ListContainerRecipesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListContainerRecipesInput(v *ListContainerRecipesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + if v.Filters != nil { ok := object.Key("filters") if err := awsRestjson1_serializeDocumentFilterList(v.Filters, ok); err != nil { @@ -2492,6 +2920,11 @@ func awsRestjson1_serializeOpDocumentListImagesInput(v *ListImagesInput, value s object := value.Object() defer object.Close() + if v.ByName { + ok := object.Key("byName") + ok.Boolean(v.ByName) + } + if v.Filters != nil { ok := object.Key("filters") if err := awsRestjson1_serializeDocumentFilterList(v.Filters, ok); err != nil { @@ -2499,6 +2932,11 @@ func awsRestjson1_serializeOpDocumentListImagesInput(v *ListImagesInput, value s } } + if v.IncludeDeprecated { + ok := object.Key("includeDeprecated") + ok.Boolean(v.IncludeDeprecated) + } + if v.MaxResults != 0 { ok := object.Key("maxResults") ok.Integer(v.MaxResults) @@ -2743,6 +3181,84 @@ func awsRestjson1_serializeOpDocumentPutComponentPolicyInput(v *PutComponentPoli return nil } +type awsRestjson1_serializeOpPutContainerRecipePolicy struct { +} + +func (*awsRestjson1_serializeOpPutContainerRecipePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutContainerRecipePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutContainerRecipePolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/PutContainerRecipePolicy") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + request.URL.RawQuery = opQuery + } + + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutContainerRecipePolicyInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsPutContainerRecipePolicyInput(v *PutContainerRecipePolicyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutContainerRecipePolicyInput(v *PutContainerRecipePolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ContainerRecipeArn != nil { + ok := object.Key("containerRecipeArn") + ok.String(*v.ContainerRecipeArn) + } + + if v.Policy != nil { + ok := object.Key("policy") + ok.String(*v.Policy) + } + + return nil +} + type awsRestjson1_serializeOpPutImagePolicy struct { } @@ -3294,6 +3810,11 @@ func awsRestjson1_serializeOpDocumentUpdateImagePipelineInput(v *UpdateImagePipe ok.String(*v.ClientToken) } + if v.ContainerRecipeArn != nil { + ok := object.Key("containerRecipeArn") + ok.String(*v.ContainerRecipeArn) + } + if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) @@ -3561,6 +4082,32 @@ func awsRestjson1_serializeDocumentComponentConfigurationList(v []types.Componen return nil } +func awsRestjson1_serializeDocumentContainerDistributionConfiguration(v *types.ContainerDistributionConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ContainerTags != nil { + ok := object.Key("containerTags") + if err := awsRestjson1_serializeDocumentStringList(v.ContainerTags, ok); err != nil { + return err + } + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.TargetRepository != nil { + ok := object.Key("targetRepository") + if err := awsRestjson1_serializeDocumentTargetContainerRepository(v.TargetRepository, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentDistribution(v *types.Distribution, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3572,6 +4119,13 @@ func awsRestjson1_serializeDocumentDistribution(v *types.Distribution, value smi } } + if v.ContainerDistributionConfiguration != nil { + ok := object.Key("containerDistributionConfiguration") + if err := awsRestjson1_serializeDocumentContainerDistributionConfiguration(v.ContainerDistributionConfiguration, ok); err != nil { + return err + } + } + if v.LicenseConfigurationArns != nil { ok := object.Key("licenseConfigurationArns") if err := awsRestjson1_serializeDocumentLicenseConfigurationArnList(v.LicenseConfigurationArns, ok); err != nil { @@ -3889,3 +4443,20 @@ func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson. } return nil } + +func awsRestjson1_serializeDocumentTargetContainerRepository(v *types.TargetContainerRepository, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RepositoryName != nil { + ok := object.Key("repositoryName") + ok.String(*v.RepositoryName) + } + + if len(v.Service) > 0 { + ok := object.Key("service") + ok.String(string(v.Service)) + } + + return nil +} diff --git a/service/imagebuilder/types/enums.go b/service/imagebuilder/types/enums.go index 9fd4463b1fa..650cc02cdff 100644 --- a/service/imagebuilder/types/enums.go +++ b/service/imagebuilder/types/enums.go @@ -36,6 +36,38 @@ func (ComponentType) Values() []ComponentType { } } +type ContainerRepositoryService string + +// Enum values for ContainerRepositoryService +const ( + ContainerRepositoryServiceEcr ContainerRepositoryService = "ECR" +) + +// Values returns all known values for ContainerRepositoryService. 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 (ContainerRepositoryService) Values() []ContainerRepositoryService { + return []ContainerRepositoryService{ + "ECR", + } +} + +type ContainerType string + +// Enum values for ContainerType +const ( + ContainerTypeDocker ContainerType = "DOCKER" +) + +// Values returns all known values for ContainerType. 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 (ContainerType) Values() []ContainerType { + return []ContainerType{ + "DOCKER", + } +} + type EbsVolumeType string // Enum values for EbsVolumeType @@ -98,6 +130,24 @@ func (ImageStatus) Values() []ImageStatus { } } +type ImageType string + +// Enum values for ImageType +const ( + ImageTypeAmi ImageType = "AMI" + ImageTypeDocker ImageType = "DOCKER" +) + +// Values returns all known values for ImageType. 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 (ImageType) Values() []ImageType { + return []ImageType{ + "AMI", + "DOCKER", + } +} + type Ownership string // Enum values for Ownership diff --git a/service/imagebuilder/types/types.go b/service/imagebuilder/types/types.go index 3f4009556a3..38c7b018d5b 100644 --- a/service/imagebuilder/types/types.go +++ b/service/imagebuilder/types/types.go @@ -180,6 +180,117 @@ type ComponentVersion struct { Version *string } +// A container encapsulates the runtime environment for an application. +type Container struct { + + // A list of URIs for containers created in the context Region. + ImageUris []string + + // Containers and container images are Region-specific. This is the Region context + // for the container. + Region *string +} + +// Container distribution settings for encryption, licensing, and sharing in a +// specific Region. +type ContainerDistributionConfiguration struct { + + // The destination repository for the container distribution configuration. + // + // This member is required. + TargetRepository *TargetContainerRepository + + // Tags that are attached to the container distribution configuration. + ContainerTags []string + + // The description of the container distribution configuration. + Description *string +} + +// A container recipe. +type ContainerRecipe struct { + + // The Amazon Resource Name (ARN) of the container recipe. + Arn *string + + // Components for build and test that are included in the container recipe. + Components []ComponentConfiguration + + // Specifies the type of container, such as Docker. + ContainerType ContainerType + + // The date when this container recipe was created. + DateCreated *string + + // The description of the container recipe. + Description *string + + // Dockerfiles are text documents that are used to build Docker containers, and + // ensure that they contain all of the elements required by the application running + // inside. The template data consists of contextual variables where Image Builder + // places build information or scripts, based on your container image recipe. + DockerfileTemplateData *string + + // A flag that indicates if the target container is encrypted. + Encrypted bool + + // Identifies which KMS key is used to encrypt the container image for distribution + // to the target Region. + KmsKeyId *string + + // The name of the container recipe. + Name *string + + // The owner of the container recipe. + Owner *string + + // The source image for the container recipe. + ParentImage *string + + // The system platform for the container, such as Windows or Linux. + Platform Platform + + // Tags that are attached to the container recipe. + Tags map[string]string + + // The destination repository for the container image. + TargetRepository *TargetContainerRepository + + // The semantic version of the container recipe (..). + Version *string + + // The working directory for use during build and test workflows. + WorkingDirectory *string +} + +// A summary of a container recipe +type ContainerRecipeSummary struct { + + // The Amazon Resource Name (ARN) of the container recipe. + Arn *string + + // Specifies the type of container, such as "Docker". + ContainerType ContainerType + + // The date when this container recipe was created. + DateCreated *string + + // The name of the container recipe. + Name *string + + // The owner of the container recipe. + Owner *string + + // The source image for the container recipe. + ParentImage *string + + // The system platform for the container, such as Windows or Linux. + Platform Platform + + // Tags that are attached to the container recipe. + Tags map[string]string +} + // Defines the settings for a specific Region. type Distribution struct { @@ -191,6 +302,10 @@ type Distribution struct { // The specific AMI settings (for example, launch permissions, AMI tags). AmiDistributionConfiguration *AmiDistributionConfiguration + // Container distribution settings for encryption, licensing, and sharing in a + // specific Region. + ContainerDistributionConfiguration *ContainerDistributionConfiguration + // The License Manager Configuration to associate with the AMI in the specified // Region. LicenseConfigurationArns []string @@ -244,6 +359,9 @@ type DistributionConfigurationSummary struct { // The name of the distribution configuration. Name *string + // A list of Regions where the container image is distributed to. + Regions []string + // The tags associated with the distribution configuration. Tags map[string]string } @@ -291,6 +409,9 @@ type Image struct { // The Amazon Resource Name (ARN) of the image. Arn *string + // The container recipe used to create the container image type. + ContainerRecipe *ContainerRecipe + // The date on which this image was created. DateCreated *string @@ -336,6 +457,9 @@ type Image struct { // The tags of the image. Tags map[string]string + // Specifies whether this is an AMI or container image. + Type ImageType + // The semantic version of the image. Version *string } @@ -346,6 +470,10 @@ type ImagePipeline struct { // The Amazon Resource Name (ARN) of the image pipeline. Arn *string + // The Amazon Resource Name (ARN) of the container recipe that is used for this + // pipeline. + ContainerRecipeArn *string + // The date on which this image pipeline was created. DateCreated *string @@ -430,6 +558,10 @@ type ImageRecipe struct { // The tags of the image recipe. Tags map[string]string + // Specifies which type of image is created by the recipe - an AMI or a container + // image. + Type ImageType + // The version of the image recipe. Version *string @@ -503,6 +635,9 @@ type ImageSummary struct { // The tags of the image. Tags map[string]string + // Specifies whether this is an AMI or container image. + Type ImageType + // The version of the image. Version *string } @@ -539,6 +674,9 @@ type ImageVersion struct { // The platform of the image semantic version. Platform Platform + // Specifies whether this is an AMI or container image. + Type ImageType + // The semantic version of the image semantic version. Version *string } @@ -662,6 +800,10 @@ type OutputResources struct { // The EC2 AMIs created by this image. Amis []Ami + + // Container images that the pipeline has generated and stored in the output + // repository. + Containers []Container } // Amazon S3 logging configuration. @@ -697,3 +839,18 @@ type Schedule struct { // (https://docs.aws.amazon.com/imagebuilder/latest/userguide/image-builder-cron.html). ScheduleExpression *string } + +// The container repository where the output container image is stored. +type TargetContainerRepository struct { + + // The name of the container repository where the output container image is stored. + // This name is prefixed by the repository location. + // + // This member is required. + RepositoryName *string + + // Specifies the service in which this image was registered. + // + // This member is required. + Service ContainerRepositoryService +} diff --git a/service/imagebuilder/validators.go b/service/imagebuilder/validators.go index 174f5969ceb..746befc2aed 100644 --- a/service/imagebuilder/validators.go +++ b/service/imagebuilder/validators.go @@ -50,6 +50,26 @@ func (m *validateOpCreateComponent) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpCreateContainerRecipe struct { +} + +func (*validateOpCreateContainerRecipe) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateContainerRecipe) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateContainerRecipeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateContainerRecipeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateDistributionConfiguration struct { } @@ -170,6 +190,26 @@ func (m *validateOpDeleteComponent) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpDeleteContainerRecipe struct { +} + +func (*validateOpDeleteContainerRecipe) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteContainerRecipe) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteContainerRecipeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteContainerRecipeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteDistributionConfiguration struct { } @@ -310,6 +350,46 @@ func (m *validateOpGetComponentPolicy) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpGetContainerRecipe struct { +} + +func (*validateOpGetContainerRecipe) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetContainerRecipe) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetContainerRecipeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetContainerRecipeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetContainerRecipePolicy struct { +} + +func (*validateOpGetContainerRecipePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetContainerRecipePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetContainerRecipePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetContainerRecipePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetDistributionConfiguration struct { } @@ -570,6 +650,26 @@ func (m *validateOpPutComponentPolicy) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpPutContainerRecipePolicy struct { +} + +func (*validateOpPutContainerRecipePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutContainerRecipePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutContainerRecipePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutContainerRecipePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpPutImagePolicy struct { } @@ -738,6 +838,10 @@ func addOpCreateComponentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateComponent{}, middleware.After) } +func addOpCreateContainerRecipeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateContainerRecipe{}, middleware.After) +} + func addOpCreateDistributionConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateDistributionConfiguration{}, middleware.After) } @@ -762,6 +866,10 @@ func addOpDeleteComponentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteComponent{}, middleware.After) } +func addOpDeleteContainerRecipeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteContainerRecipe{}, middleware.After) +} + func addOpDeleteDistributionConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteDistributionConfiguration{}, middleware.After) } @@ -790,6 +898,14 @@ func addOpGetComponentPolicyValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpGetComponentPolicy{}, middleware.After) } +func addOpGetContainerRecipeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetContainerRecipe{}, middleware.After) +} + +func addOpGetContainerRecipePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetContainerRecipePolicy{}, middleware.After) +} + func addOpGetDistributionConfigurationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDistributionConfiguration{}, middleware.After) } @@ -842,6 +958,10 @@ func addOpPutComponentPolicyValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpPutComponentPolicy{}, middleware.After) } +func addOpPutContainerRecipePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutContainerRecipePolicy{}, middleware.After) +} + func addOpPutImagePolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutImagePolicy{}, middleware.After) } @@ -906,6 +1026,25 @@ func validateComponentConfigurationList(v []types.ComponentConfiguration) error } } +func validateContainerDistributionConfiguration(v *types.ContainerDistributionConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ContainerDistributionConfiguration"} + if v.TargetRepository == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetRepository")) + } else if v.TargetRepository != nil { + if err := validateTargetContainerRepository(v.TargetRepository); err != nil { + invalidParams.AddNested("TargetRepository", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateDistribution(v *types.Distribution) error { if v == nil { return nil @@ -914,6 +1053,11 @@ func validateDistribution(v *types.Distribution) error { if v.Region == nil { invalidParams.Add(smithy.NewErrParamRequired("Region")) } + if v.ContainerDistributionConfiguration != nil { + if err := validateContainerDistributionConfiguration(v.ContainerDistributionConfiguration); err != nil { + invalidParams.AddNested("ContainerDistributionConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -938,6 +1082,24 @@ func validateDistributionList(v []types.Distribution) error { } } +func validateTargetContainerRepository(v *types.TargetContainerRepository) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TargetContainerRepository"} + if len(v.Service) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Service")) + } + if v.RepositoryName == nil { + invalidParams.Add(smithy.NewErrParamRequired("RepositoryName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCancelImageCreationInput(v *CancelImageCreationInput) error { if v == nil { return nil @@ -980,6 +1142,50 @@ func validateOpCreateComponentInput(v *CreateComponentInput) error { } } +func validateOpCreateContainerRecipeInput(v *CreateContainerRecipeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateContainerRecipeInput"} + if len(v.ContainerType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ContainerType")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.SemanticVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("SemanticVersion")) + } + if v.Components == nil { + invalidParams.Add(smithy.NewErrParamRequired("Components")) + } else if v.Components != nil { + if err := validateComponentConfigurationList(v.Components); err != nil { + invalidParams.AddNested("Components", err.(smithy.InvalidParamsError)) + } + } + if v.DockerfileTemplateData == nil { + invalidParams.Add(smithy.NewErrParamRequired("DockerfileTemplateData")) + } + if v.ParentImage == nil { + invalidParams.Add(smithy.NewErrParamRequired("ParentImage")) + } + if v.TargetRepository == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetRepository")) + } else if v.TargetRepository != nil { + if err := validateTargetContainerRepository(v.TargetRepository); err != nil { + invalidParams.AddNested("TargetRepository", err.(smithy.InvalidParamsError)) + } + } + if v.ClientToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateDistributionConfigurationInput(v *CreateDistributionConfigurationInput) error { if v == nil { return nil @@ -1010,9 +1216,6 @@ func validateOpCreateImageInput(v *CreateImageInput) error { return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateImageInput"} - if v.ImageRecipeArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImageRecipeArn")) - } if v.InfrastructureConfigurationArn == nil { invalidParams.Add(smithy.NewErrParamRequired("InfrastructureConfigurationArn")) } @@ -1034,9 +1237,6 @@ func validateOpCreateImagePipelineInput(v *CreateImagePipelineInput) error { if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } - if v.ImageRecipeArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImageRecipeArn")) - } if v.InfrastructureConfigurationArn == nil { invalidParams.Add(smithy.NewErrParamRequired("InfrastructureConfigurationArn")) } @@ -1117,6 +1317,21 @@ func validateOpDeleteComponentInput(v *DeleteComponentInput) error { } } +func validateOpDeleteContainerRecipeInput(v *DeleteContainerRecipeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteContainerRecipeInput"} + if v.ContainerRecipeArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ContainerRecipeArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteDistributionConfigurationInput(v *DeleteDistributionConfigurationInput) error { if v == nil { return nil @@ -1222,6 +1437,36 @@ func validateOpGetComponentPolicyInput(v *GetComponentPolicyInput) error { } } +func validateOpGetContainerRecipeInput(v *GetContainerRecipeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetContainerRecipeInput"} + if v.ContainerRecipeArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ContainerRecipeArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetContainerRecipePolicyInput(v *GetContainerRecipePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetContainerRecipePolicyInput"} + if v.ContainerRecipeArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ContainerRecipeArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetDistributionConfigurationInput(v *GetDistributionConfigurationInput) error { if v == nil { return nil @@ -1435,6 +1680,24 @@ func validateOpPutComponentPolicyInput(v *PutComponentPolicyInput) error { } } +func validateOpPutContainerRecipePolicyInput(v *PutContainerRecipePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutContainerRecipePolicyInput"} + if v.ContainerRecipeArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ContainerRecipeArn")) + } + if v.Policy == nil { + invalidParams.Add(smithy.NewErrParamRequired("Policy")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpPutImagePolicyInput(v *PutImagePolicyInput) error { if v == nil { return nil @@ -1558,9 +1821,6 @@ func validateOpUpdateImagePipelineInput(v *UpdateImagePipelineInput) error { if v.ImagePipelineArn == nil { invalidParams.Add(smithy.NewErrParamRequired("ImagePipelineArn")) } - if v.ImageRecipeArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ImageRecipeArn")) - } if v.InfrastructureConfigurationArn == nil { invalidParams.Add(smithy.NewErrParamRequired("InfrastructureConfigurationArn")) } diff --git a/service/iotanalytics/api_op_CreateDatastore.go b/service/iotanalytics/api_op_CreateDatastore.go index 67ccd026bc1..4f453fa659e 100644 --- a/service/iotanalytics/api_op_CreateDatastore.go +++ b/service/iotanalytics/api_op_CreateDatastore.go @@ -39,6 +39,12 @@ type CreateDatastoreInput struct { // You cannot change this storage option after the data store is created. DatastoreStorage types.DatastoreStorage + // Contains the configuration information of file formats. AWS IoT Analytics data + // stores support JSON and Parquet (https://parquet.apache.org/). The default file + // format is JSON. You can specify only one format. You can't change the file + // format after you create the data store. + FileFormatConfiguration *types.FileFormatConfiguration + // How long, in days, message data is kept for the data store. When // customerManagedS3 storage is selected, this parameter is ignored. RetentionPeriod *types.RetentionPeriod diff --git a/service/iotanalytics/api_op_StartPipelineReprocessing.go b/service/iotanalytics/api_op_StartPipelineReprocessing.go index e5ab276ca4c..9abe2837e4a 100644 --- a/service/iotanalytics/api_op_StartPipelineReprocessing.go +++ b/service/iotanalytics/api_op_StartPipelineReprocessing.go @@ -6,6 +6,7 @@ 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/iotanalytics/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" @@ -34,10 +35,18 @@ type StartPipelineReprocessingInput struct { // This member is required. PipelineName *string - // The end time (exclusive) of raw message data that is reprocessed. + // Specifies one or more sets of channel messages that you want to reprocess. If + // you use the channelMessages object, you must not specify a value for startTime + // and endTime. + ChannelMessages *types.ChannelMessages + + // The end time (exclusive) of raw message data that is reprocessed. If you specify + // a value for the endTime parameter, you must not use the channelMessages object. EndTime *time.Time - // The start time (inclusive) of raw message data that is reprocessed. + // The start time (inclusive) of raw message data that is reprocessed. If you + // specify a value for the startTime parameter, you must not use the + // channelMessages object. StartTime *time.Time } diff --git a/service/iotanalytics/api_op_UpdateDatastore.go b/service/iotanalytics/api_op_UpdateDatastore.go index 910cc6f2e74..cf9c3bdd219 100644 --- a/service/iotanalytics/api_op_UpdateDatastore.go +++ b/service/iotanalytics/api_op_UpdateDatastore.go @@ -39,6 +39,12 @@ type UpdateDatastoreInput struct { // cannot change this storage option after the data store is created. DatastoreStorage types.DatastoreStorage + // Contains the configuration information of file formats. AWS IoT Analytics data + // stores support JSON and Parquet (https://parquet.apache.org/). The default file + // format is JSON. You can specify only one format. You can't change the file + // format after you create the data store. + FileFormatConfiguration *types.FileFormatConfiguration + // How long, in days, message data is kept for the data store. The retention period // cannot be updated if the data store's S3 storage is customer-managed. RetentionPeriod *types.RetentionPeriod diff --git a/service/iotanalytics/deserializers.go b/service/iotanalytics/deserializers.go index 5efb2b1f887..72d19a0ef24 100644 --- a/service/iotanalytics/deserializers.go +++ b/service/iotanalytics/deserializers.go @@ -5640,6 +5640,89 @@ func awsRestjson1_deserializeDocumentChannelSummary(v **types.ChannelSummary, va return nil } +func awsRestjson1_deserializeDocumentColumn(v **types.Column, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Column + if *v == nil { + sv = &types.Column{} + } 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 ColumnName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ColumnDataType to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentColumns(v *[]types.Column, 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.Column + if *v == nil { + cv = []types.Column{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Column + destAddr := &col + if err := awsRestjson1_deserializeDocumentColumn(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentContainerDatasetAction(v **types.ContainerDatasetAction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6860,6 +6943,11 @@ func awsRestjson1_deserializeDocumentDatastore(v **types.Datastore, value interf sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) } + case "fileFormatConfiguration": + if err := awsRestjson1_deserializeDocumentFileFormatConfiguration(&sv.FileFormatConfiguration, value); err != nil { + return err + } + case "lastMessageArrivalTime": if value != nil { jtv, ok := value.(json.Number) @@ -7179,6 +7267,15 @@ func awsRestjson1_deserializeDocumentDatastoreSummary(v **types.DatastoreSummary return err } + case "fileFormatType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FileFormatType to be of type string, got %T instead", value) + } + sv.FileFormatType = types.FileFormatType(jtv) + } + case "lastMessageArrivalTime": if value != nil { jtv, ok := value.(json.Number) @@ -7529,6 +7626,47 @@ func awsRestjson1_deserializeDocumentEstimatedResourceSize(v **types.EstimatedRe return nil } +func awsRestjson1_deserializeDocumentFileFormatConfiguration(v **types.FileFormatConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FileFormatConfiguration + if *v == nil { + sv = &types.FileFormatConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "jsonConfiguration": + if err := awsRestjson1_deserializeDocumentJsonConfiguration(&sv.JsonConfiguration, value); err != nil { + return err + } + + case "parquetConfiguration": + if err := awsRestjson1_deserializeDocumentParquetConfiguration(&sv.ParquetConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentFilterActivity(v **types.FilterActivity, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -7765,6 +7903,37 @@ func awsRestjson1_deserializeDocumentIotEventsDestinationConfiguration(v **types return nil } +func awsRestjson1_deserializeDocumentJsonConfiguration(v **types.JsonConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.JsonConfiguration + if *v == nil { + sv = &types.JsonConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentLambdaActivity(v **types.LambdaActivity, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8196,6 +8365,42 @@ func awsRestjson1_deserializeDocumentOutputFileUriValue(v **types.OutputFileUriV return nil } +func awsRestjson1_deserializeDocumentParquetConfiguration(v **types.ParquetConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ParquetConfiguration + if *v == nil { + sv = &types.ParquetConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "schemaDefinition": + if err := awsRestjson1_deserializeDocumentSchemaDefinition(&sv.SchemaDefinition, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentPipeline(v **types.Pipeline, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9028,6 +9233,42 @@ func awsRestjson1_deserializeDocumentSchedule(v **types.Schedule, value interfac return nil } +func awsRestjson1_deserializeDocumentSchemaDefinition(v **types.SchemaDefinition, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SchemaDefinition + if *v == nil { + sv = &types.SchemaDefinition{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "columns": + if err := awsRestjson1_deserializeDocumentColumns(&sv.Columns, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentSelectAttributesActivity(v **types.SelectAttributesActivity, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/iotanalytics/serializers.go b/service/iotanalytics/serializers.go index 033c1001e60..fd02c4bae86 100644 --- a/service/iotanalytics/serializers.go +++ b/service/iotanalytics/serializers.go @@ -546,6 +546,13 @@ func awsRestjson1_serializeOpDocumentCreateDatastoreInput(v *CreateDatastoreInpu } } + if v.FileFormatConfiguration != nil { + ok := object.Key("fileFormatConfiguration") + if err := awsRestjson1_serializeDocumentFileFormatConfiguration(v.FileFormatConfiguration, ok); err != nil { + return err + } + } + if v.RetentionPeriod != nil { ok := object.Key("retentionPeriod") if err := awsRestjson1_serializeDocumentRetentionPeriod(v.RetentionPeriod, ok); err != nil { @@ -2041,6 +2048,13 @@ func awsRestjson1_serializeOpDocumentStartPipelineReprocessingInput(v *StartPipe object := value.Object() defer object.Close() + if v.ChannelMessages != nil { + ok := object.Key("channelMessages") + if err := awsRestjson1_serializeDocumentChannelMessages(v.ChannelMessages, ok); err != nil { + return err + } + } + if v.EndTime != nil { ok := object.Key("endTime") ok.Double(smithytime.FormatEpochSeconds(*v.EndTime)) @@ -2504,6 +2518,13 @@ func awsRestjson1_serializeOpDocumentUpdateDatastoreInput(v *UpdateDatastoreInpu } } + if v.FileFormatConfiguration != nil { + ok := object.Key("fileFormatConfiguration") + if err := awsRestjson1_serializeDocumentFileFormatConfiguration(v.FileFormatConfiguration, ok); err != nil { + return err + } + } + if v.RetentionPeriod != nil { ok := object.Key("retentionPeriod") if err := awsRestjson1_serializeDocumentRetentionPeriod(v.RetentionPeriod, ok); err != nil { @@ -2670,6 +2691,20 @@ func awsRestjson1_serializeDocumentChannelActivity(v *types.ChannelActivity, val return nil } +func awsRestjson1_serializeDocumentChannelMessages(v *types.ChannelMessages, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.S3Paths != nil { + ok := object.Key("s3Paths") + if err := awsRestjson1_serializeDocumentS3PathChannelMessages(v.S3Paths, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentChannelStorage(v *types.ChannelStorage, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2691,6 +2726,36 @@ func awsRestjson1_serializeDocumentChannelStorage(v *types.ChannelStorage, value return nil } +func awsRestjson1_serializeDocumentColumn(v *types.Column, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Type != nil { + ok := object.Key("type") + ok.String(*v.Type) + } + + return nil +} + +func awsRestjson1_serializeDocumentColumns(v []types.Column, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentColumn(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentContainerDatasetAction(v *types.ContainerDatasetAction, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3038,6 +3103,27 @@ func awsRestjson1_serializeDocumentDeviceShadowEnrichActivity(v *types.DeviceSha return nil } +func awsRestjson1_serializeDocumentFileFormatConfiguration(v *types.FileFormatConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.JsonConfiguration != nil { + ok := object.Key("jsonConfiguration") + if err := awsRestjson1_serializeDocumentJsonConfiguration(v.JsonConfiguration, ok); err != nil { + return err + } + } + + if v.ParquetConfiguration != nil { + ok := object.Key("parquetConfiguration") + if err := awsRestjson1_serializeDocumentParquetConfiguration(v.ParquetConfiguration, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentFilterActivity(v *types.FilterActivity, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3094,6 +3180,13 @@ func awsRestjson1_serializeDocumentIotEventsDestinationConfiguration(v *types.Io return nil } +func awsRestjson1_serializeDocumentJsonConfiguration(v *types.JsonConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + return nil +} + func awsRestjson1_serializeDocumentLambdaActivity(v *types.LambdaActivity, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3272,6 +3365,20 @@ func awsRestjson1_serializeDocumentOutputFileUriValue(v *types.OutputFileUriValu return nil } +func awsRestjson1_serializeDocumentParquetConfiguration(v *types.ParquetConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SchemaDefinition != nil { + ok := object.Key("schemaDefinition") + if err := awsRestjson1_serializeDocumentSchemaDefinition(v.SchemaDefinition, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentPipelineActivities(v []types.PipelineActivity, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -3476,6 +3583,17 @@ func awsRestjson1_serializeDocumentS3DestinationConfiguration(v *types.S3Destina return nil } +func awsRestjson1_serializeDocumentS3PathChannelMessages(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_serializeDocumentSchedule(v *types.Schedule, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3488,6 +3606,20 @@ func awsRestjson1_serializeDocumentSchedule(v *types.Schedule, value smithyjson. return nil } +func awsRestjson1_serializeDocumentSchemaDefinition(v *types.SchemaDefinition, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Columns != nil { + ok := object.Key("columns") + if err := awsRestjson1_serializeDocumentColumns(v.Columns, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentSelectAttributesActivity(v *types.SelectAttributesActivity, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/iotanalytics/types/enums.go b/service/iotanalytics/types/enums.go index 3e4374b002e..3c764490c40 100644 --- a/service/iotanalytics/types/enums.go +++ b/service/iotanalytics/types/enums.go @@ -118,6 +118,24 @@ func (DatastoreStatus) Values() []DatastoreStatus { } } +type FileFormatType string + +// Enum values for FileFormatType +const ( + FileFormatTypeJson FileFormatType = "JSON" + FileFormatTypeParquet FileFormatType = "PARQUET" +) + +// Values returns all known values for FileFormatType. 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 (FileFormatType) Values() []FileFormatType { + return []FileFormatType{ + "JSON", + "PARQUET", + } +} + type LoggingLevel string // Enum values for LoggingLevel diff --git a/service/iotanalytics/types/types.go b/service/iotanalytics/types/types.go index 278c748d9cc..53518fea6d1 100644 --- a/service/iotanalytics/types/types.go +++ b/service/iotanalytics/types/types.go @@ -91,6 +91,14 @@ type ChannelActivity struct { Next *string } +// Specifies one or more sets of channel messages. +type ChannelMessages struct { + + // Specifies one or more keys that identify the Amazon Simple Storage Service + // (Amazon S3) objects that save your channel messages. + S3Paths []string +} + // Statistics information about the channel. type ChannelStatistics struct { @@ -150,6 +158,23 @@ type ChannelSummary struct { Status ChannelStatus } +// Contains information about a column that stores your data. +type Column struct { + + // The name of the column. + // + // This member is required. + Name *string + + // The type of data. For more information about the supported data types, see + // Common data types + // (https://docs.aws.amazon.com/glue/latest/dg/aws-glue-api-common.html) in the AWS + // Glue Developer Guide. + // + // This member is required. + Type *string +} + // Information required to run the containerAction to produce dataset contents. type ContainerDatasetAction struct { @@ -456,6 +481,12 @@ type Datastore struct { // When the data store was created. CreationTime *time.Time + // Contains the configuration information of file formats. AWS IoT Analytics data + // stores support JSON and Parquet (https://parquet.apache.org/). The default file + // format is JSON. You can specify only one format. You can't change the file + // format after you create the data store. + FileFormatConfiguration *FileFormatConfiguration + // The last time when a new message arrived in the data store. AWS IoT Analytics // updates this value at most once per minute for one data store. Hence, the // lastMessageArrivalTime value is an approximation. This feature only applies to @@ -556,6 +587,9 @@ type DatastoreSummary struct { // Where data store data is stored. DatastoreStorage *DatastoreStorageSummary + // The file format of the data in the data store. + FileFormatType FileFormatType + // The last time when a new message arrived in the data store. AWS IoT Analytics // updates this value at most once per minute for one data store. Hence, the // lastMessageArrivalTime value is an approximation. This feature only applies to @@ -680,6 +714,19 @@ type EstimatedResourceSize struct { EstimatedSizeInBytes *float64 } +// Contains the configuration information of file formats. AWS IoT Analytics data +// stores support JSON and Parquet (https://parquet.apache.org/). The default file +// format is JSON. You can specify only one format. You can't change the file +// format after you create the data store. +type FileFormatConfiguration struct { + + // Contains the configuration information of the JSON format. + JsonConfiguration *JsonConfiguration + + // Contains the configuration information of the Parquet format. + ParquetConfiguration *ParquetConfiguration +} + // An activity that filters a message based on its attributes. type FilterActivity struct { @@ -731,6 +778,10 @@ type IotEventsDestinationConfiguration struct { RoleArn *string } +// Contains the configuration information of the JSON format. +type JsonConfiguration struct { +} + // An activity that runs a Lambda function to modify the message. type LambdaActivity struct { @@ -846,6 +897,13 @@ type OutputFileUriValue struct { FileName *string } +// Contains the configuration information of the Parquet format. +type ParquetConfiguration struct { + + // Information needed to define a schema. + SchemaDefinition *SchemaDefinition +} + // Contains information about a pipeline. type Pipeline struct { @@ -1040,6 +1098,14 @@ type Schedule struct { Expression *string } +// Information needed to define a schema. +type SchemaDefinition struct { + + // Specifies one or more columns that store your data. Each schema can have up to + // 100 columns. Each column can have up to 100 nested types + Columns []Column +} + // Creates a new message using only the specified attributes from the original // message. type SelectAttributesActivity struct { diff --git a/service/iotanalytics/validators.go b/service/iotanalytics/validators.go index d0504625e52..b22e3695dc5 100644 --- a/service/iotanalytics/validators.go +++ b/service/iotanalytics/validators.go @@ -759,6 +759,41 @@ func validateChannelStorage(v *types.ChannelStorage) error { } } +func validateColumn(v *types.Column) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Column"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Type == nil { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateColumns(v []types.Column) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Columns"} + for i := range v { + if err := validateColumn(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateContainerDatasetAction(v *types.ContainerDatasetAction) error { if v == nil { return nil @@ -1052,6 +1087,23 @@ func validateDeviceShadowEnrichActivity(v *types.DeviceShadowEnrichActivity) err } } +func validateFileFormatConfiguration(v *types.FileFormatConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FileFormatConfiguration"} + if v.ParquetConfiguration != nil { + if err := validateParquetConfiguration(v.ParquetConfiguration); err != nil { + invalidParams.AddNested("ParquetConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateFilterActivity(v *types.FilterActivity) error { if v == nil { return nil @@ -1269,6 +1321,23 @@ func validateOutputFileUriValue(v *types.OutputFileUriValue) error { } } +func validateParquetConfiguration(v *types.ParquetConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ParquetConfiguration"} + if v.SchemaDefinition != nil { + if err := validateSchemaDefinition(v.SchemaDefinition); err != nil { + invalidParams.AddNested("SchemaDefinition", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validatePipelineActivities(v []types.PipelineActivity) error { if v == nil { return nil @@ -1441,6 +1510,23 @@ func validateS3DestinationConfiguration(v *types.S3DestinationConfiguration) err } } +func validateSchemaDefinition(v *types.SchemaDefinition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SchemaDefinition"} + if v.Columns != nil { + if err := validateColumns(v.Columns); err != nil { + invalidParams.AddNested("Columns", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateSelectAttributesActivity(v *types.SelectAttributesActivity) error { if v == nil { return nil @@ -1706,6 +1792,11 @@ func validateOpCreateDatastoreInput(v *CreateDatastoreInput) error { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } + if v.FileFormatConfiguration != nil { + if err := validateFileFormatConfiguration(v.FileFormatConfiguration); err != nil { + invalidParams.AddNested("FileFormatConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2096,6 +2187,11 @@ func validateOpUpdateDatastoreInput(v *UpdateDatastoreInput) error { if v.DatastoreName == nil { invalidParams.Add(smithy.NewErrParamRequired("DatastoreName")) } + if v.FileFormatConfiguration != nil { + if err := validateFileFormatConfiguration(v.FileFormatConfiguration); err != nil { + invalidParams.AddNested("FileFormatConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/iotdeviceadvisor/LICENSE.txt b/service/iotdeviceadvisor/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/iotdeviceadvisor/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/service/iotdeviceadvisor/api_client.go b/service/iotdeviceadvisor/api_client.go new file mode 100644 index 00000000000..ec9a4e14790 --- /dev/null +++ b/service/iotdeviceadvisor/api_client.go @@ -0,0 +1,235 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdeviceadvisor + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + 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" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "time" +) + +const ServiceID = "IotDeviceAdvisor" +const ServiceAPIVersion = "2020-09-18" + +// Client provides the API client to make operations call for AWS IoT Core Device +// Advisor. +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) + + 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 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 + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. + Retryer retry.Retryer + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient +} + +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) { + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + for _, fn := range optFns { + fn(&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 +} + +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) +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + Retryer: cfg.Retryer, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + } + resolveAWSEndpointResolver(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + if o.HTTPClient != nil { + return + } + o.HTTPClient = awshttp.NewBuildableClient() +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + o.Retryer = retry.NewStandard() +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil { + return + } + o.EndpointResolver = WithEndpointResolver(cfg.EndpointResolver, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddUserAgentKey("iotdeviceadvisor")(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) +} + +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) +} diff --git a/service/iotdeviceadvisor/api_op_CreateSuiteDefinition.go b/service/iotdeviceadvisor/api_op_CreateSuiteDefinition.go new file mode 100644 index 00000000000..1cd6c25a3ec --- /dev/null +++ b/service/iotdeviceadvisor/api_op_CreateSuiteDefinition.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdeviceadvisor + +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/iotdeviceadvisor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates a Device Advisor test suite. +func (c *Client) CreateSuiteDefinition(ctx context.Context, params *CreateSuiteDefinitionInput, optFns ...func(*Options)) (*CreateSuiteDefinitionOutput, error) { + if params == nil { + params = &CreateSuiteDefinitionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateSuiteDefinition", params, optFns, addOperationCreateSuiteDefinitionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateSuiteDefinitionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateSuiteDefinitionInput struct { + + // Creates a Device Advisor test suite with suite definition configuration. + SuiteDefinitionConfiguration *types.SuiteDefinitionConfiguration + + // The tags to be attached to the suite definition. + Tags map[string]string +} + +type CreateSuiteDefinitionOutput struct { + + // Creates a Device Advisor test suite with TimeStamp of when it was created. + CreatedAt *time.Time + + // Creates a Device Advisor test suite with Amazon Resource name. + SuiteDefinitionArn *string + + // Creates a Device Advisor test suite with suite UUID. + SuiteDefinitionId *string + + // Creates a Device Advisor test suite with suite definition name. + SuiteDefinitionName *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCreateSuiteDefinitionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSuiteDefinition{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSuiteDefinition{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opCreateSuiteDefinition(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opCreateSuiteDefinition(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotdeviceadvisor", + OperationName: "CreateSuiteDefinition", + } +} diff --git a/service/iotdeviceadvisor/api_op_DeleteSuiteDefinition.go b/service/iotdeviceadvisor/api_op_DeleteSuiteDefinition.go new file mode 100644 index 00000000000..df1fa9c6152 --- /dev/null +++ b/service/iotdeviceadvisor/api_op_DeleteSuiteDefinition.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdeviceadvisor + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a Device Advisor test suite. +func (c *Client) DeleteSuiteDefinition(ctx context.Context, params *DeleteSuiteDefinitionInput, optFns ...func(*Options)) (*DeleteSuiteDefinitionOutput, error) { + if params == nil { + params = &DeleteSuiteDefinitionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteSuiteDefinition", params, optFns, addOperationDeleteSuiteDefinitionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteSuiteDefinitionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteSuiteDefinitionInput struct { + + // Deletes a Device Advisor test suite with defined suite Id. + // + // This member is required. + SuiteDefinitionId *string +} + +type DeleteSuiteDefinitionOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteSuiteDefinitionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSuiteDefinition{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSuiteDefinition{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteSuiteDefinitionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSuiteDefinition(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDeleteSuiteDefinition(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotdeviceadvisor", + OperationName: "DeleteSuiteDefinition", + } +} diff --git a/service/iotdeviceadvisor/api_op_GetSuiteDefinition.go b/service/iotdeviceadvisor/api_op_GetSuiteDefinition.go new file mode 100644 index 00000000000..a8f04482915 --- /dev/null +++ b/service/iotdeviceadvisor/api_op_GetSuiteDefinition.go @@ -0,0 +1,141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdeviceadvisor + +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/iotdeviceadvisor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Gets information about a Device Advisor test suite. +func (c *Client) GetSuiteDefinition(ctx context.Context, params *GetSuiteDefinitionInput, optFns ...func(*Options)) (*GetSuiteDefinitionOutput, error) { + if params == nil { + params = &GetSuiteDefinitionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSuiteDefinition", params, optFns, addOperationGetSuiteDefinitionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSuiteDefinitionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSuiteDefinitionInput struct { + + // Requests suite definition Id with GetSuiteDefinition API call. + // + // This member is required. + SuiteDefinitionId *string + + // Requests the suite definition version of a test suite. + SuiteDefinitionVersion *string +} + +type GetSuiteDefinitionOutput struct { + + // Gets the timestamp of the time suite was created with GetSuiteDefinition API + // call. + CreatedAt *time.Time + + // Gets the timestamp of the time suite was modified with GetSuiteDefinition API + // call. + LastModifiedAt *time.Time + + // Gets latest suite definition version with GetSuiteDefinition API call. + LatestVersion *string + + // The ARN of the suite definition. + SuiteDefinitionArn *string + + // Gets the suite configuration with GetSuiteDefinition API call. + SuiteDefinitionConfiguration *types.SuiteDefinitionConfiguration + + // Gets suite definition Id with GetSuiteDefinition API call. + SuiteDefinitionId *string + + // Gets suite definition version with GetSuiteDefinition API call. + SuiteDefinitionVersion *string + + // Tags attached to the suite definition. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetSuiteDefinitionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSuiteDefinition{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSuiteDefinition{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetSuiteDefinitionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSuiteDefinition(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetSuiteDefinition(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotdeviceadvisor", + OperationName: "GetSuiteDefinition", + } +} diff --git a/service/iotdeviceadvisor/api_op_GetSuiteRun.go b/service/iotdeviceadvisor/api_op_GetSuiteRun.go new file mode 100644 index 00000000000..f3c6c515d22 --- /dev/null +++ b/service/iotdeviceadvisor/api_op_GetSuiteRun.go @@ -0,0 +1,156 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdeviceadvisor + +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/iotdeviceadvisor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Gets information about a Device Advisor test suite run. +func (c *Client) GetSuiteRun(ctx context.Context, params *GetSuiteRunInput, optFns ...func(*Options)) (*GetSuiteRunOutput, error) { + if params == nil { + params = &GetSuiteRunInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSuiteRun", params, optFns, addOperationGetSuiteRunMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSuiteRunOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSuiteRunInput struct { + + // Requests the information about Device Advisor test suite run based on suite + // definition Id. + // + // This member is required. + SuiteDefinitionId *string + + // Requests the information about Device Advisor test suite run based on suite run + // Id. + // + // This member is required. + SuiteRunId *string +} + +type GetSuiteRunOutput struct { + + // Gets the information about Device Advisor test suite run based on end time. + EndTime *time.Time + + // Gets the information about Device Advisor test suite run based on error. + ErrorReason *string + + // Gets the information about Device Advisor test suite run based on start time. + StartTime *time.Time + + // Gets the information about Device Advisor test suite run based on its status. + Status types.SuiteRunStatus + + // Gets the information about Device Advisor test suite run based on suite + // definition Id. + SuiteDefinitionId *string + + // Gets the information about Device Advisor test suite run based on suite + // definition version. + SuiteDefinitionVersion *string + + // The ARN of the suite run. + SuiteRunArn *string + + // Gets the information about Device Advisor test suite run based on suite + // configuration. + SuiteRunConfiguration *types.SuiteRunConfiguration + + // Gets the information about Device Advisor test suite run based on suite run Id. + SuiteRunId *string + + // The tags attached to the suite run. + Tags map[string]string + + // Gets the information about Device Advisor test suite run based on test case + // runs. + TestResult *types.TestResult + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetSuiteRunMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSuiteRun{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSuiteRun{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetSuiteRunValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSuiteRun(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetSuiteRun(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotdeviceadvisor", + OperationName: "GetSuiteRun", + } +} diff --git a/service/iotdeviceadvisor/api_op_GetSuiteRunReport.go b/service/iotdeviceadvisor/api_op_GetSuiteRunReport.go new file mode 100644 index 00000000000..3373007d347 --- /dev/null +++ b/service/iotdeviceadvisor/api_op_GetSuiteRunReport.go @@ -0,0 +1,119 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdeviceadvisor + +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 a report download link for a successful Device Advisor qualifying test +// suite run. +func (c *Client) GetSuiteRunReport(ctx context.Context, params *GetSuiteRunReportInput, optFns ...func(*Options)) (*GetSuiteRunReportOutput, error) { + if params == nil { + params = &GetSuiteRunReportInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSuiteRunReport", params, optFns, addOperationGetSuiteRunReportMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSuiteRunReportOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSuiteRunReportInput struct { + + // Device Advisor suite definition Id. + // + // This member is required. + SuiteDefinitionId *string + + // Device Advisor suite run Id. + // + // This member is required. + SuiteRunId *string +} + +type GetSuiteRunReportOutput struct { + + // Gets the download URL of the qualification report. + QualificationReportDownloadUrl *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetSuiteRunReportMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSuiteRunReport{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSuiteRunReport{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetSuiteRunReportValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSuiteRunReport(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetSuiteRunReport(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotdeviceadvisor", + OperationName: "GetSuiteRunReport", + } +} diff --git a/service/iotdeviceadvisor/api_op_ListSuiteDefinitions.go b/service/iotdeviceadvisor/api_op_ListSuiteDefinitions.go new file mode 100644 index 00000000000..a8353227838 --- /dev/null +++ b/service/iotdeviceadvisor/api_op_ListSuiteDefinitions.go @@ -0,0 +1,199 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdeviceadvisor + +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/iotdeviceadvisor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the Device Advisor test suites you have created. +func (c *Client) ListSuiteDefinitions(ctx context.Context, params *ListSuiteDefinitionsInput, optFns ...func(*Options)) (*ListSuiteDefinitionsOutput, error) { + if params == nil { + params = &ListSuiteDefinitionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSuiteDefinitions", params, optFns, addOperationListSuiteDefinitionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSuiteDefinitionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSuiteDefinitionsInput struct { + + // Request the list of all the Device Advisor test suites. + MaxResults int32 + + // Requests the Device Advisor test suites next token. + NextToken *string +} + +type ListSuiteDefinitionsOutput struct { + + // Creates a Device Advisor test suite. + NextToken *string + + // Lists test suite information using List suite definition. + SuiteDefinitionInformationList []types.SuiteDefinitionInformation + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListSuiteDefinitionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSuiteDefinitions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSuiteDefinitions{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListSuiteDefinitions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListSuiteDefinitionsAPIClient is a client that implements the +// ListSuiteDefinitions operation. +type ListSuiteDefinitionsAPIClient interface { + ListSuiteDefinitions(context.Context, *ListSuiteDefinitionsInput, ...func(*Options)) (*ListSuiteDefinitionsOutput, error) +} + +var _ ListSuiteDefinitionsAPIClient = (*Client)(nil) + +// ListSuiteDefinitionsPaginatorOptions is the paginator options for +// ListSuiteDefinitions +type ListSuiteDefinitionsPaginatorOptions struct { + // Request the list of all the Device Advisor test suites. + 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 +} + +// ListSuiteDefinitionsPaginator is a paginator for ListSuiteDefinitions +type ListSuiteDefinitionsPaginator struct { + options ListSuiteDefinitionsPaginatorOptions + client ListSuiteDefinitionsAPIClient + params *ListSuiteDefinitionsInput + nextToken *string + firstPage bool +} + +// NewListSuiteDefinitionsPaginator returns a new ListSuiteDefinitionsPaginator +func NewListSuiteDefinitionsPaginator(client ListSuiteDefinitionsAPIClient, params *ListSuiteDefinitionsInput, optFns ...func(*ListSuiteDefinitionsPaginatorOptions)) *ListSuiteDefinitionsPaginator { + options := ListSuiteDefinitionsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSuiteDefinitionsInput{} + } + + return &ListSuiteDefinitionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSuiteDefinitionsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSuiteDefinitions page. +func (p *ListSuiteDefinitionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSuiteDefinitionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListSuiteDefinitions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListSuiteDefinitions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotdeviceadvisor", + OperationName: "ListSuiteDefinitions", + } +} diff --git a/service/iotdeviceadvisor/api_op_ListSuiteRuns.go b/service/iotdeviceadvisor/api_op_ListSuiteRuns.go new file mode 100644 index 00000000000..2fe6c7821ff --- /dev/null +++ b/service/iotdeviceadvisor/api_op_ListSuiteRuns.go @@ -0,0 +1,206 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdeviceadvisor + +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/iotdeviceadvisor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the runs of the specified Device Advisor test suite. You can list all runs +// of the test suite, or the runs of a specific version of the test suite. +func (c *Client) ListSuiteRuns(ctx context.Context, params *ListSuiteRunsInput, optFns ...func(*Options)) (*ListSuiteRunsOutput, error) { + if params == nil { + params = &ListSuiteRunsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSuiteRuns", params, optFns, addOperationListSuiteRunsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSuiteRunsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSuiteRunsInput struct { + + // MaxResults for list suite run API request. + MaxResults int32 + + // Next pagination token for list suite run request. + NextToken *string + + // Lists the runs of the specified Device Advisor test suite based on suite + // definition Id. + SuiteDefinitionId *string + + // Lists the runs of the specified Device Advisor test suite based on suite + // definition version. + SuiteDefinitionVersion *string +} + +type ListSuiteRunsOutput struct { + + // Next pagination token for list suite run response. + NextToken *string + + // Lists the runs of the specified Device Advisor test suite. + SuiteRunsList []types.SuiteRunInformation + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListSuiteRunsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSuiteRuns{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSuiteRuns{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListSuiteRuns(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListSuiteRunsAPIClient is a client that implements the ListSuiteRuns operation. +type ListSuiteRunsAPIClient interface { + ListSuiteRuns(context.Context, *ListSuiteRunsInput, ...func(*Options)) (*ListSuiteRunsOutput, error) +} + +var _ ListSuiteRunsAPIClient = (*Client)(nil) + +// ListSuiteRunsPaginatorOptions is the paginator options for ListSuiteRuns +type ListSuiteRunsPaginatorOptions struct { + // MaxResults for list suite run API request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListSuiteRunsPaginator is a paginator for ListSuiteRuns +type ListSuiteRunsPaginator struct { + options ListSuiteRunsPaginatorOptions + client ListSuiteRunsAPIClient + params *ListSuiteRunsInput + nextToken *string + firstPage bool +} + +// NewListSuiteRunsPaginator returns a new ListSuiteRunsPaginator +func NewListSuiteRunsPaginator(client ListSuiteRunsAPIClient, params *ListSuiteRunsInput, optFns ...func(*ListSuiteRunsPaginatorOptions)) *ListSuiteRunsPaginator { + options := ListSuiteRunsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListSuiteRunsInput{} + } + + return &ListSuiteRunsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSuiteRunsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListSuiteRuns page. +func (p *ListSuiteRunsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSuiteRunsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListSuiteRuns(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListSuiteRuns(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotdeviceadvisor", + OperationName: "ListSuiteRuns", + } +} diff --git a/service/iotdeviceadvisor/api_op_ListTagsForResource.go b/service/iotdeviceadvisor/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..954d0d190dc --- /dev/null +++ b/service/iotdeviceadvisor/api_op_ListTagsForResource.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdeviceadvisor + +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 the tags attached to an IoT Device Advisor 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, addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The ARN of the IoT Device Advisor resource. + // + // This member is required. + ResourceArn *string +} + +type ListTagsForResourceOutput struct { + + // The tags attached to the IoT Device Advisor resource. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "iotdeviceadvisor", + OperationName: "ListTagsForResource", + } +} diff --git a/service/iotdeviceadvisor/api_op_ListTestCases.go b/service/iotdeviceadvisor/api_op_ListTestCases.go new file mode 100644 index 00000000000..362fe79f330 --- /dev/null +++ b/service/iotdeviceadvisor/api_op_ListTestCases.go @@ -0,0 +1,206 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdeviceadvisor + +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/iotdeviceadvisor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all the test cases in the test suite. +func (c *Client) ListTestCases(ctx context.Context, params *ListTestCasesInput, optFns ...func(*Options)) (*ListTestCasesOutput, error) { + if params == nil { + params = &ListTestCasesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTestCases", params, optFns, addOperationListTestCasesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTestCasesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTestCasesInput struct { + + // Lists all the qualification test cases in the test suite. + IntendedForQualification bool + + // Requests the test cases max results. + MaxResults int32 + + // Requests the test cases next token. + NextToken *string +} + +type ListTestCasesOutput struct { + + // Gets the category of test case. + Categories []types.TestCaseCategory + + // Gets the configuration of test group. + GroupConfiguration map[string]string + + // Test cases next token response. + NextToken *string + + // Gets the configuration of root test group. + RootGroupConfiguration map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListTestCasesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListTestCases{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTestCases{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListTestCases(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListTestCasesAPIClient is a client that implements the ListTestCases operation. +type ListTestCasesAPIClient interface { + ListTestCases(context.Context, *ListTestCasesInput, ...func(*Options)) (*ListTestCasesOutput, error) +} + +var _ ListTestCasesAPIClient = (*Client)(nil) + +// ListTestCasesPaginatorOptions is the paginator options for ListTestCases +type ListTestCasesPaginatorOptions struct { + // Requests the test cases max results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListTestCasesPaginator is a paginator for ListTestCases +type ListTestCasesPaginator struct { + options ListTestCasesPaginatorOptions + client ListTestCasesAPIClient + params *ListTestCasesInput + nextToken *string + firstPage bool +} + +// NewListTestCasesPaginator returns a new ListTestCasesPaginator +func NewListTestCasesPaginator(client ListTestCasesAPIClient, params *ListTestCasesInput, optFns ...func(*ListTestCasesPaginatorOptions)) *ListTestCasesPaginator { + options := ListTestCasesPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListTestCasesInput{} + } + + return &ListTestCasesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListTestCasesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListTestCases page. +func (p *ListTestCasesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListTestCasesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListTestCases(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListTestCases(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotdeviceadvisor", + OperationName: "ListTestCases", + } +} diff --git a/service/iotdeviceadvisor/api_op_StartSuiteRun.go b/service/iotdeviceadvisor/api_op_StartSuiteRun.go new file mode 100644 index 00000000000..54fa5164241 --- /dev/null +++ b/service/iotdeviceadvisor/api_op_StartSuiteRun.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdeviceadvisor + +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/iotdeviceadvisor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Starts a Device Advisor test suite run. +func (c *Client) StartSuiteRun(ctx context.Context, params *StartSuiteRunInput, optFns ...func(*Options)) (*StartSuiteRunOutput, error) { + if params == nil { + params = &StartSuiteRunInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartSuiteRun", params, optFns, addOperationStartSuiteRunMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartSuiteRunOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartSuiteRunInput struct { + + // Request to start suite run based on suite definition Id. + // + // This member is required. + SuiteDefinitionId *string + + // Request to start suite run based on suite definition version. + SuiteDefinitionVersion *string + + // Request to start suite run based on suite configuration. + SuiteRunConfiguration *types.SuiteRunConfiguration + + // The tags to be attached to the suite run. + Tags map[string]string +} + +type StartSuiteRunOutput struct { + + // Starts a Device Advisor test suite run based on suite create time. + CreatedAt *time.Time + + // Starts a Device Advisor test suite run based on suite run arn. + SuiteRunArn *string + + // Starts a Device Advisor test suite run based on suite Run Id. + SuiteRunId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationStartSuiteRunMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartSuiteRun{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartSuiteRun{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpStartSuiteRunValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartSuiteRun(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opStartSuiteRun(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotdeviceadvisor", + OperationName: "StartSuiteRun", + } +} diff --git a/service/iotdeviceadvisor/api_op_TagResource.go b/service/iotdeviceadvisor/api_op_TagResource.go new file mode 100644 index 00000000000..f8dd260d876 --- /dev/null +++ b/service/iotdeviceadvisor/api_op_TagResource.go @@ -0,0 +1,114 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdeviceadvisor + +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 to and modifies existing tags of an IoT Device Advisor resource. +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The resource ARN of an IoT Device Advisor resource. + // + // This member is required. + ResourceArn *string + + // The tags to be attached to the IoT Device Advisor resource. + // + // This member is required. + Tags map[string]string +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "iotdeviceadvisor", + OperationName: "TagResource", + } +} diff --git a/service/iotdeviceadvisor/api_op_UntagResource.go b/service/iotdeviceadvisor/api_op_UntagResource.go new file mode 100644 index 00000000000..e874543d8bf --- /dev/null +++ b/service/iotdeviceadvisor/api_op_UntagResource.go @@ -0,0 +1,114 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdeviceadvisor + +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 an IoT Device Advisor resource. +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The resource ARN of an IoT Device Advisor resource. + // + // This member is required. + ResourceArn *string + + // List of tag keys to remove from the IoT Device Advisor resource. + // + // This member is required. + TagKeys []string +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "iotdeviceadvisor", + OperationName: "UntagResource", + } +} diff --git a/service/iotdeviceadvisor/api_op_UpdateSuiteDefinition.go b/service/iotdeviceadvisor/api_op_UpdateSuiteDefinition.go new file mode 100644 index 00000000000..4e6cab11443 --- /dev/null +++ b/service/iotdeviceadvisor/api_op_UpdateSuiteDefinition.go @@ -0,0 +1,133 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdeviceadvisor + +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/iotdeviceadvisor/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Updates a Device Advisor test suite. +func (c *Client) UpdateSuiteDefinition(ctx context.Context, params *UpdateSuiteDefinitionInput, optFns ...func(*Options)) (*UpdateSuiteDefinitionOutput, error) { + if params == nil { + params = &UpdateSuiteDefinitionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateSuiteDefinition", params, optFns, addOperationUpdateSuiteDefinitionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateSuiteDefinitionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateSuiteDefinitionInput struct { + + // Updates a Device Advisor test suite with suite definition id. + // + // This member is required. + SuiteDefinitionId *string + + // Updates a Device Advisor test suite with suite definition configuration. + SuiteDefinitionConfiguration *types.SuiteDefinitionConfiguration +} + +type UpdateSuiteDefinitionOutput struct { + + // Updates a Device Advisor test suite with TimeStamp of when it was created. + CreatedAt *time.Time + + // Updates a Device Advisor test suite with TimeStamp of when it was updated. + LastUpdatedAt *time.Time + + // Updates a Device Advisor test suite with Amazon Resource name. + SuiteDefinitionArn *string + + // Updates a Device Advisor test suite with suite UUID. + SuiteDefinitionId *string + + // Updates a Device Advisor test suite with suite definition name. + SuiteDefinitionName *string + + // Updates a Device Advisor test suite with suite definition version. + SuiteDefinitionVersion *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationUpdateSuiteDefinitionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSuiteDefinition{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSuiteDefinition{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateSuiteDefinitionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSuiteDefinition(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opUpdateSuiteDefinition(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotdeviceadvisor", + OperationName: "UpdateSuiteDefinition", + } +} diff --git a/service/iotdeviceadvisor/deserializers.go b/service/iotdeviceadvisor/deserializers.go new file mode 100644 index 00000000000..d7bddbde403 --- /dev/null +++ b/service/iotdeviceadvisor/deserializers.go @@ -0,0 +1,3500 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdeviceadvisor + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/iotdeviceadvisor/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_deserializeOpCreateSuiteDefinition struct { +} + +func (*awsRestjson1_deserializeOpCreateSuiteDefinition) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateSuiteDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateSuiteDefinition(response, &metadata) + } + output := &CreateSuiteDefinitionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateSuiteDefinitionOutput(&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_deserializeOpErrorCreateSuiteDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateSuiteDefinitionOutput(v **CreateSuiteDefinitionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateSuiteDefinitionOutput + if *v == nil { + sv = &CreateSuiteDefinitionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "suiteDefinitionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) + } + sv.SuiteDefinitionArn = ptr.String(jtv) + } + + case "suiteDefinitionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UUID to be of type string, got %T instead", value) + } + sv.SuiteDefinitionId = ptr.String(jtv) + } + + case "suiteDefinitionName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SuiteDefinitionName to be of type string, got %T instead", value) + } + sv.SuiteDefinitionName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteSuiteDefinition struct { +} + +func (*awsRestjson1_deserializeOpDeleteSuiteDefinition) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteSuiteDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteSuiteDefinition(response, &metadata) + } + output := &DeleteSuiteDefinitionOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteSuiteDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpGetSuiteDefinition struct { +} + +func (*awsRestjson1_deserializeOpGetSuiteDefinition) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSuiteDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetSuiteDefinition(response, &metadata) + } + output := &GetSuiteDefinitionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetSuiteDefinitionOutput(&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_deserializeOpErrorGetSuiteDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetSuiteDefinitionOutput(v **GetSuiteDefinitionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetSuiteDefinitionOutput + if *v == nil { + sv = &GetSuiteDefinitionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "lastModifiedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "latestVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SuiteDefinitionVersion to be of type string, got %T instead", value) + } + sv.LatestVersion = ptr.String(jtv) + } + + case "suiteDefinitionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) + } + sv.SuiteDefinitionArn = ptr.String(jtv) + } + + case "suiteDefinitionConfiguration": + if err := awsRestjson1_deserializeDocumentSuiteDefinitionConfiguration(&sv.SuiteDefinitionConfiguration, value); err != nil { + return err + } + + case "suiteDefinitionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UUID to be of type string, got %T instead", value) + } + sv.SuiteDefinitionId = ptr.String(jtv) + } + + case "suiteDefinitionVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SuiteDefinitionVersion to be of type string, got %T instead", value) + } + sv.SuiteDefinitionVersion = 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_deserializeOpGetSuiteRun struct { +} + +func (*awsRestjson1_deserializeOpGetSuiteRun) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSuiteRun) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetSuiteRun(response, &metadata) + } + output := &GetSuiteRunOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetSuiteRunOutput(&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_deserializeOpErrorGetSuiteRun(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetSuiteRunOutput(v **GetSuiteRunOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetSuiteRunOutput + if *v == nil { + sv = &GetSuiteRunOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "endTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "errorReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorReason to be of type string, got %T instead", value) + } + sv.ErrorReason = ptr.String(jtv) + } + + case "startTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SuiteRunStatus to be of type string, got %T instead", value) + } + sv.Status = types.SuiteRunStatus(jtv) + } + + case "suiteDefinitionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UUID to be of type string, got %T instead", value) + } + sv.SuiteDefinitionId = ptr.String(jtv) + } + + case "suiteDefinitionVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SuiteDefinitionVersion to be of type string, got %T instead", value) + } + sv.SuiteDefinitionVersion = ptr.String(jtv) + } + + case "suiteRunArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) + } + sv.SuiteRunArn = ptr.String(jtv) + } + + case "suiteRunConfiguration": + if err := awsRestjson1_deserializeDocumentSuiteRunConfiguration(&sv.SuiteRunConfiguration, value); err != nil { + return err + } + + case "suiteRunId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UUID to be of type string, got %T instead", value) + } + sv.SuiteRunId = ptr.String(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "testResult": + if err := awsRestjson1_deserializeDocumentTestResult(&sv.TestResult, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetSuiteRunReport struct { +} + +func (*awsRestjson1_deserializeOpGetSuiteRunReport) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSuiteRunReport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetSuiteRunReport(response, &metadata) + } + output := &GetSuiteRunReportOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetSuiteRunReportOutput(&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_deserializeOpErrorGetSuiteRunReport(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetSuiteRunReportOutput(v **GetSuiteRunReportOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetSuiteRunReportOutput + if *v == nil { + sv = &GetSuiteRunReportOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "qualificationReportDownloadUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QualificationReportDownloadUrl to be of type string, got %T instead", value) + } + sv.QualificationReportDownloadUrl = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListSuiteDefinitions struct { +} + +func (*awsRestjson1_deserializeOpListSuiteDefinitions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSuiteDefinitions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListSuiteDefinitions(response, &metadata) + } + output := &ListSuiteDefinitionsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListSuiteDefinitionsOutput(&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_deserializeOpErrorListSuiteDefinitions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListSuiteDefinitionsOutput(v **ListSuiteDefinitionsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListSuiteDefinitionsOutput + if *v == nil { + sv = &ListSuiteDefinitionsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "suiteDefinitionInformationList": + if err := awsRestjson1_deserializeDocumentSuiteDefinitionInformationList(&sv.SuiteDefinitionInformationList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListSuiteRuns struct { +} + +func (*awsRestjson1_deserializeOpListSuiteRuns) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSuiteRuns) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListSuiteRuns(response, &metadata) + } + output := &ListSuiteRunsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListSuiteRunsOutput(&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_deserializeOpErrorListSuiteRuns(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListSuiteRunsOutput(v **ListSuiteRunsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListSuiteRunsOutput + if *v == nil { + sv = &ListSuiteRunsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "suiteRunsList": + if err := awsRestjson1_deserializeDocumentSuiteRunsList(&sv.SuiteRunsList, 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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_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_deserializeOpListTestCases struct { +} + +func (*awsRestjson1_deserializeOpListTestCases) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTestCases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListTestCases(response, &metadata) + } + output := &ListTestCasesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListTestCasesOutput(&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_deserializeOpErrorListTestCases(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTestCasesOutput(v **ListTestCasesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTestCasesOutput + if *v == nil { + sv = &ListTestCasesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "categories": + if err := awsRestjson1_deserializeDocumentTestCategory(&sv.Categories, value); err != nil { + return err + } + + case "groupConfiguration": + if err := awsRestjson1_deserializeDocumentTestConfiguration(&sv.GroupConfiguration, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Token to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "rootGroupConfiguration": + if err := awsRestjson1_deserializeDocumentTestConfiguration(&sv.RootGroupConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpStartSuiteRun struct { +} + +func (*awsRestjson1_deserializeOpStartSuiteRun) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartSuiteRun) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorStartSuiteRun(response, &metadata) + } + output := &StartSuiteRunOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentStartSuiteRunOutput(&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_deserializeOpErrorStartSuiteRun(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentStartSuiteRunOutput(v **StartSuiteRunOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartSuiteRunOutput + if *v == nil { + sv = &StartSuiteRunOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "suiteRunArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) + } + sv.SuiteRunArn = ptr.String(jtv) + } + + case "suiteRunId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UUID to be of type string, got %T instead", value) + } + sv.SuiteRunId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpTagResource struct { +} + +func (*awsRestjson1_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateSuiteDefinition struct { +} + +func (*awsRestjson1_deserializeOpUpdateSuiteDefinition) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateSuiteDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateSuiteDefinition(response, &metadata) + } + output := &UpdateSuiteDefinitionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentUpdateSuiteDefinitionOutput(&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_deserializeOpErrorUpdateSuiteDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateSuiteDefinitionOutput(v **UpdateSuiteDefinitionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateSuiteDefinitionOutput + if *v == nil { + sv = &UpdateSuiteDefinitionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "lastUpdatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "suiteDefinitionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) + } + sv.SuiteDefinitionArn = ptr.String(jtv) + } + + case "suiteDefinitionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UUID to be of type string, got %T instead", value) + } + sv.SuiteDefinitionId = ptr.String(jtv) + } + + case "suiteDefinitionName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SuiteDefinitionName to be of type string, got %T instead", value) + } + sv.SuiteDefinitionName = ptr.String(jtv) + } + + case "suiteDefinitionVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SuiteDefinitionVersion to be of type string, got %T instead", value) + } + sv.SuiteDefinitionVersion = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_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_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDeviceUnderTest(v **types.DeviceUnderTest, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DeviceUnderTest + if *v == nil { + sv = &types.DeviceUnderTest{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "certificateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) + } + sv.CertificateArn = ptr.String(jtv) + } + + case "thingArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) + } + sv.ThingArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDeviceUnderTestList(v *[]types.DeviceUnderTest, 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.DeviceUnderTest + if *v == nil { + cv = []types.DeviceUnderTest{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DeviceUnderTest + destAddr := &col + if err := awsRestjson1_deserializeDocumentDeviceUnderTest(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentGroupResult(v **types.GroupResult, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.GroupResult + if *v == nil { + sv = &types.GroupResult{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "groupId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UUID to be of type string, got %T instead", value) + } + sv.GroupId = ptr.String(jtv) + } + + case "groupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GroupName to be of type string, got %T instead", value) + } + sv.GroupName = ptr.String(jtv) + } + + case "tests": + if err := awsRestjson1_deserializeDocumentTestCaseRuns(&sv.Tests, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGroupResultList(v *[]types.GroupResult, 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.GroupResult + if *v == nil { + cv = []types.GroupResult{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.GroupResult + destAddr := &col + if err := awsRestjson1_deserializeDocumentGroupResult(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + 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 Message 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 Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSelectedTestList(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 UUID to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSuiteDefinitionConfiguration(v **types.SuiteDefinitionConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SuiteDefinitionConfiguration + if *v == nil { + sv = &types.SuiteDefinitionConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "devicePermissionRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) + } + sv.DevicePermissionRoleArn = ptr.String(jtv) + } + + case "devices": + if err := awsRestjson1_deserializeDocumentDeviceUnderTestList(&sv.Devices, value); err != nil { + return err + } + + case "intendedForQualification": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected IntendedForQualificationBoolean to be of type *bool, got %T instead", value) + } + sv.IntendedForQualification = jtv + } + + case "rootGroup": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RootGroup to be of type string, got %T instead", value) + } + sv.RootGroup = ptr.String(jtv) + } + + case "suiteDefinitionName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SuiteDefinitionName to be of type string, got %T instead", value) + } + sv.SuiteDefinitionName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSuiteDefinitionInformation(v **types.SuiteDefinitionInformation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SuiteDefinitionInformation + if *v == nil { + sv = &types.SuiteDefinitionInformation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "defaultDevices": + if err := awsRestjson1_deserializeDocumentDeviceUnderTestList(&sv.DefaultDevices, value); err != nil { + return err + } + + case "intendedForQualification": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected IntendedForQualificationBoolean to be of type *bool, got %T instead", value) + } + sv.IntendedForQualification = jtv + } + + case "suiteDefinitionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UUID to be of type string, got %T instead", value) + } + sv.SuiteDefinitionId = ptr.String(jtv) + } + + case "suiteDefinitionName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SuiteDefinitionName to be of type string, got %T instead", value) + } + sv.SuiteDefinitionName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSuiteDefinitionInformationList(v *[]types.SuiteDefinitionInformation, 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.SuiteDefinitionInformation + if *v == nil { + cv = []types.SuiteDefinitionInformation{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SuiteDefinitionInformation + destAddr := &col + if err := awsRestjson1_deserializeDocumentSuiteDefinitionInformation(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSuiteRunConfiguration(v **types.SuiteRunConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SuiteRunConfiguration + if *v == nil { + sv = &types.SuiteRunConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "primaryDevice": + if err := awsRestjson1_deserializeDocumentDeviceUnderTest(&sv.PrimaryDevice, value); err != nil { + return err + } + + case "secondaryDevice": + if err := awsRestjson1_deserializeDocumentDeviceUnderTest(&sv.SecondaryDevice, value); err != nil { + return err + } + + case "selectedTestList": + if err := awsRestjson1_deserializeDocumentSelectedTestList(&sv.SelectedTestList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSuiteRunInformation(v **types.SuiteRunInformation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SuiteRunInformation + if *v == nil { + sv = &types.SuiteRunInformation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createdAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "endAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "failed": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected SuiteRunResultCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Failed = int32(i64) + } + + case "passed": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected SuiteRunResultCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Passed = int32(i64) + } + + case "startedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SuiteRunStatus to be of type string, got %T instead", value) + } + sv.Status = types.SuiteRunStatus(jtv) + } + + case "suiteDefinitionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UUID to be of type string, got %T instead", value) + } + sv.SuiteDefinitionId = ptr.String(jtv) + } + + case "suiteDefinitionName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SuiteDefinitionName to be of type string, got %T instead", value) + } + sv.SuiteDefinitionName = ptr.String(jtv) + } + + case "suiteDefinitionVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SuiteDefinitionVersion to be of type string, got %T instead", value) + } + sv.SuiteDefinitionVersion = ptr.String(jtv) + } + + case "suiteRunId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UUID to be of type string, got %T instead", value) + } + sv.SuiteRunId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSuiteRunsList(v *[]types.SuiteRunInformation, 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.SuiteRunInformation + if *v == nil { + cv = []types.SuiteRunInformation{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SuiteRunInformation + destAddr := &col + if err := awsRestjson1_deserializeDocumentSuiteRunInformation(&destAddr, value); err != nil { + return err + } + col = *destAddr + 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 String256 to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentTestCase(v **types.TestCase, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TestCase + if *v == nil { + sv = &types.TestCase{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "configuration": + if err := awsRestjson1_deserializeDocumentTestConfiguration(&sv.Configuration, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TestCaseName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "test": + if err := awsRestjson1_deserializeDocumentTestCaseDefinition(&sv.Test, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTestCaseCategory(v **types.TestCaseCategory, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TestCaseCategory + if *v == nil { + sv = &types.TestCaseCategory{} + } 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 CategoryName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "tests": + if err := awsRestjson1_deserializeDocumentTestCaseList(&sv.Tests, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTestCaseDefinition(v **types.TestCaseDefinition, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TestCaseDefinition + if *v == nil { + sv = &types.TestCaseDefinition{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TestCaseName to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "testCaseVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TestCaseVersion to be of type string, got %T instead", value) + } + sv.TestCaseVersion = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTestCaseList(v *[]types.TestCase, 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.TestCase + if *v == nil { + cv = []types.TestCase{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.TestCase + destAddr := &col + if err := awsRestjson1_deserializeDocumentTestCase(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTestCaseRun(v **types.TestCaseRun, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TestCaseRun + if *v == nil { + sv = &types.TestCaseRun{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "endTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "failure": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Failure to be of type string, got %T instead", value) + } + sv.Failure = ptr.String(jtv) + } + + case "logUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LogUrl to be of type string, got %T instead", value) + } + sv.LogUrl = ptr.String(jtv) + } + + case "startTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Status to be of type string, got %T instead", value) + } + sv.Status = types.Status(jtv) + } + + case "testCaseDefinitionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UUID to be of type string, got %T instead", value) + } + sv.TestCaseDefinitionId = ptr.String(jtv) + } + + case "testCaseDefinitionName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TestCaseDefinitionName to be of type string, got %T instead", value) + } + sv.TestCaseDefinitionName = ptr.String(jtv) + } + + case "testCaseRunId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UUID to be of type string, got %T instead", value) + } + sv.TestCaseRunId = ptr.String(jtv) + } + + case "warnings": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Warnings to be of type string, got %T instead", value) + } + sv.Warnings = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTestCaseRuns(v *[]types.TestCaseRun, 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.TestCaseRun + if *v == nil { + cv = []types.TestCaseRun{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.TestCaseRun + destAddr := &col + if err := awsRestjson1_deserializeDocumentTestCaseRun(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTestCategory(v *[]types.TestCaseCategory, 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.TestCaseCategory + if *v == nil { + cv = []types.TestCaseCategory{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.TestCaseCategory + destAddr := &col + if err := awsRestjson1_deserializeDocumentTestCaseCategory(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTestConfiguration(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 ConfigString to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentTestResult(v **types.TestResult, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TestResult + if *v == nil { + sv = &types.TestResult{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "groups": + if err := awsRestjson1_deserializeDocumentGroupResultList(&sv.Groups, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/iotdeviceadvisor/doc.go b/service/iotdeviceadvisor/doc.go new file mode 100644 index 00000000000..43b28ae0de8 --- /dev/null +++ b/service/iotdeviceadvisor/doc.go @@ -0,0 +1,16 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package iotdeviceadvisor provides the API client, operations, and parameter +// types for AWS IoT Core Device Advisor. +// +// AWS IoT Core Device Advisor is a cloud-based, fully managed test capability for +// validating IoT devices during device software development. Device Advisor +// provides pre-built tests that you can use to validate IoT devices for reliable +// and secure connectivity with AWS IoT Core before deploying devices to +// production. By using Device Advisor, you can confirm that your devices can +// connect to AWS IoT Core, follow security best practices and, if applicable, +// receive software updates from IoT Device Management. You can also download +// signed qualification reports to submit to the AWS Partner Network to get your +// device qualified for the AWS Partner Device Catalog without the need to send +// your device in and wait for it to be tested. +package iotdeviceadvisor diff --git a/service/iotdeviceadvisor/endpoints.go b/service/iotdeviceadvisor/endpoints.go new file mode 100644 index 00000000000..204fdcee020 --- /dev/null +++ b/service/iotdeviceadvisor/endpoints.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdeviceadvisor + +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/iotdeviceadvisor/internal/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/url" +) + +// 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() +} + +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") + } + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), m.Options) + 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 = "iotdeviceadvisor" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + 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.EndpointResolver + 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) + 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) +} + +// 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. +// awsResolver and fallbackResolver must not be nil +func WithEndpointResolver(awsResolver aws.EndpointResolver, fallbackResolver EndpointResolver) EndpointResolver { + return &wrappedEndpointResolver{ + awsResolver: awsResolver, + resolver: fallbackResolver, + } +} diff --git a/service/iotdeviceadvisor/go.mod b/service/iotdeviceadvisor/go.mod new file mode 100644 index 00000000000..c1cdb52044a --- /dev/null +++ b/service/iotdeviceadvisor/go.mod @@ -0,0 +1,10 @@ +module github.com/aws/aws-sdk-go-v2/service/iotdeviceadvisor + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v0.30.1-0.20201222223005-ee883de66531 + github.com/aws/smithy-go v0.4.1-0.20201222001052-74df8ddd8c79 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/iotdeviceadvisor/go.sum b/service/iotdeviceadvisor/go.sum new file mode 100644 index 00000000000..934e2b5c702 --- /dev/null +++ b/service/iotdeviceadvisor/go.sum @@ -0,0 +1,14 @@ +github.com/aws/smithy-go v0.4.1-0.20201222001052-74df8ddd8c79 h1:Ufuk/0gkbBZVZ7jlujsyzn5ruWhdTFBcZDCVIy60tsQ= +github.com/aws/smithy-go v0.4.1-0.20201222001052-74df8ddd8c79/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/iotdeviceadvisor/internal/endpoints/endpoints.go b/service/iotdeviceadvisor/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..20c997a6b88 --- /dev/null +++ b/service/iotdeviceadvisor/internal/endpoints/endpoints.go @@ -0,0 +1,91 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + DisableHTTPS bool +} + +// Resolver IotDeviceAdvisor 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 := endpoints.Options{ + DisableHTTPS: options.DisableHTTPS, + } + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: endpoints.Endpoint{ + Hostname: "iotdeviceadvisor.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-cn", + Defaults: endpoints.Endpoint{ + Hostname: "iotdeviceadvisor.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: endpoints.Endpoint{ + Hostname: "iotdeviceadvisor.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: endpoints.Endpoint{ + Hostname: "iotdeviceadvisor.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: endpoints.Endpoint{ + Hostname: "iotdeviceadvisor.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, +} diff --git a/service/iotdeviceadvisor/internal/endpoints/endpoints_test.go b/service/iotdeviceadvisor/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/iotdeviceadvisor/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/iotdeviceadvisor/protocol_test.go b/service/iotdeviceadvisor/protocol_test.go new file mode 100644 index 00000000000..93290599b04 --- /dev/null +++ b/service/iotdeviceadvisor/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdeviceadvisor diff --git a/service/iotdeviceadvisor/serializers.go b/service/iotdeviceadvisor/serializers.go new file mode 100644 index 00000000000..6ef6df0099b --- /dev/null +++ b/service/iotdeviceadvisor/serializers.go @@ -0,0 +1,1091 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdeviceadvisor + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/iotdeviceadvisor/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_serializeOpCreateSuiteDefinition struct { +} + +func (*awsRestjson1_serializeOpCreateSuiteDefinition) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateSuiteDefinition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateSuiteDefinitionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/suiteDefinitions") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpDocumentCreateSuiteDefinitionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateSuiteDefinitionInput(v *CreateSuiteDefinitionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateSuiteDefinitionInput(v *CreateSuiteDefinitionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SuiteDefinitionConfiguration != nil { + ok := object.Key("suiteDefinitionConfiguration") + if err := awsRestjson1_serializeDocumentSuiteDefinitionConfiguration(v.SuiteDefinitionConfiguration, 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_serializeOpDeleteSuiteDefinition struct { +} + +func (*awsRestjson1_serializeOpDeleteSuiteDefinition) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteSuiteDefinition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteSuiteDefinitionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/suiteDefinitions/{suiteDefinitionId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteSuiteDefinitionInput(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_serializeOpHttpBindingsDeleteSuiteDefinitionInput(v *DeleteSuiteDefinitionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SuiteDefinitionId == nil || len(*v.SuiteDefinitionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member suiteDefinitionId must not be empty")} + } + if v.SuiteDefinitionId != nil { + if err := encoder.SetURI("suiteDefinitionId").String(*v.SuiteDefinitionId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSuiteDefinition struct { +} + +func (*awsRestjson1_serializeOpGetSuiteDefinition) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSuiteDefinition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetSuiteDefinitionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/suiteDefinitions/{suiteDefinitionId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetSuiteDefinitionInput(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_serializeOpHttpBindingsGetSuiteDefinitionInput(v *GetSuiteDefinitionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SuiteDefinitionId == nil || len(*v.SuiteDefinitionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member suiteDefinitionId must not be empty")} + } + if v.SuiteDefinitionId != nil { + if err := encoder.SetURI("suiteDefinitionId").String(*v.SuiteDefinitionId); err != nil { + return err + } + } + + if v.SuiteDefinitionVersion != nil { + encoder.SetQuery("suiteDefinitionVersion").String(*v.SuiteDefinitionVersion) + } + + return nil +} + +type awsRestjson1_serializeOpGetSuiteRun struct { +} + +func (*awsRestjson1_serializeOpGetSuiteRun) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSuiteRun) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetSuiteRunInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/suiteDefinitions/{suiteDefinitionId}/suiteRuns/{suiteRunId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetSuiteRunInput(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_serializeOpHttpBindingsGetSuiteRunInput(v *GetSuiteRunInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SuiteDefinitionId == nil || len(*v.SuiteDefinitionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member suiteDefinitionId must not be empty")} + } + if v.SuiteDefinitionId != nil { + if err := encoder.SetURI("suiteDefinitionId").String(*v.SuiteDefinitionId); err != nil { + return err + } + } + + if v.SuiteRunId == nil || len(*v.SuiteRunId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member suiteRunId must not be empty")} + } + if v.SuiteRunId != nil { + if err := encoder.SetURI("suiteRunId").String(*v.SuiteRunId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSuiteRunReport struct { +} + +func (*awsRestjson1_serializeOpGetSuiteRunReport) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSuiteRunReport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetSuiteRunReportInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/suiteDefinitions/{suiteDefinitionId}/suiteRuns/{suiteRunId}/report") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetSuiteRunReportInput(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_serializeOpHttpBindingsGetSuiteRunReportInput(v *GetSuiteRunReportInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SuiteDefinitionId == nil || len(*v.SuiteDefinitionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member suiteDefinitionId must not be empty")} + } + if v.SuiteDefinitionId != nil { + if err := encoder.SetURI("suiteDefinitionId").String(*v.SuiteDefinitionId); err != nil { + return err + } + } + + if v.SuiteRunId == nil || len(*v.SuiteRunId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member suiteRunId must not be empty")} + } + if v.SuiteRunId != nil { + if err := encoder.SetURI("suiteRunId").String(*v.SuiteRunId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListSuiteDefinitions struct { +} + +func (*awsRestjson1_serializeOpListSuiteDefinitions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSuiteDefinitions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListSuiteDefinitionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/suiteDefinitions") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListSuiteDefinitionsInput(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_serializeOpHttpBindingsListSuiteDefinitionsInput(v *ListSuiteDefinitionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListSuiteRuns struct { +} + +func (*awsRestjson1_serializeOpListSuiteRuns) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSuiteRuns) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListSuiteRunsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/suiteRuns") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListSuiteRunsInput(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_serializeOpHttpBindingsListSuiteRunsInput(v *ListSuiteRunsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.SuiteDefinitionId != nil { + encoder.SetQuery("suiteDefinitionId").String(*v.SuiteDefinitionId) + } + + if v.SuiteDefinitionVersion != nil { + encoder.SetQuery("suiteDefinitionVersion").String(*v.SuiteDefinitionVersion) + } + + 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 = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpListTestCases struct { +} + +func (*awsRestjson1_serializeOpListTestCases) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTestCases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTestCasesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/testCases") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListTestCasesInput(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_serializeOpHttpBindingsListTestCasesInput(v *ListTestCasesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.IntendedForQualification { + encoder.SetQuery("intendedForQualification").Boolean(v.IntendedForQualification) + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpStartSuiteRun struct { +} + +func (*awsRestjson1_serializeOpStartSuiteRun) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartSuiteRun) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartSuiteRunInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/suiteDefinitions/{suiteDefinitionId}/suiteRuns") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsStartSuiteRunInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentStartSuiteRunInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsStartSuiteRunInput(v *StartSuiteRunInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SuiteDefinitionId == nil || len(*v.SuiteDefinitionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member suiteDefinitionId must not be empty")} + } + if v.SuiteDefinitionId != nil { + if err := encoder.SetURI("suiteDefinitionId").String(*v.SuiteDefinitionId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartSuiteRunInput(v *StartSuiteRunInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SuiteDefinitionVersion != nil { + ok := object.Key("suiteDefinitionVersion") + ok.String(*v.SuiteDefinitionVersion) + } + + if v.SuiteRunConfiguration != nil { + ok := object.Key("suiteRunConfiguration") + if err := awsRestjson1_serializeDocumentSuiteRunConfiguration(v.SuiteRunConfiguration, 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_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 = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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 = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpUpdateSuiteDefinition struct { +} + +func (*awsRestjson1_serializeOpUpdateSuiteDefinition) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateSuiteDefinition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateSuiteDefinitionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/suiteDefinitions/{suiteDefinitionId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsUpdateSuiteDefinitionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateSuiteDefinitionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateSuiteDefinitionInput(v *UpdateSuiteDefinitionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SuiteDefinitionId == nil || len(*v.SuiteDefinitionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member suiteDefinitionId must not be empty")} + } + if v.SuiteDefinitionId != nil { + if err := encoder.SetURI("suiteDefinitionId").String(*v.SuiteDefinitionId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateSuiteDefinitionInput(v *UpdateSuiteDefinitionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SuiteDefinitionConfiguration != nil { + ok := object.Key("suiteDefinitionConfiguration") + if err := awsRestjson1_serializeDocumentSuiteDefinitionConfiguration(v.SuiteDefinitionConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentDeviceUnderTest(v *types.DeviceUnderTest, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CertificateArn != nil { + ok := object.Key("certificateArn") + ok.String(*v.CertificateArn) + } + + if v.ThingArn != nil { + ok := object.Key("thingArn") + ok.String(*v.ThingArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentDeviceUnderTestList(v []types.DeviceUnderTest, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentDeviceUnderTest(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentSelectedTestList(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_serializeDocumentSuiteDefinitionConfiguration(v *types.SuiteDefinitionConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DevicePermissionRoleArn != nil { + ok := object.Key("devicePermissionRoleArn") + ok.String(*v.DevicePermissionRoleArn) + } + + if v.Devices != nil { + ok := object.Key("devices") + if err := awsRestjson1_serializeDocumentDeviceUnderTestList(v.Devices, ok); err != nil { + return err + } + } + + if v.IntendedForQualification { + ok := object.Key("intendedForQualification") + ok.Boolean(v.IntendedForQualification) + } + + if v.RootGroup != nil { + ok := object.Key("rootGroup") + ok.String(*v.RootGroup) + } + + if v.SuiteDefinitionName != nil { + ok := object.Key("suiteDefinitionName") + ok.String(*v.SuiteDefinitionName) + } + + return nil +} + +func awsRestjson1_serializeDocumentSuiteRunConfiguration(v *types.SuiteRunConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PrimaryDevice != nil { + ok := object.Key("primaryDevice") + if err := awsRestjson1_serializeDocumentDeviceUnderTest(v.PrimaryDevice, ok); err != nil { + return err + } + } + + if v.SecondaryDevice != nil { + ok := object.Key("secondaryDevice") + if err := awsRestjson1_serializeDocumentDeviceUnderTest(v.SecondaryDevice, ok); err != nil { + return err + } + } + + if v.SelectedTestList != nil { + ok := object.Key("selectedTestList") + if err := awsRestjson1_serializeDocumentSelectedTestList(v.SelectedTestList, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} diff --git a/service/iotdeviceadvisor/types/enums.go b/service/iotdeviceadvisor/types/enums.go new file mode 100644 index 00000000000..d764f66d770 --- /dev/null +++ b/service/iotdeviceadvisor/types/enums.go @@ -0,0 +1,59 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type Status string + +// Enum values for Status +const ( + StatusPass Status = "PASS" + StatusFail Status = "FAIL" + StatusCanceled Status = "CANCELED" + StatusPending Status = "PENDING" + StatusRunning Status = "RUNNING" + StatusPassWithWarnings Status = "PASS_WITH_WARNINGS" + StatusError Status = "ERROR" +) + +// Values returns all known values for Status. 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 (Status) Values() []Status { + return []Status{ + "PASS", + "FAIL", + "CANCELED", + "PENDING", + "RUNNING", + "PASS_WITH_WARNINGS", + "ERROR", + } +} + +type SuiteRunStatus string + +// Enum values for SuiteRunStatus +const ( + SuiteRunStatusPass SuiteRunStatus = "PASS" + SuiteRunStatusFail SuiteRunStatus = "FAIL" + SuiteRunStatusCanceled SuiteRunStatus = "CANCELED" + SuiteRunStatusPending SuiteRunStatus = "PENDING" + SuiteRunStatusRunning SuiteRunStatus = "RUNNING" + SuiteRunStatusPassWithWarnings SuiteRunStatus = "PASS_WITH_WARNINGS" + SuiteRunStatusError SuiteRunStatus = "ERROR" +) + +// Values returns all known values for SuiteRunStatus. 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 (SuiteRunStatus) Values() []SuiteRunStatus { + return []SuiteRunStatus{ + "PASS", + "FAIL", + "CANCELED", + "PENDING", + "RUNNING", + "PASS_WITH_WARNINGS", + "ERROR", + } +} diff --git a/service/iotdeviceadvisor/types/errors.go b/service/iotdeviceadvisor/types/errors.go new file mode 100644 index 00000000000..a2de1766d38 --- /dev/null +++ b/service/iotdeviceadvisor/types/errors.go @@ -0,0 +1,76 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// Sends Conflict Exception. +type ConflictException struct { + Message *string +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { return "ConflictException" } +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Sends Internal Failure Exception. +type InternalServerException struct { + Message *string +} + +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 { return "InternalServerException" } +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// Sends Resource Not Found Exception. +type ResourceNotFoundException struct { + Message *string +} + +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 { return "ResourceNotFoundException" } +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Sends invalid request exception. +type ValidationException struct { + Message *string +} + +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 { return "ValidationException" } +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/iotdeviceadvisor/types/types.go b/service/iotdeviceadvisor/types/types.go new file mode 100644 index 00000000000..05782f6bf08 --- /dev/null +++ b/service/iotdeviceadvisor/types/types.go @@ -0,0 +1,186 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "time" +) + +// Lists all the devices under test +type DeviceUnderTest struct { + + // Lists devices certificate arn + CertificateArn *string + + // Lists devices thing arn + ThingArn *string +} + +// Show Group Result. +type GroupResult struct { + + // Show Group Result Id. + GroupId *string + + // Show Group Result Name. + GroupName *string + + // Show Group Result. + Tests []TestCaseRun +} + +// Gets Suite Definition Configuration. +type SuiteDefinitionConfiguration struct { + + // Gets device permission arn. + DevicePermissionRoleArn *string + + // Gets the devices configured. + Devices []DeviceUnderTest + + // Gets the tests intended for qualification in a suite. + IntendedForQualification bool + + // Gets test suite root group. + RootGroup *string + + // Gets Suite Definition Configuration name. + SuiteDefinitionName *string +} + +// Get suite definition information. +type SuiteDefinitionInformation struct { + + // Gets the information of when the test suite was created. + CreatedAt *time.Time + + // Specifies the devices under test. + DefaultDevices []DeviceUnderTest + + // Gets the test suites which will be used for qualification. + IntendedForQualification bool + + // Get suite definition Id. + SuiteDefinitionId *string + + // Get test suite name. + SuiteDefinitionName *string +} + +// Gets suite run configuration. +type SuiteRunConfiguration struct { + + // Gets the primary device for suite run. + PrimaryDevice *DeviceUnderTest + + // Gets the secondary device for suite run. + SecondaryDevice *DeviceUnderTest + + // Gets test case list. + SelectedTestList []string +} + +// Get suite run information. +type SuiteRunInformation struct { + + // Get suite run information based on time suite was created. + CreatedAt *time.Time + + // Get suite run information based on end time of the run. + EndAt *time.Time + + // Get suite run information based on result of the test suite run. + Failed int32 + + // Get suite run information based on result of the test suite run. + Passed int32 + + // Get suite run information based on start time of the run. + StartedAt *time.Time + + // Get suite run information based on test run status. + Status SuiteRunStatus + + // Get suite run information based on suite definition Id. + SuiteDefinitionId *string + + // Get suite run information based on suite definition name. + SuiteDefinitionName *string + + // Get suite run information based on suite definition version. + SuiteDefinitionVersion *string + + // Get suite run information based on suite run Id. + SuiteRunId *string +} + +// Shows tests in a test group. +type TestCase struct { + + // Shows test case configuration. + Configuration map[string]string + + // Shows test case name. + Name *string + + // Specifies a test. + Test *TestCaseDefinition +} + +// Gets the test case category. +type TestCaseCategory struct { + + // Lists all the tests name in the specified category. + Name *string + + // Lists all the tests in the specified category. + Tests []TestCase +} + +// Provides test case definition. +type TestCaseDefinition struct { + + // Provides test case definition Id. + Id *string + + // Provides test case definition version. + TestCaseVersion *string +} + +// Provides test case run. +type TestCaseRun struct { + + // Provides test case run end time. + EndTime *time.Time + + // Provides test case run failure result. + Failure *string + + // Provides test case run log Url. + LogUrl *string + + // Provides test case run start time. + StartTime *time.Time + + // Provides test case run status. + Status Status + + // Provides test case run definition Id. + TestCaseDefinitionId *string + + // Provides test case run definition Name. + TestCaseDefinitionName *string + + // Provides test case run Id. + TestCaseRunId *string + + // Provides test case run warnings. + Warnings *string +} + +// Show each group result. +type TestResult struct { + + // Show each group of test results. + Groups []GroupResult +} diff --git a/service/iotdeviceadvisor/validators.go b/service/iotdeviceadvisor/validators.go new file mode 100644 index 00000000000..6baad501dd6 --- /dev/null +++ b/service/iotdeviceadvisor/validators.go @@ -0,0 +1,373 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotdeviceadvisor + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpDeleteSuiteDefinition struct { +} + +func (*validateOpDeleteSuiteDefinition) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteSuiteDefinition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteSuiteDefinitionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteSuiteDefinitionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSuiteDefinition struct { +} + +func (*validateOpGetSuiteDefinition) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSuiteDefinition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSuiteDefinitionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSuiteDefinitionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSuiteRun struct { +} + +func (*validateOpGetSuiteRun) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSuiteRun) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSuiteRunInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSuiteRunInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSuiteRunReport struct { +} + +func (*validateOpGetSuiteRunReport) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSuiteRunReport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSuiteRunReportInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSuiteRunReportInput(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 validateOpStartSuiteRun struct { +} + +func (*validateOpStartSuiteRun) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartSuiteRun) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartSuiteRunInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartSuiteRunInput(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 validateOpUpdateSuiteDefinition struct { +} + +func (*validateOpUpdateSuiteDefinition) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateSuiteDefinition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateSuiteDefinitionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateSuiteDefinitionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpDeleteSuiteDefinitionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteSuiteDefinition{}, middleware.After) +} + +func addOpGetSuiteDefinitionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSuiteDefinition{}, middleware.After) +} + +func addOpGetSuiteRunValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSuiteRun{}, middleware.After) +} + +func addOpGetSuiteRunReportValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSuiteRunReport{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpStartSuiteRunValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartSuiteRun{}, 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 addOpUpdateSuiteDefinitionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateSuiteDefinition{}, middleware.After) +} + +func validateOpDeleteSuiteDefinitionInput(v *DeleteSuiteDefinitionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteSuiteDefinitionInput"} + if v.SuiteDefinitionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SuiteDefinitionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSuiteDefinitionInput(v *GetSuiteDefinitionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSuiteDefinitionInput"} + if v.SuiteDefinitionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SuiteDefinitionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSuiteRunInput(v *GetSuiteRunInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSuiteRunInput"} + if v.SuiteDefinitionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SuiteDefinitionId")) + } + if v.SuiteRunId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SuiteRunId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSuiteRunReportInput(v *GetSuiteRunReportInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSuiteRunReportInput"} + if v.SuiteDefinitionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SuiteDefinitionId")) + } + if v.SuiteRunId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SuiteRunId")) + } + 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 validateOpStartSuiteRunInput(v *StartSuiteRunInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartSuiteRunInput"} + if v.SuiteDefinitionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SuiteDefinitionId")) + } + 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 validateOpUpdateSuiteDefinitionInput(v *UpdateSuiteDefinitionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateSuiteDefinitionInput"} + if v.SuiteDefinitionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SuiteDefinitionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/iotfleethub/LICENSE.txt b/service/iotfleethub/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/iotfleethub/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/service/iotfleethub/api_client.go b/service/iotfleethub/api_client.go new file mode 100644 index 00000000000..16aa9d9144d --- /dev/null +++ b/service/iotfleethub/api_client.go @@ -0,0 +1,254 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleethub + +import ( + "context" + cryptorand "crypto/rand" + "github.com/aws/aws-sdk-go-v2/aws" + 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" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyrand "github.com/aws/smithy-go/rand" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "time" +) + +const ServiceID = "IoTFleetHub" +const ServiceAPIVersion = "2020-11-03" + +// Client provides the API client to make operations call for AWS IoT Fleet Hub. +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) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveDefaultEndpointConfiguration(&options) + + resolveIdempotencyTokenProvider(&options) + + for _, fn := range optFns { + fn(&options) + } + + client := &Client{ + options: options, + } + + return client +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + EndpointResolver EndpointResolver + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // Provides idempotency tokens values that will be automatically populated into + // idempotent API operations. + IdempotencyTokenProvider IdempotencyTokenProvider + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. + Retryer retry.Retryer + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient +} + +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) { + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + for _, fn := range optFns { + fn(&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 +} + +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) +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + Retryer: cfg.Retryer, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + } + resolveAWSEndpointResolver(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + if o.HTTPClient != nil { + return + } + o.HTTPClient = awshttp.NewBuildableClient() +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + o.Retryer = retry.NewStandard() +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil { + return + } + o.EndpointResolver = WithEndpointResolver(cfg.EndpointResolver, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddUserAgentKey("iotfleethub")(stack) +} + +func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: o.Credentials, + Signer: o.HTTPSignerV4, + LogSigning: o.ClientLogMode.IsSigning(), + }) + return stack.Finalize.Add(mw, middleware.After) +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func resolveIdempotencyTokenProvider(o *Options) { + if o.IdempotencyTokenProvider != nil { + return + } + o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) +} + +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// IdempotencyTokenProvider interface for providing idempotency token +type IdempotencyTokenProvider interface { + GetIdempotencyToken() (string, error) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} diff --git a/service/iotfleethub/api_op_CreateApplication.go b/service/iotfleethub/api_op_CreateApplication.go new file mode 100644 index 00000000000..29099631c58 --- /dev/null +++ b/service/iotfleethub/api_op_CreateApplication.go @@ -0,0 +1,177 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleethub + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a Fleet Hub for AWS IoT Device Management web application. Fleet Hub for +// AWS IoT Device Management is in public preview and is subject to change. +func (c *Client) CreateApplication(ctx context.Context, params *CreateApplicationInput, optFns ...func(*Options)) (*CreateApplicationOutput, error) { + if params == nil { + params = &CreateApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateApplication", params, optFns, addOperationCreateApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateApplicationInput struct { + + // The name of the web application. + // + // This member is required. + ApplicationName *string + + // The ARN of the role that the web application assumes when it interacts with AWS + // IoT Core. The name of the role must be in the form AWSIotFleetHub_random_string + // . + // + // This member is required. + RoleArn *string + + // An optional description of the web application. + ApplicationDescription *string + + // A unique case-sensitive identifier that you can provide to ensure the + // idempotency of the request. Don't reuse this client token if a new idempotent + // request is required. + ClientToken *string + + // A set of key/value pairs that you can use to manage the web application + // resource. + Tags map[string]string +} + +type CreateApplicationOutput struct { + + // The ARN of the web application. + // + // This member is required. + ApplicationArn *string + + // The unique Id of the web application. + // + // This member is required. + ApplicationId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCreateApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateApplication{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opCreateApplicationMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateApplication(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateApplication struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateApplication) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateApplication) 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.(*CreateApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateApplicationInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateApplicationMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateApplication{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotfleethub", + OperationName: "CreateApplication", + } +} diff --git a/service/iotfleethub/api_op_DeleteApplication.go b/service/iotfleethub/api_op_DeleteApplication.go new file mode 100644 index 00000000000..2e9a0d0439a --- /dev/null +++ b/service/iotfleethub/api_op_DeleteApplication.go @@ -0,0 +1,152 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleethub + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a Fleet Hub for AWS IoT Device Management web application. Fleet Hub for +// AWS IoT Device Management is in public preview and is subject to change. +func (c *Client) DeleteApplication(ctx context.Context, params *DeleteApplicationInput, optFns ...func(*Options)) (*DeleteApplicationOutput, error) { + if params == nil { + params = &DeleteApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteApplication", params, optFns, addOperationDeleteApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteApplicationInput struct { + + // The unique Id of the web application. + // + // This member is required. + ApplicationId *string + + // A unique case-sensitive identifier that you can provide to ensure the + // idempotency of the request. Don't reuse this client token if a new idempotent + // request is required. + ClientToken *string +} + +type DeleteApplicationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteApplication{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opDeleteApplicationMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteApplication(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpDeleteApplication struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpDeleteApplication) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpDeleteApplication) 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.(*DeleteApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteApplicationInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opDeleteApplicationMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteApplication{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opDeleteApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotfleethub", + OperationName: "DeleteApplication", + } +} diff --git a/service/iotfleethub/api_op_DescribeApplication.go b/service/iotfleethub/api_op_DescribeApplication.go new file mode 100644 index 00000000000..fb477d6dd95 --- /dev/null +++ b/service/iotfleethub/api_op_DescribeApplication.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleethub + +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/iotfleethub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets information about a Fleet Hub for AWS IoT Device Management web +// application. Fleet Hub for AWS IoT Device Management is in public preview and is +// subject to change. +func (c *Client) DescribeApplication(ctx context.Context, params *DescribeApplicationInput, optFns ...func(*Options)) (*DescribeApplicationOutput, error) { + if params == nil { + params = &DescribeApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeApplication", params, optFns, addOperationDescribeApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeApplicationInput struct { + + // The unique Id of the web application. + // + // This member is required. + ApplicationId *string +} + +type DescribeApplicationOutput struct { + + // The ARN of the web application. + // + // This member is required. + ApplicationArn *string + + // The date (in Unix epoch time) when the application was created. + // + // This member is required. + ApplicationCreationDate int64 + + // The unique Id of the web application. + // + // This member is required. + ApplicationId *string + + // The date (in Unix epoch time) when the application was last updated. + // + // This member is required. + ApplicationLastUpdateDate int64 + + // The name of the web application. + // + // This member is required. + ApplicationName *string + + // The current state of the web application. + // + // This member is required. + ApplicationState types.ApplicationState + + // The URL of the web application. + // + // This member is required. + ApplicationUrl *string + + // The ARN of the role that the web application assumes when it interacts with AWS + // IoT Core. + // + // This member is required. + RoleArn *string + + // An optional description of the web application. + ApplicationDescription *string + + // A message indicating why the DescribeApplication API failed. + ErrorMessage *string + + // The Id of the single sign-on client that you use to authenticate and authorize + // users on the web application. + SsoClientId *string + + // A set of key/value pairs that you can use to manage the web application + // resource. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDescribeApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeApplication{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeApplication(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDescribeApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotfleethub", + OperationName: "DescribeApplication", + } +} diff --git a/service/iotfleethub/api_op_ListApplications.go b/service/iotfleethub/api_op_ListApplications.go new file mode 100644 index 00000000000..78b8eb3336c --- /dev/null +++ b/service/iotfleethub/api_op_ListApplications.go @@ -0,0 +1,190 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleethub + +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/iotfleethub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets a list of Fleet Hub for AWS IoT Device Management web applications for the +// current account. Fleet Hub for AWS IoT Device Management is in public preview +// and is subject to change. +func (c *Client) ListApplications(ctx context.Context, params *ListApplicationsInput, optFns ...func(*Options)) (*ListApplicationsOutput, error) { + if params == nil { + params = &ListApplicationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListApplications", params, optFns, addOperationListApplicationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListApplicationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListApplicationsInput struct { + + // A token used to get the next set of results. + NextToken *string +} + +type ListApplicationsOutput struct { + + // An array of objects that provide summaries of information about the web + // applications in the list. + ApplicationSummaries []types.ApplicationSummary + + // A token used to get the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListApplicationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListApplications{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListApplications{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListApplications(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListApplicationsAPIClient is a client that implements the ListApplications +// operation. +type ListApplicationsAPIClient interface { + ListApplications(context.Context, *ListApplicationsInput, ...func(*Options)) (*ListApplicationsOutput, error) +} + +var _ ListApplicationsAPIClient = (*Client)(nil) + +// ListApplicationsPaginatorOptions is the paginator options for ListApplications +type ListApplicationsPaginatorOptions 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 +} + +// ListApplicationsPaginator is a paginator for ListApplications +type ListApplicationsPaginator struct { + options ListApplicationsPaginatorOptions + client ListApplicationsAPIClient + params *ListApplicationsInput + nextToken *string + firstPage bool +} + +// NewListApplicationsPaginator returns a new ListApplicationsPaginator +func NewListApplicationsPaginator(client ListApplicationsAPIClient, params *ListApplicationsInput, optFns ...func(*ListApplicationsPaginatorOptions)) *ListApplicationsPaginator { + options := ListApplicationsPaginatorOptions{} + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListApplicationsInput{} + } + + return &ListApplicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListApplicationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListApplications page. +func (p *ListApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListApplicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + result, err := p.client.ListApplications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListApplications(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotfleethub", + OperationName: "ListApplications", + } +} diff --git a/service/iotfleethub/api_op_ListTagsForResource.go b/service/iotfleethub/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..74dc15d6d4b --- /dev/null +++ b/service/iotfleethub/api_op_ListTagsForResource.go @@ -0,0 +1,114 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleethub + +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 the tags for the specified resource. Fleet Hub for AWS IoT Device +// Management is in public preview and is subject to change. +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, 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 +} + +type ListTagsForResourceOutput struct { + + // The list of tags assigned to the resource. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "iotfleethub", + OperationName: "ListTagsForResource", + } +} diff --git a/service/iotfleethub/api_op_TagResource.go b/service/iotfleethub/api_op_TagResource.go new file mode 100644 index 00000000000..d820b6843e9 --- /dev/null +++ b/service/iotfleethub/api_op_TagResource.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleethub + +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 to or modifies the tags of the specified resource. Tags are metadata which +// can be used to manage a resource. Fleet Hub for AWS IoT Device Management is in +// public preview and is subject to change. +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, 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 new or modified tags for the resource. + // + // This member is required. + Tags map[string]string +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "iotfleethub", + OperationName: "TagResource", + } +} diff --git a/service/iotfleethub/api_op_UntagResource.go b/service/iotfleethub/api_op_UntagResource.go new file mode 100644 index 00000000000..c626e13caca --- /dev/null +++ b/service/iotfleethub/api_op_UntagResource.go @@ -0,0 +1,115 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleethub + +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 (metadata) from the resource. Fleet Hub for AWS IoT +// Device Management is in public preview and is subject to change. +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, 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 the keys of the tags to be removed from the resource. + // + // This member is required. + TagKeys []string +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "iotfleethub", + OperationName: "UntagResource", + } +} diff --git a/service/iotfleethub/api_op_UpdateApplication.go b/service/iotfleethub/api_op_UpdateApplication.go new file mode 100644 index 00000000000..bfcda041dc7 --- /dev/null +++ b/service/iotfleethub/api_op_UpdateApplication.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleethub + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates information about a Fleet Hub for a AWS IoT Device Management web +// application. Fleet Hub for AWS IoT Device Management is in public preview and is +// subject to change. +func (c *Client) UpdateApplication(ctx context.Context, params *UpdateApplicationInput, optFns ...func(*Options)) (*UpdateApplicationOutput, error) { + if params == nil { + params = &UpdateApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateApplication", params, optFns, addOperationUpdateApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateApplicationInput struct { + + // The unique Id of the web application. + // + // This member is required. + ApplicationId *string + + // An optional description of the web application. + ApplicationDescription *string + + // The name of the web application. + ApplicationName *string + + // A unique case-sensitive identifier that you can provide to ensure the + // idempotency of the request. Don't reuse this client token if a new idempotent + // request is required. + ClientToken *string +} + +type UpdateApplicationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationUpdateApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateApplication{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opUpdateApplicationMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdateApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateApplication(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpUpdateApplication struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpUpdateApplication) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpUpdateApplication) 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.(*UpdateApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateApplicationInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opUpdateApplicationMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateApplication{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opUpdateApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotfleethub", + OperationName: "UpdateApplication", + } +} diff --git a/service/iotfleethub/deserializers.go b/service/iotfleethub/deserializers.go new file mode 100644 index 00000000000..cabf27784ac --- /dev/null +++ b/service/iotfleethub/deserializers.go @@ -0,0 +1,1759 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleethub + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/iotfleethub/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "strings" +) + +type awsRestjson1_deserializeOpCreateApplication struct { +} + +func (*awsRestjson1_deserializeOpCreateApplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateApplication(response, &metadata) + } + output := &CreateApplicationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateApplicationOutput(&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_deserializeOpErrorCreateApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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_deserializeOpDocumentCreateApplicationOutput(v **CreateApplicationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateApplicationOutput + if *v == nil { + sv = &CreateApplicationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "applicationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ApplicationArn = ptr.String(jtv) + } + + case "applicationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.ApplicationId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteApplication struct { +} + +func (*awsRestjson1_deserializeOpDeleteApplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteApplication(response, &metadata) + } + output := &DeleteApplicationOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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_deserializeOpDescribeApplication struct { +} + +func (*awsRestjson1_deserializeOpDescribeApplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDescribeApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDescribeApplication(response, &metadata) + } + output := &DescribeApplicationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentDescribeApplicationOutput(&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_deserializeOpErrorDescribeApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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_deserializeOpDocumentDescribeApplicationOutput(v **DescribeApplicationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeApplicationOutput + if *v == nil { + sv = &DescribeApplicationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "applicationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ApplicationArn = ptr.String(jtv) + } + + case "applicationCreationDate": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ApplicationCreationDate = i64 + } + + case "applicationDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.ApplicationDescription = ptr.String(jtv) + } + + case "applicationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.ApplicationId = ptr.String(jtv) + } + + case "applicationLastUpdateDate": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ApplicationLastUpdateDate = i64 + } + + case "applicationName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.ApplicationName = ptr.String(jtv) + } + + case "applicationState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApplicationState to be of type string, got %T instead", value) + } + sv.ApplicationState = types.ApplicationState(jtv) + } + + case "applicationUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Url to be of type string, got %T instead", value) + } + sv.ApplicationUrl = ptr.String(jtv) + } + + case "errorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + case "roleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.RoleArn = ptr.String(jtv) + } + + case "ssoClientId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SsoClientId to be of type string, got %T instead", value) + } + sv.SsoClientId = 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_deserializeOpListApplications struct { +} + +func (*awsRestjson1_deserializeOpListApplications) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListApplications) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListApplications(response, &metadata) + } + output := &ListApplicationsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListApplicationsOutput(&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_deserializeOpErrorListApplications(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListApplicationsOutput(v **ListApplicationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListApplicationsOutput + if *v == nil { + sv = &ListApplicationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "applicationSummaries": + if err := awsRestjson1_deserializeDocumentApplicationSummaries(&sv.ApplicationSummaries, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(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_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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateApplication struct { +} + +func (*awsRestjson1_deserializeOpUpdateApplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateApplication(response, &metadata) + } + output := &UpdateApplicationOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInternalFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalFailureException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInternalFailureException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidRequestException{} + 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_deserializeDocumentInvalidRequestException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func 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_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_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_deserializeDocumentApplicationSummaries(v *[]types.ApplicationSummary, 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.ApplicationSummary + if *v == nil { + cv = []types.ApplicationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ApplicationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentApplicationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentApplicationSummary(v **types.ApplicationSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ApplicationSummary + if *v == nil { + sv = &types.ApplicationSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "applicationCreationDate": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ApplicationCreationDate = i64 + } + + case "applicationDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.ApplicationDescription = ptr.String(jtv) + } + + case "applicationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.ApplicationId = ptr.String(jtv) + } + + case "applicationLastUpdateDate": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ApplicationLastUpdateDate = i64 + } + + case "applicationName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.ApplicationName = ptr.String(jtv) + } + + case "applicationState": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApplicationState to be of type string, got %T instead", value) + } + sv.ApplicationState = types.ApplicationState(jtv) + } + + case "applicationUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Url to be of type string, got %T instead", value) + } + sv.ApplicationUrl = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInternalFailureException(v **types.InternalFailureException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalFailureException + if *v == nil { + sv = &types.InternalFailureException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidRequestException + if *v == nil { + sv = &types.InvalidRequestException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LimitExceededException + if *v == nil { + sv = &types.LimitExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_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_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "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 +} diff --git a/service/iotfleethub/doc.go b/service/iotfleethub/doc.go new file mode 100644 index 00000000000..f5884bd1b4d --- /dev/null +++ b/service/iotfleethub/doc.go @@ -0,0 +1,9 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package iotfleethub provides the API client, operations, and parameter types for +// AWS IoT Fleet Hub. +// +// With Fleet Hub for AWS IoT Device Management you can build stand-alone web +// applications for monitoring the health of your device fleets. Fleet Hub for AWS +// IoT Device Management is in public preview and is subject to change. +package iotfleethub diff --git a/service/iotfleethub/endpoints.go b/service/iotfleethub/endpoints.go new file mode 100644 index 00000000000..db8a9d43cee --- /dev/null +++ b/service/iotfleethub/endpoints.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleethub + +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/iotfleethub/internal/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/url" +) + +// 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() +} + +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") + } + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), m.Options) + 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 = "iotfleethub" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + 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.EndpointResolver + 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) + 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) +} + +// 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. +// awsResolver and fallbackResolver must not be nil +func WithEndpointResolver(awsResolver aws.EndpointResolver, fallbackResolver EndpointResolver) EndpointResolver { + return &wrappedEndpointResolver{ + awsResolver: awsResolver, + resolver: fallbackResolver, + } +} diff --git a/service/iotfleethub/go.mod b/service/iotfleethub/go.mod new file mode 100644 index 00000000000..50c487bdad6 --- /dev/null +++ b/service/iotfleethub/go.mod @@ -0,0 +1,10 @@ +module github.com/aws/aws-sdk-go-v2/service/iotfleethub + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v0.30.1-0.20201222223005-ee883de66531 + github.com/aws/smithy-go v0.4.1-0.20201222001052-74df8ddd8c79 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/iotfleethub/go.sum b/service/iotfleethub/go.sum new file mode 100644 index 00000000000..934e2b5c702 --- /dev/null +++ b/service/iotfleethub/go.sum @@ -0,0 +1,14 @@ +github.com/aws/smithy-go v0.4.1-0.20201222001052-74df8ddd8c79 h1:Ufuk/0gkbBZVZ7jlujsyzn5ruWhdTFBcZDCVIy60tsQ= +github.com/aws/smithy-go v0.4.1-0.20201222001052-74df8ddd8c79/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/iotfleethub/internal/endpoints/endpoints.go b/service/iotfleethub/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..084c229a24a --- /dev/null +++ b/service/iotfleethub/internal/endpoints/endpoints.go @@ -0,0 +1,91 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + DisableHTTPS bool +} + +// Resolver IoTFleetHub 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 := endpoints.Options{ + DisableHTTPS: options.DisableHTTPS, + } + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: endpoints.Endpoint{ + Hostname: "iotfleethub.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-cn", + Defaults: endpoints.Endpoint{ + Hostname: "iotfleethub.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: endpoints.Endpoint{ + Hostname: "iotfleethub.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: endpoints.Endpoint{ + Hostname: "iotfleethub.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: endpoints.Endpoint{ + Hostname: "iotfleethub.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, +} diff --git a/service/iotfleethub/internal/endpoints/endpoints_test.go b/service/iotfleethub/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/iotfleethub/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/iotfleethub/protocol_test.go b/service/iotfleethub/protocol_test.go new file mode 100644 index 00000000000..47b762dca64 --- /dev/null +++ b/service/iotfleethub/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleethub diff --git a/service/iotfleethub/serializers.go b/service/iotfleethub/serializers.go new file mode 100644 index 00000000000..5caa40939ec --- /dev/null +++ b/service/iotfleethub/serializers.go @@ -0,0 +1,624 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleethub + +import ( + "bytes" + "context" + "fmt" + 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_serializeOpCreateApplication struct { +} + +func (*awsRestjson1_serializeOpCreateApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/applications") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpDocumentCreateApplicationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateApplicationInput(v *CreateApplicationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateApplicationInput(v *CreateApplicationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ApplicationDescription != nil { + ok := object.Key("applicationDescription") + ok.String(*v.ApplicationDescription) + } + + if v.ApplicationName != nil { + ok := object.Key("applicationName") + ok.String(*v.ApplicationName) + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.RoleArn != nil { + ok := object.Key("roleArn") + ok.String(*v.RoleArn) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteApplication struct { +} + +func (*awsRestjson1_serializeOpDeleteApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteApplicationInput(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_serializeOpHttpBindingsDeleteApplicationInput(v *DeleteApplicationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} + } + if v.ApplicationId != nil { + if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { + return err + } + } + + if v.ClientToken != nil { + encoder.SetQuery("clientToken").String(*v.ClientToken) + } + + return nil +} + +type awsRestjson1_serializeOpDescribeApplication struct { +} + +func (*awsRestjson1_serializeOpDescribeApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDescribeApplicationInput(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_serializeOpHttpBindingsDescribeApplicationInput(v *DescribeApplicationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} + } + if v.ApplicationId != nil { + if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListApplications struct { +} + +func (*awsRestjson1_serializeOpListApplications) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListApplications) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListApplicationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/applications") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListApplicationsInput(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_serializeOpHttpBindingsListApplicationsInput(v *ListApplicationsInput, 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) + } + + 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 = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_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 = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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 = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpUpdateApplication struct { +} + +func (*awsRestjson1_serializeOpUpdateApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/applications/{applicationId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsUpdateApplicationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateApplicationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateApplicationInput(v *UpdateApplicationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ApplicationId == nil || len(*v.ApplicationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member applicationId must not be empty")} + } + if v.ApplicationId != nil { + if err := encoder.SetURI("applicationId").String(*v.ApplicationId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateApplicationInput(v *UpdateApplicationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ApplicationDescription != nil { + ok := object.Key("applicationDescription") + ok.String(*v.ApplicationDescription) + } + + if v.ApplicationName != nil { + ok := object.Key("applicationName") + ok.String(*v.ApplicationName) + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + 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 +} diff --git a/service/iotfleethub/types/enums.go b/service/iotfleethub/types/enums.go new file mode 100644 index 00000000000..5f47c627c7c --- /dev/null +++ b/service/iotfleethub/types/enums.go @@ -0,0 +1,27 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type ApplicationState string + +// Enum values for ApplicationState +const ( + ApplicationStateCreating ApplicationState = "CREATING" + ApplicationStateDeleting ApplicationState = "DELETING" + ApplicationStateActive ApplicationState = "ACTIVE" + ApplicationStateCreateFailed ApplicationState = "CREATE_FAILED" + ApplicationStateDeleteFailed ApplicationState = "DELETE_FAILED" +) + +// Values returns all known values for ApplicationState. 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 (ApplicationState) Values() []ApplicationState { + return []ApplicationState{ + "CREATING", + "DELETING", + "ACTIVE", + "CREATE_FAILED", + "DELETE_FAILED", + } +} diff --git a/service/iotfleethub/types/errors.go b/service/iotfleethub/types/errors.go new file mode 100644 index 00000000000..650ed524fad --- /dev/null +++ b/service/iotfleethub/types/errors.go @@ -0,0 +1,110 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// The request conflicts with the current state of the resource. +type ConflictException struct { + Message *string +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { return "ConflictException" } +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// An unexpected error has occurred. +type InternalFailureException struct { + Message *string +} + +func (e *InternalFailureException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalFailureException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalFailureException) ErrorCode() string { return "InternalFailureException" } +func (e *InternalFailureException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The request is not valid. +type InvalidRequestException struct { + Message *string +} + +func (e *InvalidRequestException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidRequestException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidRequestException) ErrorCode() string { return "InvalidRequestException" } +func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// A limit has been exceeded. +type LimitExceededException struct { + Message *string +} + +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 { return "LimitExceededException" } +func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The specified resource does not exist. +type ResourceNotFoundException struct { + Message *string +} + +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 { return "ResourceNotFoundException" } +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The rate exceeds the limit. +type ThrottlingException struct { + Message *string +} + +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 { return "ThrottlingException" } +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/iotfleethub/types/types.go b/service/iotfleethub/types/types.go new file mode 100644 index 00000000000..466c4bbf484 --- /dev/null +++ b/service/iotfleethub/types/types.go @@ -0,0 +1,36 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +// A summary of information about a AWS IoT Device Management web application. +// Fleet Hub for AWS IoT Device Management is in public preview and is subject to +// change. +type ApplicationSummary struct { + + // The unique Id of the web application. + // + // This member is required. + ApplicationId *string + + // The name of the web application. + // + // This member is required. + ApplicationName *string + + // The URL of the web application. + // + // This member is required. + ApplicationUrl *string + + // The date (in Unix epoch time) when the web application was created. + ApplicationCreationDate int64 + + // An optional description of the web application. + ApplicationDescription *string + + // The date (in Unix epoch time) when the web application was last updated. + ApplicationLastUpdateDate int64 + + // The current state of the web application. + ApplicationState ApplicationState +} diff --git a/service/iotfleethub/validators.go b/service/iotfleethub/validators.go new file mode 100644 index 00000000000..9958a512713 --- /dev/null +++ b/service/iotfleethub/validators.go @@ -0,0 +1,292 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleethub + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCreateApplication struct { +} + +func (*validateOpCreateApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteApplication struct { +} + +func (*validateOpDeleteApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeApplication struct { +} + +func (*validateOpDescribeApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListTagsForResource struct { +} + +func (*validateOpListTagsForResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTagsForResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpTagResource struct { +} + +func (*validateOpTagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUntagResource struct { +} + +func (*validateOpUntagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUntagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateApplication struct { +} + +func (*validateOpUpdateApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCreateApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateApplication{}, middleware.After) +} + +func addOpDeleteApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteApplication{}, middleware.After) +} + +func addOpDescribeApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeApplication{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) +} + +func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) +} + +func addOpUpdateApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateApplication{}, middleware.After) +} + +func validateOpCreateApplicationInput(v *CreateApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateApplicationInput"} + if v.ApplicationName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApplicationName")) + } + if v.RoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteApplicationInput(v *DeleteApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteApplicationInput"} + if v.ApplicationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeApplicationInput(v *DescribeApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeApplicationInput"} + if v.ApplicationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTagResourceInput(v *TagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourceInput(v *UntagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateApplicationInput(v *UpdateApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateApplicationInput"} + if v.ApplicationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ApplicationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/iotwireless/LICENSE.txt b/service/iotwireless/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/iotwireless/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/service/iotwireless/api_client.go b/service/iotwireless/api_client.go new file mode 100644 index 00000000000..dc82fb9d241 --- /dev/null +++ b/service/iotwireless/api_client.go @@ -0,0 +1,254 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +import ( + "context" + cryptorand "crypto/rand" + "github.com/aws/aws-sdk-go-v2/aws" + 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" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyrand "github.com/aws/smithy-go/rand" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "time" +) + +const ServiceID = "IoT Wireless" +const ServiceAPIVersion = "2020-11-22" + +// Client provides the API client to make operations call for AWS IoT Wireless. +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) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveDefaultEndpointConfiguration(&options) + + resolveIdempotencyTokenProvider(&options) + + for _, fn := range optFns { + fn(&options) + } + + client := &Client{ + options: options, + } + + return client +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + EndpointResolver EndpointResolver + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // Provides idempotency tokens values that will be automatically populated into + // idempotent API operations. + IdempotencyTokenProvider IdempotencyTokenProvider + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. + Retryer retry.Retryer + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient +} + +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) { + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + for _, fn := range optFns { + fn(&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 +} + +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) +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + Retryer: cfg.Retryer, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + } + resolveAWSEndpointResolver(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + if o.HTTPClient != nil { + return + } + o.HTTPClient = awshttp.NewBuildableClient() +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + o.Retryer = retry.NewStandard() +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil { + return + } + o.EndpointResolver = WithEndpointResolver(cfg.EndpointResolver, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddUserAgentKey("iotwireless")(stack) +} + +func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: o.Credentials, + Signer: o.HTTPSignerV4, + LogSigning: o.ClientLogMode.IsSigning(), + }) + return stack.Finalize.Add(mw, middleware.After) +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func resolveIdempotencyTokenProvider(o *Options) { + if o.IdempotencyTokenProvider != nil { + return + } + o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) +} + +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// IdempotencyTokenProvider interface for providing idempotency token +type IdempotencyTokenProvider interface { + GetIdempotencyToken() (string, error) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} diff --git a/service/iotwireless/api_op_AssociateAwsAccountWithPartnerAccount.go b/service/iotwireless/api_op_AssociateAwsAccountWithPartnerAccount.go new file mode 100644 index 00000000000..0f665267109 --- /dev/null +++ b/service/iotwireless/api_op_AssociateAwsAccountWithPartnerAccount.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Associates a partner account with your AWS account. +func (c *Client) AssociateAwsAccountWithPartnerAccount(ctx context.Context, params *AssociateAwsAccountWithPartnerAccountInput, optFns ...func(*Options)) (*AssociateAwsAccountWithPartnerAccountOutput, error) { + if params == nil { + params = &AssociateAwsAccountWithPartnerAccountInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssociateAwsAccountWithPartnerAccount", params, optFns, addOperationAssociateAwsAccountWithPartnerAccountMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssociateAwsAccountWithPartnerAccountOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssociateAwsAccountWithPartnerAccountInput struct { + + // The Sidewalk account credentials. + // + // This member is required. + Sidewalk *types.SidewalkAccountInfo + + // Each resource must have a unique client request token. If you try to create a + // new resource with the same token as a resource that already exists, an exception + // occurs. If you omit this value, AWS SDKs will automatically generate a unique + // client request. + ClientRequestToken *string +} + +type AssociateAwsAccountWithPartnerAccountOutput struct { + + // The Sidewalk account credentials. + Sidewalk *types.SidewalkAccountInfo + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationAssociateAwsAccountWithPartnerAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociateAwsAccountWithPartnerAccount{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociateAwsAccountWithPartnerAccount{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opAssociateAwsAccountWithPartnerAccountMiddleware(stack, options); err != nil { + return err + } + if err = addOpAssociateAwsAccountWithPartnerAccountValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateAwsAccountWithPartnerAccount(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpAssociateAwsAccountWithPartnerAccount struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpAssociateAwsAccountWithPartnerAccount) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpAssociateAwsAccountWithPartnerAccount) 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.(*AssociateAwsAccountWithPartnerAccountInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *AssociateAwsAccountWithPartnerAccountInput ") + } + + 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_opAssociateAwsAccountWithPartnerAccountMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpAssociateAwsAccountWithPartnerAccount{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opAssociateAwsAccountWithPartnerAccount(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "AssociateAwsAccountWithPartnerAccount", + } +} diff --git a/service/iotwireless/api_op_AssociateWirelessDeviceWithThing.go b/service/iotwireless/api_op_AssociateWirelessDeviceWithThing.go new file mode 100644 index 00000000000..720246b4177 --- /dev/null +++ b/service/iotwireless/api_op_AssociateWirelessDeviceWithThing.go @@ -0,0 +1,114 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Associates a wireless device with a thing. +func (c *Client) AssociateWirelessDeviceWithThing(ctx context.Context, params *AssociateWirelessDeviceWithThingInput, optFns ...func(*Options)) (*AssociateWirelessDeviceWithThingOutput, error) { + if params == nil { + params = &AssociateWirelessDeviceWithThingInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssociateWirelessDeviceWithThing", params, optFns, addOperationAssociateWirelessDeviceWithThingMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssociateWirelessDeviceWithThingOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssociateWirelessDeviceWithThingInput struct { + + // The ID of the resource to update. + // + // This member is required. + Id *string + + // The ARN of the thing to associate with the wireless device. + // + // This member is required. + ThingArn *string +} + +type AssociateWirelessDeviceWithThingOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationAssociateWirelessDeviceWithThingMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociateWirelessDeviceWithThing{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociateWirelessDeviceWithThing{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpAssociateWirelessDeviceWithThingValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateWirelessDeviceWithThing(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opAssociateWirelessDeviceWithThing(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "AssociateWirelessDeviceWithThing", + } +} diff --git a/service/iotwireless/api_op_AssociateWirelessGatewayWithCertificate.go b/service/iotwireless/api_op_AssociateWirelessGatewayWithCertificate.go new file mode 100644 index 00000000000..188a93be6ae --- /dev/null +++ b/service/iotwireless/api_op_AssociateWirelessGatewayWithCertificate.go @@ -0,0 +1,118 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Associates a wireless gateway with a certificate. +func (c *Client) AssociateWirelessGatewayWithCertificate(ctx context.Context, params *AssociateWirelessGatewayWithCertificateInput, optFns ...func(*Options)) (*AssociateWirelessGatewayWithCertificateOutput, error) { + if params == nil { + params = &AssociateWirelessGatewayWithCertificateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssociateWirelessGatewayWithCertificate", params, optFns, addOperationAssociateWirelessGatewayWithCertificateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssociateWirelessGatewayWithCertificateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssociateWirelessGatewayWithCertificateInput struct { + + // The ID of the resource to update. + // + // This member is required. + Id *string + + // The ID of the certificate to associate with the wireless gateway. + // + // This member is required. + IotCertificateId *string +} + +type AssociateWirelessGatewayWithCertificateOutput struct { + + // The ID of the certificate associated with the wireless gateway. + IotCertificateId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationAssociateWirelessGatewayWithCertificateMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociateWirelessGatewayWithCertificate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociateWirelessGatewayWithCertificate{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpAssociateWirelessGatewayWithCertificateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateWirelessGatewayWithCertificate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opAssociateWirelessGatewayWithCertificate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "AssociateWirelessGatewayWithCertificate", + } +} diff --git a/service/iotwireless/api_op_AssociateWirelessGatewayWithThing.go b/service/iotwireless/api_op_AssociateWirelessGatewayWithThing.go new file mode 100644 index 00000000000..9c369a7516d --- /dev/null +++ b/service/iotwireless/api_op_AssociateWirelessGatewayWithThing.go @@ -0,0 +1,114 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Associates a wireless gateway with a thing. +func (c *Client) AssociateWirelessGatewayWithThing(ctx context.Context, params *AssociateWirelessGatewayWithThingInput, optFns ...func(*Options)) (*AssociateWirelessGatewayWithThingOutput, error) { + if params == nil { + params = &AssociateWirelessGatewayWithThingInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssociateWirelessGatewayWithThing", params, optFns, addOperationAssociateWirelessGatewayWithThingMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssociateWirelessGatewayWithThingOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssociateWirelessGatewayWithThingInput struct { + + // The ID of the resource to update. + // + // This member is required. + Id *string + + // The ARN of the thing to associate with the wireless gateway. + // + // This member is required. + ThingArn *string +} + +type AssociateWirelessGatewayWithThingOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationAssociateWirelessGatewayWithThingMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociateWirelessGatewayWithThing{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociateWirelessGatewayWithThing{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpAssociateWirelessGatewayWithThingValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateWirelessGatewayWithThing(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opAssociateWirelessGatewayWithThing(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "AssociateWirelessGatewayWithThing", + } +} diff --git a/service/iotwireless/api_op_CreateDestination.go b/service/iotwireless/api_op_CreateDestination.go new file mode 100644 index 00000000000..d4f8686fa32 --- /dev/null +++ b/service/iotwireless/api_op_CreateDestination.go @@ -0,0 +1,182 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new destination that maps a device message to an AWS IoT rule. +func (c *Client) CreateDestination(ctx context.Context, params *CreateDestinationInput, optFns ...func(*Options)) (*CreateDestinationOutput, error) { + if params == nil { + params = &CreateDestinationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDestination", params, optFns, addOperationCreateDestinationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDestinationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDestinationInput struct { + + // The rule name or topic rule to send messages to. + // + // This member is required. + Expression *string + + // The type of value in Expression. + // + // This member is required. + ExpressionType types.ExpressionType + + // The name of the new resource. + // + // This member is required. + Name *string + + // The ARN of the IAM Role that authorizes the destination. + // + // This member is required. + RoleArn *string + + // Each resource must have a unique client request token. If you try to create a + // new resource with the same token as a resource that already exists, an exception + // occurs. If you omit this value, AWS SDKs will automatically generate a unique + // client request. + ClientRequestToken *string + + // The description of the new resource. + Description *string + + // The tags to attach to the new destination. Tags are metadata that can be used to + // manage a resource. + Tags []types.Tag +} + +type CreateDestinationOutput struct { + + // The Amazon Resource Name of the new resource. + Arn *string + + // The name of the new resource. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCreateDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateDestination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateDestination{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opCreateDestinationMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateDestinationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDestination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateDestination struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateDestination) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateDestination) 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.(*CreateDestinationInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateDestinationInput ") + } + + 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_opCreateDestinationMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateDestination{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateDestination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "CreateDestination", + } +} diff --git a/service/iotwireless/api_op_CreateDeviceProfile.go b/service/iotwireless/api_op_CreateDeviceProfile.go new file mode 100644 index 00000000000..59ee131e675 --- /dev/null +++ b/service/iotwireless/api_op_CreateDeviceProfile.go @@ -0,0 +1,165 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new device profile. +func (c *Client) CreateDeviceProfile(ctx context.Context, params *CreateDeviceProfileInput, optFns ...func(*Options)) (*CreateDeviceProfileOutput, error) { + if params == nil { + params = &CreateDeviceProfileInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDeviceProfile", params, optFns, addOperationCreateDeviceProfileMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDeviceProfileOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDeviceProfileInput struct { + + // Each resource must have a unique client request token. If you try to create a + // new resource with the same token as a resource that already exists, an exception + // occurs. If you omit this value, AWS SDKs will automatically generate a unique + // client request. + ClientRequestToken *string + + // The device profile information to use to create the device profile. + LoRaWAN *types.LoRaWANDeviceProfile + + // The name of the new resource. + Name *string + + // The tags to attach to the new device profile Tags are metadata that can be used + // to manage a resource. + Tags []types.Tag +} + +type CreateDeviceProfileOutput struct { + + // The Amazon Resource Name of the new resource. + Arn *string + + // The ID of the new device profile. + Id *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCreateDeviceProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateDeviceProfile{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateDeviceProfile{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opCreateDeviceProfileMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateDeviceProfileValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDeviceProfile(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateDeviceProfile struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateDeviceProfile) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateDeviceProfile) 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.(*CreateDeviceProfileInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateDeviceProfileInput ") + } + + 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_opCreateDeviceProfileMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateDeviceProfile{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateDeviceProfile(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "CreateDeviceProfile", + } +} diff --git a/service/iotwireless/api_op_CreateServiceProfile.go b/service/iotwireless/api_op_CreateServiceProfile.go new file mode 100644 index 00000000000..90e99b2516f --- /dev/null +++ b/service/iotwireless/api_op_CreateServiceProfile.go @@ -0,0 +1,165 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new service profile. +func (c *Client) CreateServiceProfile(ctx context.Context, params *CreateServiceProfileInput, optFns ...func(*Options)) (*CreateServiceProfileOutput, error) { + if params == nil { + params = &CreateServiceProfileInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateServiceProfile", params, optFns, addOperationCreateServiceProfileMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateServiceProfileOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateServiceProfileInput struct { + + // Each resource must have a unique client request token. If you try to create a + // new resource with the same token as a resource that already exists, an exception + // occurs. If you omit this value, AWS SDKs will automatically generate a unique + // client request. + ClientRequestToken *string + + // The service profile information to use to create the service profile. + LoRaWAN *types.LoRaWANServiceProfile + + // The name of the new resource. + Name *string + + // The tags to attach to the new service profile. Tags are metadata that can be + // used to manage a resource. + Tags []types.Tag +} + +type CreateServiceProfileOutput struct { + + // The Amazon Resource Name of the new resource. + Arn *string + + // The ID of the new service profile. + Id *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCreateServiceProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateServiceProfile{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateServiceProfile{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opCreateServiceProfileMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateServiceProfileValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateServiceProfile(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateServiceProfile struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateServiceProfile) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateServiceProfile) 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.(*CreateServiceProfileInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateServiceProfileInput ") + } + + 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_opCreateServiceProfileMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateServiceProfile{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateServiceProfile(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "CreateServiceProfile", + } +} diff --git a/service/iotwireless/api_op_CreateWirelessDevice.go b/service/iotwireless/api_op_CreateWirelessDevice.go new file mode 100644 index 00000000000..e34a97c6cf1 --- /dev/null +++ b/service/iotwireless/api_op_CreateWirelessDevice.go @@ -0,0 +1,174 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Provisions a wireless device. +func (c *Client) CreateWirelessDevice(ctx context.Context, params *CreateWirelessDeviceInput, optFns ...func(*Options)) (*CreateWirelessDeviceOutput, error) { + if params == nil { + params = &CreateWirelessDeviceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateWirelessDevice", params, optFns, addOperationCreateWirelessDeviceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateWirelessDeviceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateWirelessDeviceInput struct { + + // The name of the destination to assign to the new wireless device. + // + // This member is required. + DestinationName *string + + // The wireless device type. + // + // This member is required. + Type types.WirelessDeviceType + + // Each resource must have a unique client request token. If you try to create a + // new resource with the same token as a resource that already exists, an exception + // occurs. If you omit this value, AWS SDKs will automatically generate a unique + // client request. + ClientRequestToken *string + + // The description of the new resource. + Description *string + + // The device configuration information to use to create the wireless device. + LoRaWAN *types.LoRaWANDevice + + // The name of the new resource. + Name *string +} + +type CreateWirelessDeviceOutput struct { + + // The Amazon Resource Name of the new resource. + Arn *string + + // The ID of the new wireless device. + Id *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCreateWirelessDeviceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateWirelessDevice{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateWirelessDevice{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opCreateWirelessDeviceMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateWirelessDeviceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWirelessDevice(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateWirelessDevice struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateWirelessDevice) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateWirelessDevice) 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.(*CreateWirelessDeviceInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateWirelessDeviceInput ") + } + + 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_opCreateWirelessDeviceMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateWirelessDevice{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateWirelessDevice(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "CreateWirelessDevice", + } +} diff --git a/service/iotwireless/api_op_CreateWirelessGateway.go b/service/iotwireless/api_op_CreateWirelessGateway.go new file mode 100644 index 00000000000..e38be8d8cdf --- /dev/null +++ b/service/iotwireless/api_op_CreateWirelessGateway.go @@ -0,0 +1,170 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Provisions a wireless gateway. +func (c *Client) CreateWirelessGateway(ctx context.Context, params *CreateWirelessGatewayInput, optFns ...func(*Options)) (*CreateWirelessGatewayOutput, error) { + if params == nil { + params = &CreateWirelessGatewayInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateWirelessGateway", params, optFns, addOperationCreateWirelessGatewayMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateWirelessGatewayOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateWirelessGatewayInput struct { + + // The gateway configuration information to use to create the wireless gateway. + // + // This member is required. + LoRaWAN *types.LoRaWANGateway + + // Each resource must have a unique client request token. If you try to create a + // new resource with the same token as a resource that already exists, an exception + // occurs. If you omit this value, AWS SDKs will automatically generate a unique + // client request. + ClientRequestToken *string + + // The description of the new resource. + Description *string + + // The name of the new resource. + Name *string + + // The tags to attach to the new wireless gateway. Tags are metadata that can be + // used to manage a resource. + Tags []types.Tag +} + +type CreateWirelessGatewayOutput struct { + + // The Amazon Resource Name of the new resource. + Arn *string + + // The ID of the new wireless gateway. + Id *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCreateWirelessGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateWirelessGateway{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateWirelessGateway{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opCreateWirelessGatewayMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateWirelessGatewayValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWirelessGateway(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateWirelessGateway struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateWirelessGateway) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateWirelessGateway) 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.(*CreateWirelessGatewayInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateWirelessGatewayInput ") + } + + 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_opCreateWirelessGatewayMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateWirelessGateway{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateWirelessGateway(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "CreateWirelessGateway", + } +} diff --git a/service/iotwireless/api_op_CreateWirelessGatewayTask.go b/service/iotwireless/api_op_CreateWirelessGatewayTask.go new file mode 100644 index 00000000000..38f30fac22b --- /dev/null +++ b/service/iotwireless/api_op_CreateWirelessGatewayTask.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a task for a wireless gateway. +func (c *Client) CreateWirelessGatewayTask(ctx context.Context, params *CreateWirelessGatewayTaskInput, optFns ...func(*Options)) (*CreateWirelessGatewayTaskOutput, error) { + if params == nil { + params = &CreateWirelessGatewayTaskInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateWirelessGatewayTask", params, optFns, addOperationCreateWirelessGatewayTaskMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateWirelessGatewayTaskOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateWirelessGatewayTaskInput struct { + + // The ID of the resource to update. + // + // This member is required. + Id *string + + // The ID of the WirelessGatewayTaskDefinition. + // + // This member is required. + WirelessGatewayTaskDefinitionId *string +} + +type CreateWirelessGatewayTaskOutput struct { + + // The status of the request. + Status types.WirelessGatewayTaskStatus + + // The ID of the WirelessGatewayTaskDefinition. + WirelessGatewayTaskDefinitionId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCreateWirelessGatewayTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateWirelessGatewayTask{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateWirelessGatewayTask{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateWirelessGatewayTaskValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWirelessGatewayTask(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opCreateWirelessGatewayTask(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "CreateWirelessGatewayTask", + } +} diff --git a/service/iotwireless/api_op_CreateWirelessGatewayTaskDefinition.go b/service/iotwireless/api_op_CreateWirelessGatewayTaskDefinition.go new file mode 100644 index 00000000000..6556591a65b --- /dev/null +++ b/service/iotwireless/api_op_CreateWirelessGatewayTaskDefinition.go @@ -0,0 +1,165 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a gateway task definition. +func (c *Client) CreateWirelessGatewayTaskDefinition(ctx context.Context, params *CreateWirelessGatewayTaskDefinitionInput, optFns ...func(*Options)) (*CreateWirelessGatewayTaskDefinitionOutput, error) { + if params == nil { + params = &CreateWirelessGatewayTaskDefinitionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateWirelessGatewayTaskDefinition", params, optFns, addOperationCreateWirelessGatewayTaskDefinitionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateWirelessGatewayTaskDefinitionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateWirelessGatewayTaskDefinitionInput struct { + + // Whether to automatically create tasks using this task definition for all + // gateways with the specified current version. If false, the task must me created + // by calling CreateWirelessGatewayTask. + // + // This member is required. + AutoCreateTasks bool + + // Each resource must have a unique client request token. If you try to create a + // new resource with the same token as a resource that already exists, an exception + // occurs. If you omit this value, AWS SDKs will automatically generate a unique + // client request. + ClientRequestToken *string + + // The name of the new resource. + Name *string + + // Information about the gateways to update. + Update *types.UpdateWirelessGatewayTaskCreate +} + +type CreateWirelessGatewayTaskDefinitionOutput struct { + + // The ID of the new wireless gateway task definition. + Id *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCreateWirelessGatewayTaskDefinitionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateWirelessGatewayTaskDefinition{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateWirelessGatewayTaskDefinition{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opCreateWirelessGatewayTaskDefinitionMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateWirelessGatewayTaskDefinitionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWirelessGatewayTaskDefinition(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateWirelessGatewayTaskDefinition struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateWirelessGatewayTaskDefinition) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateWirelessGatewayTaskDefinition) 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.(*CreateWirelessGatewayTaskDefinitionInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateWirelessGatewayTaskDefinitionInput ") + } + + 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_opCreateWirelessGatewayTaskDefinitionMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateWirelessGatewayTaskDefinition{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateWirelessGatewayTaskDefinition(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "CreateWirelessGatewayTaskDefinition", + } +} diff --git a/service/iotwireless/api_op_DeleteDestination.go b/service/iotwireless/api_op_DeleteDestination.go new file mode 100644 index 00000000000..3fc82711eb9 --- /dev/null +++ b/service/iotwireless/api_op_DeleteDestination.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a destination. +func (c *Client) DeleteDestination(ctx context.Context, params *DeleteDestinationInput, optFns ...func(*Options)) (*DeleteDestinationOutput, error) { + if params == nil { + params = &DeleteDestinationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDestination", params, optFns, addOperationDeleteDestinationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDestinationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDestinationInput struct { + + // The name of the resource to delete. + // + // This member is required. + Name *string +} + +type DeleteDestinationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteDestination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteDestination{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteDestinationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDestination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDeleteDestination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "DeleteDestination", + } +} diff --git a/service/iotwireless/api_op_DeleteDeviceProfile.go b/service/iotwireless/api_op_DeleteDeviceProfile.go new file mode 100644 index 00000000000..4bdf0a05ab5 --- /dev/null +++ b/service/iotwireless/api_op_DeleteDeviceProfile.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a device profile. +func (c *Client) DeleteDeviceProfile(ctx context.Context, params *DeleteDeviceProfileInput, optFns ...func(*Options)) (*DeleteDeviceProfileOutput, error) { + if params == nil { + params = &DeleteDeviceProfileInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDeviceProfile", params, optFns, addOperationDeleteDeviceProfileMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDeviceProfileOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDeviceProfileInput struct { + + // The ID of the resource to delete. + // + // This member is required. + Id *string +} + +type DeleteDeviceProfileOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteDeviceProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteDeviceProfile{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteDeviceProfile{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteDeviceProfileValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDeviceProfile(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDeleteDeviceProfile(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "DeleteDeviceProfile", + } +} diff --git a/service/iotwireless/api_op_DeleteServiceProfile.go b/service/iotwireless/api_op_DeleteServiceProfile.go new file mode 100644 index 00000000000..cdc55b3da4c --- /dev/null +++ b/service/iotwireless/api_op_DeleteServiceProfile.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a service profile. +func (c *Client) DeleteServiceProfile(ctx context.Context, params *DeleteServiceProfileInput, optFns ...func(*Options)) (*DeleteServiceProfileOutput, error) { + if params == nil { + params = &DeleteServiceProfileInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteServiceProfile", params, optFns, addOperationDeleteServiceProfileMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteServiceProfileOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteServiceProfileInput struct { + + // The ID of the resource to delete. + // + // This member is required. + Id *string +} + +type DeleteServiceProfileOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteServiceProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteServiceProfile{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteServiceProfile{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteServiceProfileValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteServiceProfile(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDeleteServiceProfile(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "DeleteServiceProfile", + } +} diff --git a/service/iotwireless/api_op_DeleteWirelessDevice.go b/service/iotwireless/api_op_DeleteWirelessDevice.go new file mode 100644 index 00000000000..0ca7ab1b07a --- /dev/null +++ b/service/iotwireless/api_op_DeleteWirelessDevice.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a wireless device. +func (c *Client) DeleteWirelessDevice(ctx context.Context, params *DeleteWirelessDeviceInput, optFns ...func(*Options)) (*DeleteWirelessDeviceOutput, error) { + if params == nil { + params = &DeleteWirelessDeviceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteWirelessDevice", params, optFns, addOperationDeleteWirelessDeviceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteWirelessDeviceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteWirelessDeviceInput struct { + + // The ID of the resource to delete. + // + // This member is required. + Id *string +} + +type DeleteWirelessDeviceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteWirelessDeviceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteWirelessDevice{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteWirelessDevice{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteWirelessDeviceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteWirelessDevice(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDeleteWirelessDevice(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "DeleteWirelessDevice", + } +} diff --git a/service/iotwireless/api_op_DeleteWirelessGateway.go b/service/iotwireless/api_op_DeleteWirelessGateway.go new file mode 100644 index 00000000000..444d1aa43b8 --- /dev/null +++ b/service/iotwireless/api_op_DeleteWirelessGateway.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a wireless gateway. +func (c *Client) DeleteWirelessGateway(ctx context.Context, params *DeleteWirelessGatewayInput, optFns ...func(*Options)) (*DeleteWirelessGatewayOutput, error) { + if params == nil { + params = &DeleteWirelessGatewayInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteWirelessGateway", params, optFns, addOperationDeleteWirelessGatewayMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteWirelessGatewayOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteWirelessGatewayInput struct { + + // The ID of the resource to delete. + // + // This member is required. + Id *string +} + +type DeleteWirelessGatewayOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteWirelessGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteWirelessGateway{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteWirelessGateway{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteWirelessGatewayValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteWirelessGateway(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDeleteWirelessGateway(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "DeleteWirelessGateway", + } +} diff --git a/service/iotwireless/api_op_DeleteWirelessGatewayTask.go b/service/iotwireless/api_op_DeleteWirelessGatewayTask.go new file mode 100644 index 00000000000..23073c0f01d --- /dev/null +++ b/service/iotwireless/api_op_DeleteWirelessGatewayTask.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a wireless gateway task. +func (c *Client) DeleteWirelessGatewayTask(ctx context.Context, params *DeleteWirelessGatewayTaskInput, optFns ...func(*Options)) (*DeleteWirelessGatewayTaskOutput, error) { + if params == nil { + params = &DeleteWirelessGatewayTaskInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteWirelessGatewayTask", params, optFns, addOperationDeleteWirelessGatewayTaskMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteWirelessGatewayTaskOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteWirelessGatewayTaskInput struct { + + // The ID of the resource to delete. + // + // This member is required. + Id *string +} + +type DeleteWirelessGatewayTaskOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteWirelessGatewayTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteWirelessGatewayTask{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteWirelessGatewayTask{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteWirelessGatewayTaskValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteWirelessGatewayTask(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDeleteWirelessGatewayTask(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "DeleteWirelessGatewayTask", + } +} diff --git a/service/iotwireless/api_op_DeleteWirelessGatewayTaskDefinition.go b/service/iotwireless/api_op_DeleteWirelessGatewayTaskDefinition.go new file mode 100644 index 00000000000..591d926fd8b --- /dev/null +++ b/service/iotwireless/api_op_DeleteWirelessGatewayTaskDefinition.go @@ -0,0 +1,110 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a wireless gateway task definition. Deleting this task definition does +// not affect tasks that are currently in progress. +func (c *Client) DeleteWirelessGatewayTaskDefinition(ctx context.Context, params *DeleteWirelessGatewayTaskDefinitionInput, optFns ...func(*Options)) (*DeleteWirelessGatewayTaskDefinitionOutput, error) { + if params == nil { + params = &DeleteWirelessGatewayTaskDefinitionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteWirelessGatewayTaskDefinition", params, optFns, addOperationDeleteWirelessGatewayTaskDefinitionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteWirelessGatewayTaskDefinitionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteWirelessGatewayTaskDefinitionInput struct { + + // The ID of the resource to delete. + // + // This member is required. + Id *string +} + +type DeleteWirelessGatewayTaskDefinitionOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteWirelessGatewayTaskDefinitionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteWirelessGatewayTaskDefinition{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteWirelessGatewayTaskDefinition{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteWirelessGatewayTaskDefinitionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteWirelessGatewayTaskDefinition(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDeleteWirelessGatewayTaskDefinition(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "DeleteWirelessGatewayTaskDefinition", + } +} diff --git a/service/iotwireless/api_op_DisassociateAwsAccountFromPartnerAccount.go b/service/iotwireless/api_op_DisassociateAwsAccountFromPartnerAccount.go new file mode 100644 index 00000000000..08984b3bbf3 --- /dev/null +++ b/service/iotwireless/api_op_DisassociateAwsAccountFromPartnerAccount.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Disassociates your AWS account from a partner account. If PartnerAccountId and +// PartnerType are null, disassociates your AWS account from all partner accounts. +func (c *Client) DisassociateAwsAccountFromPartnerAccount(ctx context.Context, params *DisassociateAwsAccountFromPartnerAccountInput, optFns ...func(*Options)) (*DisassociateAwsAccountFromPartnerAccountOutput, error) { + if params == nil { + params = &DisassociateAwsAccountFromPartnerAccountInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisassociateAwsAccountFromPartnerAccount", params, optFns, addOperationDisassociateAwsAccountFromPartnerAccountMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisassociateAwsAccountFromPartnerAccountOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DisassociateAwsAccountFromPartnerAccountInput struct { + + // The partner account ID to disassociate from the AWS account. + // + // This member is required. + PartnerAccountId *string + + // The partner type. + // + // This member is required. + PartnerType types.PartnerType +} + +type DisassociateAwsAccountFromPartnerAccountOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDisassociateAwsAccountFromPartnerAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateAwsAccountFromPartnerAccount{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateAwsAccountFromPartnerAccount{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDisassociateAwsAccountFromPartnerAccountValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateAwsAccountFromPartnerAccount(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDisassociateAwsAccountFromPartnerAccount(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "DisassociateAwsAccountFromPartnerAccount", + } +} diff --git a/service/iotwireless/api_op_DisassociateWirelessDeviceFromThing.go b/service/iotwireless/api_op_DisassociateWirelessDeviceFromThing.go new file mode 100644 index 00000000000..d2a59461b88 --- /dev/null +++ b/service/iotwireless/api_op_DisassociateWirelessDeviceFromThing.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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" +) + +// Disassociates a wireless device from its currently associated thing. +func (c *Client) DisassociateWirelessDeviceFromThing(ctx context.Context, params *DisassociateWirelessDeviceFromThingInput, optFns ...func(*Options)) (*DisassociateWirelessDeviceFromThingOutput, error) { + if params == nil { + params = &DisassociateWirelessDeviceFromThingInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisassociateWirelessDeviceFromThing", params, optFns, addOperationDisassociateWirelessDeviceFromThingMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisassociateWirelessDeviceFromThingOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DisassociateWirelessDeviceFromThingInput struct { + + // The ID of the resource to update. + // + // This member is required. + Id *string +} + +type DisassociateWirelessDeviceFromThingOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDisassociateWirelessDeviceFromThingMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateWirelessDeviceFromThing{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateWirelessDeviceFromThing{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDisassociateWirelessDeviceFromThingValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateWirelessDeviceFromThing(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDisassociateWirelessDeviceFromThing(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "DisassociateWirelessDeviceFromThing", + } +} diff --git a/service/iotwireless/api_op_DisassociateWirelessGatewayFromCertificate.go b/service/iotwireless/api_op_DisassociateWirelessGatewayFromCertificate.go new file mode 100644 index 00000000000..6ce427a49ac --- /dev/null +++ b/service/iotwireless/api_op_DisassociateWirelessGatewayFromCertificate.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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" +) + +// Disassociates a wireless gateway from its currently associated certificate. +func (c *Client) DisassociateWirelessGatewayFromCertificate(ctx context.Context, params *DisassociateWirelessGatewayFromCertificateInput, optFns ...func(*Options)) (*DisassociateWirelessGatewayFromCertificateOutput, error) { + if params == nil { + params = &DisassociateWirelessGatewayFromCertificateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisassociateWirelessGatewayFromCertificate", params, optFns, addOperationDisassociateWirelessGatewayFromCertificateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisassociateWirelessGatewayFromCertificateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DisassociateWirelessGatewayFromCertificateInput struct { + + // The ID of the resource to update. + // + // This member is required. + Id *string +} + +type DisassociateWirelessGatewayFromCertificateOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDisassociateWirelessGatewayFromCertificateMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateWirelessGatewayFromCertificate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateWirelessGatewayFromCertificate{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDisassociateWirelessGatewayFromCertificateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateWirelessGatewayFromCertificate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDisassociateWirelessGatewayFromCertificate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "DisassociateWirelessGatewayFromCertificate", + } +} diff --git a/service/iotwireless/api_op_DisassociateWirelessGatewayFromThing.go b/service/iotwireless/api_op_DisassociateWirelessGatewayFromThing.go new file mode 100644 index 00000000000..679e883ef8e --- /dev/null +++ b/service/iotwireless/api_op_DisassociateWirelessGatewayFromThing.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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" +) + +// Disassociates a wireless gateway from its currently associated thing. +func (c *Client) DisassociateWirelessGatewayFromThing(ctx context.Context, params *DisassociateWirelessGatewayFromThingInput, optFns ...func(*Options)) (*DisassociateWirelessGatewayFromThingOutput, error) { + if params == nil { + params = &DisassociateWirelessGatewayFromThingInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisassociateWirelessGatewayFromThing", params, optFns, addOperationDisassociateWirelessGatewayFromThingMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisassociateWirelessGatewayFromThingOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DisassociateWirelessGatewayFromThingInput struct { + + // The ID of the resource to update. + // + // This member is required. + Id *string +} + +type DisassociateWirelessGatewayFromThingOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDisassociateWirelessGatewayFromThingMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateWirelessGatewayFromThing{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateWirelessGatewayFromThing{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDisassociateWirelessGatewayFromThingValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateWirelessGatewayFromThing(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDisassociateWirelessGatewayFromThing(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "DisassociateWirelessGatewayFromThing", + } +} diff --git a/service/iotwireless/api_op_GetDestination.go b/service/iotwireless/api_op_GetDestination.go new file mode 100644 index 00000000000..78230e54bb4 --- /dev/null +++ b/service/iotwireless/api_op_GetDestination.go @@ -0,0 +1,129 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets information about a destination. +func (c *Client) GetDestination(ctx context.Context, params *GetDestinationInput, optFns ...func(*Options)) (*GetDestinationOutput, error) { + if params == nil { + params = &GetDestinationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDestination", params, optFns, addOperationGetDestinationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDestinationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDestinationInput struct { + + // The name of the resource to get. + // + // This member is required. + Name *string +} + +type GetDestinationOutput struct { + + // The Amazon Resource Name of the resource. + Arn *string + + // The description of the resource. + Description *string + + // The rule name or topic rule to send messages to. + Expression *string + + // The type of value in Expression. + ExpressionType types.ExpressionType + + // The name of the resource. + Name *string + + // The ARN of the IAM Role that authorizes the destination. + RoleArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDestination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDestination{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetDestinationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDestination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetDestination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "GetDestination", + } +} diff --git a/service/iotwireless/api_op_GetDeviceProfile.go b/service/iotwireless/api_op_GetDeviceProfile.go new file mode 100644 index 00000000000..b60a31d4228 --- /dev/null +++ b/service/iotwireless/api_op_GetDeviceProfile.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets information about a device profile. +func (c *Client) GetDeviceProfile(ctx context.Context, params *GetDeviceProfileInput, optFns ...func(*Options)) (*GetDeviceProfileOutput, error) { + if params == nil { + params = &GetDeviceProfileInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDeviceProfile", params, optFns, addOperationGetDeviceProfileMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDeviceProfileOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDeviceProfileInput struct { + + // The ID of the resource to get. + // + // This member is required. + Id *string +} + +type GetDeviceProfileOutput struct { + + // The Amazon Resource Name of the resource. + Arn *string + + // The ID of the device profile. + Id *string + + // Information about the device profile. + LoRaWAN *types.LoRaWANDeviceProfile + + // The name of the resource. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetDeviceProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDeviceProfile{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDeviceProfile{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetDeviceProfileValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDeviceProfile(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetDeviceProfile(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "GetDeviceProfile", + } +} diff --git a/service/iotwireless/api_op_GetPartnerAccount.go b/service/iotwireless/api_op_GetPartnerAccount.go new file mode 100644 index 00000000000..88c3a882433 --- /dev/null +++ b/service/iotwireless/api_op_GetPartnerAccount.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets information about a partner account. If PartnerAccountId and PartnerType +// are null, returns all partner accounts. +func (c *Client) GetPartnerAccount(ctx context.Context, params *GetPartnerAccountInput, optFns ...func(*Options)) (*GetPartnerAccountOutput, error) { + if params == nil { + params = &GetPartnerAccountInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetPartnerAccount", params, optFns, addOperationGetPartnerAccountMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetPartnerAccountOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetPartnerAccountInput struct { + + // The partner account ID to disassociate from the AWS account. + // + // This member is required. + PartnerAccountId *string + + // The partner type. + // + // This member is required. + PartnerType types.PartnerType +} + +type GetPartnerAccountOutput struct { + + // Whether the partner account is linked to the AWS account. + AccountLinked bool + + // The Sidewalk account credentials. + Sidewalk *types.SidewalkAccountInfoWithFingerprint + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetPartnerAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetPartnerAccount{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetPartnerAccount{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetPartnerAccountValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPartnerAccount(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetPartnerAccount(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "GetPartnerAccount", + } +} diff --git a/service/iotwireless/api_op_GetServiceEndpoint.go b/service/iotwireless/api_op_GetServiceEndpoint.go new file mode 100644 index 00000000000..f8ef3163d06 --- /dev/null +++ b/service/iotwireless/api_op_GetServiceEndpoint.go @@ -0,0 +1,118 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets the account-specific endpoint for Configuration and Update Server (CUPS) +// protocol or LoRaWAN Network Server (LNS) connections. +func (c *Client) GetServiceEndpoint(ctx context.Context, params *GetServiceEndpointInput, optFns ...func(*Options)) (*GetServiceEndpointOutput, error) { + if params == nil { + params = &GetServiceEndpointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetServiceEndpoint", params, optFns, addOperationGetServiceEndpointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetServiceEndpointOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetServiceEndpointInput struct { + + // The service type for which to get endpoint information about. Can be CUPS for + // the Configuration and Update Server endpoint, or LNS for the LoRaWAN Network + // Server endpoint. + ServiceType types.WirelessGatewayServiceType +} + +type GetServiceEndpointOutput struct { + + // The Root CA of the server trust certificate. + ServerTrust *string + + // The service endpoint value. + ServiceEndpoint *string + + // The endpoint's service type. + ServiceType types.WirelessGatewayServiceType + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetServiceEndpointMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetServiceEndpoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetServiceEndpoint{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opGetServiceEndpoint(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetServiceEndpoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "GetServiceEndpoint", + } +} diff --git a/service/iotwireless/api_op_GetServiceProfile.go b/service/iotwireless/api_op_GetServiceProfile.go new file mode 100644 index 00000000000..734e41410de --- /dev/null +++ b/service/iotwireless/api_op_GetServiceProfile.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets information about a service profile. +func (c *Client) GetServiceProfile(ctx context.Context, params *GetServiceProfileInput, optFns ...func(*Options)) (*GetServiceProfileOutput, error) { + if params == nil { + params = &GetServiceProfileInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetServiceProfile", params, optFns, addOperationGetServiceProfileMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetServiceProfileOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetServiceProfileInput struct { + + // The ID of the resource to get. + // + // This member is required. + Id *string +} + +type GetServiceProfileOutput struct { + + // The Amazon Resource Name of the resource. + Arn *string + + // The ID of the service profile. + Id *string + + // Information about the service profile. + LoRaWAN *types.LoRaWANGetServiceProfileInfo + + // The name of the resource. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetServiceProfileMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetServiceProfile{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetServiceProfile{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetServiceProfileValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetServiceProfile(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetServiceProfile(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "GetServiceProfile", + } +} diff --git a/service/iotwireless/api_op_GetWirelessDevice.go b/service/iotwireless/api_op_GetWirelessDevice.go new file mode 100644 index 00000000000..8bcff24f041 --- /dev/null +++ b/service/iotwireless/api_op_GetWirelessDevice.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets information about a wireless device. +func (c *Client) GetWirelessDevice(ctx context.Context, params *GetWirelessDeviceInput, optFns ...func(*Options)) (*GetWirelessDeviceOutput, error) { + if params == nil { + params = &GetWirelessDeviceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetWirelessDevice", params, optFns, addOperationGetWirelessDeviceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetWirelessDeviceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetWirelessDeviceInput struct { + + // The identifier of the wireless device to get. + // + // This member is required. + Identifier *string + + // The type of identifier used in identifier. + // + // This member is required. + IdentifierType types.WirelessDeviceIdType +} + +type GetWirelessDeviceOutput struct { + + // The Amazon Resource Name of the resource. + Arn *string + + // The description of the resource. + Description *string + + // The name of the destination to which the device is assigned. + DestinationName *string + + // The ID of the wireless device. + Id *string + + // Information about the wireless device. + LoRaWAN *types.LoRaWANDevice + + // The name of the resource. + Name *string + + // The ARN of the thing associated with the wireless device. + ThingArn *string + + // The name of the thing associated with the wireless device. The value is empty if + // a thing isn't associated with the device. + ThingName *string + + // The wireless device type. + Type types.WirelessDeviceType + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetWirelessDeviceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetWirelessDevice{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetWirelessDevice{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetWirelessDeviceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetWirelessDevice(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetWirelessDevice(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "GetWirelessDevice", + } +} diff --git a/service/iotwireless/api_op_GetWirelessDeviceStatistics.go b/service/iotwireless/api_op_GetWirelessDeviceStatistics.go new file mode 100644 index 00000000000..c8df4201862 --- /dev/null +++ b/service/iotwireless/api_op_GetWirelessDeviceStatistics.go @@ -0,0 +1,120 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets operating information about a wireless device. +func (c *Client) GetWirelessDeviceStatistics(ctx context.Context, params *GetWirelessDeviceStatisticsInput, optFns ...func(*Options)) (*GetWirelessDeviceStatisticsOutput, error) { + if params == nil { + params = &GetWirelessDeviceStatisticsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetWirelessDeviceStatistics", params, optFns, addOperationGetWirelessDeviceStatisticsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetWirelessDeviceStatisticsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetWirelessDeviceStatisticsInput struct { + + // The ID of the wireless device for which to get the data. + // + // This member is required. + WirelessDeviceId *string +} + +type GetWirelessDeviceStatisticsOutput struct { + + // The date and time when the most recent uplink was received. + LastUplinkReceivedAt *string + + // Information about the wireless device's operations. + LoRaWAN *types.LoRaWANDeviceMetadata + + // The ID of the wireless device. + WirelessDeviceId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetWirelessDeviceStatisticsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetWirelessDeviceStatistics{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetWirelessDeviceStatistics{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetWirelessDeviceStatisticsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetWirelessDeviceStatistics(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetWirelessDeviceStatistics(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "GetWirelessDeviceStatistics", + } +} diff --git a/service/iotwireless/api_op_GetWirelessGateway.go b/service/iotwireless/api_op_GetWirelessGateway.go new file mode 100644 index 00000000000..c2ac376fb7c --- /dev/null +++ b/service/iotwireless/api_op_GetWirelessGateway.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets information about a wireless gateway. +func (c *Client) GetWirelessGateway(ctx context.Context, params *GetWirelessGatewayInput, optFns ...func(*Options)) (*GetWirelessGatewayOutput, error) { + if params == nil { + params = &GetWirelessGatewayInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetWirelessGateway", params, optFns, addOperationGetWirelessGatewayMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetWirelessGatewayOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetWirelessGatewayInput struct { + + // The identifier of the wireless gateway to get. + // + // This member is required. + Identifier *string + + // The type of identifier used in identifier. + // + // This member is required. + IdentifierType types.WirelessGatewayIdType +} + +type GetWirelessGatewayOutput struct { + + // The Amazon Resource Name of the resource. + Arn *string + + // The description of the resource. + Description *string + + // The ID of the wireless gateway. + Id *string + + // Information about the wireless gateway. + LoRaWAN *types.LoRaWANGateway + + // The name of the resource. + Name *string + + // The ARN of the thing associated with the wireless gateway. + ThingArn *string + + // The name of the thing associated with the wireless gateway. The value is empty + // if a thing isn't associated with the gateway. + ThingName *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetWirelessGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetWirelessGateway{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetWirelessGateway{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetWirelessGatewayValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetWirelessGateway(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetWirelessGateway(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "GetWirelessGateway", + } +} diff --git a/service/iotwireless/api_op_GetWirelessGatewayCertificate.go b/service/iotwireless/api_op_GetWirelessGatewayCertificate.go new file mode 100644 index 00000000000..671020e1978 --- /dev/null +++ b/service/iotwireless/api_op_GetWirelessGatewayCertificate.go @@ -0,0 +1,114 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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 ID of the certificate that is currently associated with a wireless +// gateway. +func (c *Client) GetWirelessGatewayCertificate(ctx context.Context, params *GetWirelessGatewayCertificateInput, optFns ...func(*Options)) (*GetWirelessGatewayCertificateOutput, error) { + if params == nil { + params = &GetWirelessGatewayCertificateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetWirelessGatewayCertificate", params, optFns, addOperationGetWirelessGatewayCertificateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetWirelessGatewayCertificateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetWirelessGatewayCertificateInput struct { + + // The ID of the resource to get. + // + // This member is required. + Id *string +} + +type GetWirelessGatewayCertificateOutput struct { + + // The ID of the certificate associated with the wireless gateway. + IotCertificateId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetWirelessGatewayCertificateMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetWirelessGatewayCertificate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetWirelessGatewayCertificate{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetWirelessGatewayCertificateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetWirelessGatewayCertificate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetWirelessGatewayCertificate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "GetWirelessGatewayCertificate", + } +} diff --git a/service/iotwireless/api_op_GetWirelessGatewayFirmwareInformation.go b/service/iotwireless/api_op_GetWirelessGatewayFirmwareInformation.go new file mode 100644 index 00000000000..e445a08bbc0 --- /dev/null +++ b/service/iotwireless/api_op_GetWirelessGatewayFirmwareInformation.go @@ -0,0 +1,114 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets the firmware version and other information about a wireless gateway. +func (c *Client) GetWirelessGatewayFirmwareInformation(ctx context.Context, params *GetWirelessGatewayFirmwareInformationInput, optFns ...func(*Options)) (*GetWirelessGatewayFirmwareInformationOutput, error) { + if params == nil { + params = &GetWirelessGatewayFirmwareInformationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetWirelessGatewayFirmwareInformation", params, optFns, addOperationGetWirelessGatewayFirmwareInformationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetWirelessGatewayFirmwareInformationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetWirelessGatewayFirmwareInformationInput struct { + + // The ID of the resource to get. + // + // This member is required. + Id *string +} + +type GetWirelessGatewayFirmwareInformationOutput struct { + + // Information about the wireless gateway's firmware. + LoRaWAN *types.LoRaWANGatewayCurrentVersion + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetWirelessGatewayFirmwareInformationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetWirelessGatewayFirmwareInformation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetWirelessGatewayFirmwareInformation{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetWirelessGatewayFirmwareInformationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetWirelessGatewayFirmwareInformation(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetWirelessGatewayFirmwareInformation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "GetWirelessGatewayFirmwareInformation", + } +} diff --git a/service/iotwireless/api_op_GetWirelessGatewayStatistics.go b/service/iotwireless/api_op_GetWirelessGatewayStatistics.go new file mode 100644 index 00000000000..f99041e257f --- /dev/null +++ b/service/iotwireless/api_op_GetWirelessGatewayStatistics.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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 operating information about a wireless gateway. +func (c *Client) GetWirelessGatewayStatistics(ctx context.Context, params *GetWirelessGatewayStatisticsInput, optFns ...func(*Options)) (*GetWirelessGatewayStatisticsOutput, error) { + if params == nil { + params = &GetWirelessGatewayStatisticsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetWirelessGatewayStatistics", params, optFns, addOperationGetWirelessGatewayStatisticsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetWirelessGatewayStatisticsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetWirelessGatewayStatisticsInput struct { + + // The ID of the wireless gateway for which to get the data. + // + // This member is required. + WirelessGatewayId *string +} + +type GetWirelessGatewayStatisticsOutput struct { + + // The date and time when the most recent uplink was received. + LastUplinkReceivedAt *string + + // The ID of the wireless gateway. + WirelessGatewayId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetWirelessGatewayStatisticsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetWirelessGatewayStatistics{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetWirelessGatewayStatistics{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetWirelessGatewayStatisticsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetWirelessGatewayStatistics(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetWirelessGatewayStatistics(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "GetWirelessGatewayStatistics", + } +} diff --git a/service/iotwireless/api_op_GetWirelessGatewayTask.go b/service/iotwireless/api_op_GetWirelessGatewayTask.go new file mode 100644 index 00000000000..451eb57a2e0 --- /dev/null +++ b/service/iotwireless/api_op_GetWirelessGatewayTask.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets information about a wireless gateway task. +func (c *Client) GetWirelessGatewayTask(ctx context.Context, params *GetWirelessGatewayTaskInput, optFns ...func(*Options)) (*GetWirelessGatewayTaskOutput, error) { + if params == nil { + params = &GetWirelessGatewayTaskInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetWirelessGatewayTask", params, optFns, addOperationGetWirelessGatewayTaskMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetWirelessGatewayTaskOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetWirelessGatewayTaskInput struct { + + // The ID of the resource to get. + // + // This member is required. + Id *string +} + +type GetWirelessGatewayTaskOutput struct { + + // The date and time when the most recent uplink was received. + LastUplinkReceivedAt *string + + // The status of the request. + Status types.WirelessGatewayTaskStatus + + // The date and time when the task was created. + TaskCreatedAt *string + + // The ID of the wireless gateway. + WirelessGatewayId *string + + // The ID of the WirelessGatewayTask. + WirelessGatewayTaskDefinitionId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetWirelessGatewayTaskMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetWirelessGatewayTask{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetWirelessGatewayTask{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetWirelessGatewayTaskValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetWirelessGatewayTask(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetWirelessGatewayTask(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "GetWirelessGatewayTask", + } +} diff --git a/service/iotwireless/api_op_GetWirelessGatewayTaskDefinition.go b/service/iotwireless/api_op_GetWirelessGatewayTaskDefinition.go new file mode 100644 index 00000000000..107deb093d2 --- /dev/null +++ b/service/iotwireless/api_op_GetWirelessGatewayTaskDefinition.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets information about a wireless gateway task definition. +func (c *Client) GetWirelessGatewayTaskDefinition(ctx context.Context, params *GetWirelessGatewayTaskDefinitionInput, optFns ...func(*Options)) (*GetWirelessGatewayTaskDefinitionOutput, error) { + if params == nil { + params = &GetWirelessGatewayTaskDefinitionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetWirelessGatewayTaskDefinition", params, optFns, addOperationGetWirelessGatewayTaskDefinitionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetWirelessGatewayTaskDefinitionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetWirelessGatewayTaskDefinitionInput struct { + + // The ID of the resource to get. + // + // This member is required. + Id *string +} + +type GetWirelessGatewayTaskDefinitionOutput struct { + + // Whether to automatically create tasks using this task definition for all + // gateways with the specified current version. If false, the task must me created + // by calling CreateWirelessGatewayTask. + AutoCreateTasks bool + + // The name of the resource. + Name *string + + // Information about the gateways to update. + Update *types.UpdateWirelessGatewayTaskCreate + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetWirelessGatewayTaskDefinitionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetWirelessGatewayTaskDefinition{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetWirelessGatewayTaskDefinition{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetWirelessGatewayTaskDefinitionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetWirelessGatewayTaskDefinition(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetWirelessGatewayTaskDefinition(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "GetWirelessGatewayTaskDefinition", + } +} diff --git a/service/iotwireless/api_op_ListDestinations.go b/service/iotwireless/api_op_ListDestinations.go new file mode 100644 index 00000000000..a71d2d05a3f --- /dev/null +++ b/service/iotwireless/api_op_ListDestinations.go @@ -0,0 +1,200 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the destinations registered to your AWS account. +func (c *Client) ListDestinations(ctx context.Context, params *ListDestinationsInput, optFns ...func(*Options)) (*ListDestinationsOutput, error) { + if params == nil { + params = &ListDestinationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListDestinations", params, optFns, addOperationListDestinationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListDestinationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListDestinationsInput struct { + + // The maximum number of results to return in this operation. + MaxResults int32 + + // To retrieve the next set of results, the nextToken value from a previous + // response; otherwise null to receive the first set of results. + NextToken *string +} + +type ListDestinationsOutput struct { + + // The list of destinations. + DestinationList []types.Destinations + + // The token to use to get the next set of results, or null if there are no + // additional results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListDestinationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListDestinations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDestinations{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListDestinations(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListDestinationsAPIClient is a client that implements the ListDestinations +// operation. +type ListDestinationsAPIClient interface { + ListDestinations(context.Context, *ListDestinationsInput, ...func(*Options)) (*ListDestinationsOutput, error) +} + +var _ ListDestinationsAPIClient = (*Client)(nil) + +// ListDestinationsPaginatorOptions is the paginator options for ListDestinations +type ListDestinationsPaginatorOptions struct { + // The maximum number of results to return in this operation. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListDestinationsPaginator is a paginator for ListDestinations +type ListDestinationsPaginator struct { + options ListDestinationsPaginatorOptions + client ListDestinationsAPIClient + params *ListDestinationsInput + nextToken *string + firstPage bool +} + +// NewListDestinationsPaginator returns a new ListDestinationsPaginator +func NewListDestinationsPaginator(client ListDestinationsAPIClient, params *ListDestinationsInput, optFns ...func(*ListDestinationsPaginatorOptions)) *ListDestinationsPaginator { + options := ListDestinationsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDestinationsInput{} + } + + return &ListDestinationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDestinationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDestinations page. +func (p *ListDestinationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDestinationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListDestinations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListDestinations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "ListDestinations", + } +} diff --git a/service/iotwireless/api_op_ListDeviceProfiles.go b/service/iotwireless/api_op_ListDeviceProfiles.go new file mode 100644 index 00000000000..7f467402bd0 --- /dev/null +++ b/service/iotwireless/api_op_ListDeviceProfiles.go @@ -0,0 +1,201 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the device profiles registered to your AWS account. +func (c *Client) ListDeviceProfiles(ctx context.Context, params *ListDeviceProfilesInput, optFns ...func(*Options)) (*ListDeviceProfilesOutput, error) { + if params == nil { + params = &ListDeviceProfilesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListDeviceProfiles", params, optFns, addOperationListDeviceProfilesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListDeviceProfilesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListDeviceProfilesInput struct { + + // The maximum number of results to return in this operation. + MaxResults int32 + + // To retrieve the next set of results, the nextToken value from a previous + // response; otherwise null to receive the first set of results. + NextToken *string +} + +type ListDeviceProfilesOutput struct { + + // The list of device profiles. + DeviceProfileList []types.DeviceProfile + + // The token to use to get the next set of results, or null if there are no + // additional results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListDeviceProfilesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListDeviceProfiles{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDeviceProfiles{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListDeviceProfiles(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListDeviceProfilesAPIClient is a client that implements the ListDeviceProfiles +// operation. +type ListDeviceProfilesAPIClient interface { + ListDeviceProfiles(context.Context, *ListDeviceProfilesInput, ...func(*Options)) (*ListDeviceProfilesOutput, error) +} + +var _ ListDeviceProfilesAPIClient = (*Client)(nil) + +// ListDeviceProfilesPaginatorOptions is the paginator options for +// ListDeviceProfiles +type ListDeviceProfilesPaginatorOptions struct { + // The maximum number of results to return in this operation. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListDeviceProfilesPaginator is a paginator for ListDeviceProfiles +type ListDeviceProfilesPaginator struct { + options ListDeviceProfilesPaginatorOptions + client ListDeviceProfilesAPIClient + params *ListDeviceProfilesInput + nextToken *string + firstPage bool +} + +// NewListDeviceProfilesPaginator returns a new ListDeviceProfilesPaginator +func NewListDeviceProfilesPaginator(client ListDeviceProfilesAPIClient, params *ListDeviceProfilesInput, optFns ...func(*ListDeviceProfilesPaginatorOptions)) *ListDeviceProfilesPaginator { + options := ListDeviceProfilesPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListDeviceProfilesInput{} + } + + return &ListDeviceProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDeviceProfilesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListDeviceProfiles page. +func (p *ListDeviceProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDeviceProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListDeviceProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListDeviceProfiles(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "ListDeviceProfiles", + } +} diff --git a/service/iotwireless/api_op_ListPartnerAccounts.go b/service/iotwireless/api_op_ListPartnerAccounts.go new file mode 100644 index 00000000000..ebc075492e1 --- /dev/null +++ b/service/iotwireless/api_op_ListPartnerAccounts.go @@ -0,0 +1,117 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the partner accounts associated with your AWS account. +func (c *Client) ListPartnerAccounts(ctx context.Context, params *ListPartnerAccountsInput, optFns ...func(*Options)) (*ListPartnerAccountsOutput, error) { + if params == nil { + params = &ListPartnerAccountsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListPartnerAccounts", params, optFns, addOperationListPartnerAccountsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListPartnerAccountsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListPartnerAccountsInput struct { + + // The maximum number of results to return in this operation. + MaxResults int32 + + // To retrieve the next set of results, the nextToken value from a previous + // response; otherwise null to receive the first set of results. + NextToken *string +} + +type ListPartnerAccountsOutput struct { + + // The token to use to get the next set of results, or null if there are no + // additional results. + NextToken *string + + // The Sidewalk account credentials. + Sidewalk []types.SidewalkAccountInfoWithFingerprint + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListPartnerAccountsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListPartnerAccounts{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListPartnerAccounts{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListPartnerAccounts(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opListPartnerAccounts(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "ListPartnerAccounts", + } +} diff --git a/service/iotwireless/api_op_ListServiceProfiles.go b/service/iotwireless/api_op_ListServiceProfiles.go new file mode 100644 index 00000000000..46524a01871 --- /dev/null +++ b/service/iotwireless/api_op_ListServiceProfiles.go @@ -0,0 +1,201 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the service profiles registered to your AWS account. +func (c *Client) ListServiceProfiles(ctx context.Context, params *ListServiceProfilesInput, optFns ...func(*Options)) (*ListServiceProfilesOutput, error) { + if params == nil { + params = &ListServiceProfilesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListServiceProfiles", params, optFns, addOperationListServiceProfilesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListServiceProfilesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListServiceProfilesInput struct { + + // The maximum number of results to return in this operation. + MaxResults int32 + + // To retrieve the next set of results, the nextToken value from a previous + // response; otherwise null to receive the first set of results. + NextToken *string +} + +type ListServiceProfilesOutput struct { + + // The token to use to get the next set of results, or null if there are no + // additional results. + NextToken *string + + // The list of service profiles. + ServiceProfileList []types.ServiceProfile + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListServiceProfilesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListServiceProfiles{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListServiceProfiles{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListServiceProfiles(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListServiceProfilesAPIClient is a client that implements the ListServiceProfiles +// operation. +type ListServiceProfilesAPIClient interface { + ListServiceProfiles(context.Context, *ListServiceProfilesInput, ...func(*Options)) (*ListServiceProfilesOutput, error) +} + +var _ ListServiceProfilesAPIClient = (*Client)(nil) + +// ListServiceProfilesPaginatorOptions is the paginator options for +// ListServiceProfiles +type ListServiceProfilesPaginatorOptions struct { + // The maximum number of results to return in this operation. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListServiceProfilesPaginator is a paginator for ListServiceProfiles +type ListServiceProfilesPaginator struct { + options ListServiceProfilesPaginatorOptions + client ListServiceProfilesAPIClient + params *ListServiceProfilesInput + nextToken *string + firstPage bool +} + +// NewListServiceProfilesPaginator returns a new ListServiceProfilesPaginator +func NewListServiceProfilesPaginator(client ListServiceProfilesAPIClient, params *ListServiceProfilesInput, optFns ...func(*ListServiceProfilesPaginatorOptions)) *ListServiceProfilesPaginator { + options := ListServiceProfilesPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListServiceProfilesInput{} + } + + return &ListServiceProfilesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListServiceProfilesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListServiceProfiles page. +func (p *ListServiceProfilesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListServiceProfilesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListServiceProfiles(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListServiceProfiles(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "ListServiceProfiles", + } +} diff --git a/service/iotwireless/api_op_ListTagsForResource.go b/service/iotwireless/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..e5f044fd48a --- /dev/null +++ b/service/iotwireless/api_op_ListTagsForResource.go @@ -0,0 +1,115 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the tags (metadata) you have assigned to the 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, addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The ARN of the resource for which to list tags. + // + // This member is required. + ResourceArn *string +} + +type ListTagsForResourceOutput struct { + + // The tags attached to the specified resource. Tags are metadata that can be used + // to manage a resource + Tags []types.Tag + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "iotwireless", + OperationName: "ListTagsForResource", + } +} diff --git a/service/iotwireless/api_op_ListWirelessDevices.go b/service/iotwireless/api_op_ListWirelessDevices.go new file mode 100644 index 00000000000..7fd3818207f --- /dev/null +++ b/service/iotwireless/api_op_ListWirelessDevices.go @@ -0,0 +1,213 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the wireless devices registered to your AWS account. +func (c *Client) ListWirelessDevices(ctx context.Context, params *ListWirelessDevicesInput, optFns ...func(*Options)) (*ListWirelessDevicesOutput, error) { + if params == nil { + params = &ListWirelessDevicesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListWirelessDevices", params, optFns, addOperationListWirelessDevicesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListWirelessDevicesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListWirelessDevicesInput struct { + + // A filter to list only the wireless devices that use this destination. + DestinationName *string + + // A filter to list only the wireless devices that use this device profile. + DeviceProfileId *string + + // The maximum number of results to return in this operation. + MaxResults int32 + + // To retrieve the next set of results, the nextToken value from a previous + // response; otherwise null to receive the first set of results. + NextToken *string + + // A filter to list only the wireless devices that use this service profile. + ServiceProfileId *string + + // A filter to list only the wireless devices that use this wireless device type. + WirelessDeviceType types.WirelessDeviceType +} + +type ListWirelessDevicesOutput struct { + + // The token to use to get the next set of results, or null if there are no + // additional results. + NextToken *string + + // The ID of the wireless device. + WirelessDeviceList []types.WirelessDeviceStatistics + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListWirelessDevicesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListWirelessDevices{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListWirelessDevices{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListWirelessDevices(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListWirelessDevicesAPIClient is a client that implements the ListWirelessDevices +// operation. +type ListWirelessDevicesAPIClient interface { + ListWirelessDevices(context.Context, *ListWirelessDevicesInput, ...func(*Options)) (*ListWirelessDevicesOutput, error) +} + +var _ ListWirelessDevicesAPIClient = (*Client)(nil) + +// ListWirelessDevicesPaginatorOptions is the paginator options for +// ListWirelessDevices +type ListWirelessDevicesPaginatorOptions struct { + // The maximum number of results to return in this operation. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListWirelessDevicesPaginator is a paginator for ListWirelessDevices +type ListWirelessDevicesPaginator struct { + options ListWirelessDevicesPaginatorOptions + client ListWirelessDevicesAPIClient + params *ListWirelessDevicesInput + nextToken *string + firstPage bool +} + +// NewListWirelessDevicesPaginator returns a new ListWirelessDevicesPaginator +func NewListWirelessDevicesPaginator(client ListWirelessDevicesAPIClient, params *ListWirelessDevicesInput, optFns ...func(*ListWirelessDevicesPaginatorOptions)) *ListWirelessDevicesPaginator { + options := ListWirelessDevicesPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWirelessDevicesInput{} + } + + return &ListWirelessDevicesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWirelessDevicesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListWirelessDevices page. +func (p *ListWirelessDevicesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWirelessDevicesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListWirelessDevices(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListWirelessDevices(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "ListWirelessDevices", + } +} diff --git a/service/iotwireless/api_op_ListWirelessGatewayTaskDefinitions.go b/service/iotwireless/api_op_ListWirelessGatewayTaskDefinitions.go new file mode 100644 index 00000000000..0f744db790e --- /dev/null +++ b/service/iotwireless/api_op_ListWirelessGatewayTaskDefinitions.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List the wireless gateway tasks definitions registered to your AWS account. +func (c *Client) ListWirelessGatewayTaskDefinitions(ctx context.Context, params *ListWirelessGatewayTaskDefinitionsInput, optFns ...func(*Options)) (*ListWirelessGatewayTaskDefinitionsOutput, error) { + if params == nil { + params = &ListWirelessGatewayTaskDefinitionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListWirelessGatewayTaskDefinitions", params, optFns, addOperationListWirelessGatewayTaskDefinitionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListWirelessGatewayTaskDefinitionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListWirelessGatewayTaskDefinitionsInput struct { + + // The maximum number of results to return in this operation. + MaxResults int32 + + // To retrieve the next set of results, the nextToken value from a previous + // response; otherwise null to receive the first set of results. + NextToken *string + + // A filter to list only the wireless gateway task definitions that use this task + // definition type. + TaskDefinitionType types.WirelessGatewayTaskDefinitionType +} + +type ListWirelessGatewayTaskDefinitionsOutput struct { + + // The token to use to get the next set of results, or null if there are no + // additional results. + NextToken *string + + // The list of task definitions. + TaskDefinitions []types.UpdateWirelessGatewayTaskEntry + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListWirelessGatewayTaskDefinitionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListWirelessGatewayTaskDefinitions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListWirelessGatewayTaskDefinitions{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListWirelessGatewayTaskDefinitions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opListWirelessGatewayTaskDefinitions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "ListWirelessGatewayTaskDefinitions", + } +} diff --git a/service/iotwireless/api_op_ListWirelessGateways.go b/service/iotwireless/api_op_ListWirelessGateways.go new file mode 100644 index 00000000000..964c627891a --- /dev/null +++ b/service/iotwireless/api_op_ListWirelessGateways.go @@ -0,0 +1,201 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the wireless gateways registered to your AWS account. +func (c *Client) ListWirelessGateways(ctx context.Context, params *ListWirelessGatewaysInput, optFns ...func(*Options)) (*ListWirelessGatewaysOutput, error) { + if params == nil { + params = &ListWirelessGatewaysInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListWirelessGateways", params, optFns, addOperationListWirelessGatewaysMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListWirelessGatewaysOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListWirelessGatewaysInput struct { + + // The maximum number of results to return in this operation. + MaxResults int32 + + // To retrieve the next set of results, the nextToken value from a previous + // response; otherwise null to receive the first set of results. + NextToken *string +} + +type ListWirelessGatewaysOutput struct { + + // The token to use to get the next set of results, or null if there are no + // additional results. + NextToken *string + + // The ID of the wireless gateway. + WirelessGatewayList []types.WirelessGatewayStatistics + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListWirelessGatewaysMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListWirelessGateways{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListWirelessGateways{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListWirelessGateways(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListWirelessGatewaysAPIClient is a client that implements the +// ListWirelessGateways operation. +type ListWirelessGatewaysAPIClient interface { + ListWirelessGateways(context.Context, *ListWirelessGatewaysInput, ...func(*Options)) (*ListWirelessGatewaysOutput, error) +} + +var _ ListWirelessGatewaysAPIClient = (*Client)(nil) + +// ListWirelessGatewaysPaginatorOptions is the paginator options for +// ListWirelessGateways +type ListWirelessGatewaysPaginatorOptions struct { + // The maximum number of results to return in this operation. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListWirelessGatewaysPaginator is a paginator for ListWirelessGateways +type ListWirelessGatewaysPaginator struct { + options ListWirelessGatewaysPaginatorOptions + client ListWirelessGatewaysAPIClient + params *ListWirelessGatewaysInput + nextToken *string + firstPage bool +} + +// NewListWirelessGatewaysPaginator returns a new ListWirelessGatewaysPaginator +func NewListWirelessGatewaysPaginator(client ListWirelessGatewaysAPIClient, params *ListWirelessGatewaysInput, optFns ...func(*ListWirelessGatewaysPaginatorOptions)) *ListWirelessGatewaysPaginator { + options := ListWirelessGatewaysPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWirelessGatewaysInput{} + } + + return &ListWirelessGatewaysPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWirelessGatewaysPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListWirelessGateways page. +func (p *ListWirelessGatewaysPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWirelessGatewaysOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListWirelessGateways(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListWirelessGateways(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "ListWirelessGateways", + } +} diff --git a/service/iotwireless/api_op_SendDataToWirelessDevice.go b/service/iotwireless/api_op_SendDataToWirelessDevice.go new file mode 100644 index 00000000000..2b4a6714382 --- /dev/null +++ b/service/iotwireless/api_op_SendDataToWirelessDevice.go @@ -0,0 +1,129 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Sends a decrypted application data frame to a device. +func (c *Client) SendDataToWirelessDevice(ctx context.Context, params *SendDataToWirelessDeviceInput, optFns ...func(*Options)) (*SendDataToWirelessDeviceOutput, error) { + if params == nil { + params = &SendDataToWirelessDeviceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SendDataToWirelessDevice", params, optFns, addOperationSendDataToWirelessDeviceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SendDataToWirelessDeviceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SendDataToWirelessDeviceInput struct { + + // The ID of the wireless device to receive the data. + // + // This member is required. + Id *string + + // The message payload to send. + // + // This member is required. + PayloadData *string + + // The transmit mode to use to send data to the wireless device. Can be: 0 for UM + // (unacknowledge mode), 1 for AM (acknowledge mode), or 2 for (TM) transparent + // mode. + // + // This member is required. + TransmitMode *int32 + + // Metadata about the message request. + WirelessMetadata *types.WirelessMetadata +} + +type SendDataToWirelessDeviceOutput struct { + + // The ID of the message sent to the wireless device. + MessageId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationSendDataToWirelessDeviceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpSendDataToWirelessDevice{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSendDataToWirelessDevice{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpSendDataToWirelessDeviceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendDataToWirelessDevice(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opSendDataToWirelessDevice(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "SendDataToWirelessDevice", + } +} diff --git a/service/iotwireless/api_op_TagResource.go b/service/iotwireless/api_op_TagResource.go new file mode 100644 index 00000000000..683de00e0b0 --- /dev/null +++ b/service/iotwireless/api_op_TagResource.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds a tag to a resource. +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The ARN of the resource to add tags to. + // + // This member is required. + ResourceArn *string + + // Adds to or modifies the tags of the given resource. Tags are metadata that can + // be used to manage a resource. + // + // This member is required. + Tags []types.Tag +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "iotwireless", + OperationName: "TagResource", + } +} diff --git a/service/iotwireless/api_op_TestWirelessDevice.go b/service/iotwireless/api_op_TestWirelessDevice.go new file mode 100644 index 00000000000..8bc3e47d239 --- /dev/null +++ b/service/iotwireless/api_op_TestWirelessDevice.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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" +) + +// Simulates a provisioned device by sending an uplink data payload of Hello. +func (c *Client) TestWirelessDevice(ctx context.Context, params *TestWirelessDeviceInput, optFns ...func(*Options)) (*TestWirelessDeviceOutput, error) { + if params == nil { + params = &TestWirelessDeviceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TestWirelessDevice", params, optFns, addOperationTestWirelessDeviceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TestWirelessDeviceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TestWirelessDeviceInput struct { + + // The ID of the wireless device to test. + // + // This member is required. + Id *string +} + +type TestWirelessDeviceOutput struct { + + // The result returned by the test. + Result *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationTestWirelessDeviceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpTestWirelessDevice{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTestWirelessDevice{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpTestWirelessDeviceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTestWirelessDevice(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opTestWirelessDevice(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "TestWirelessDevice", + } +} diff --git a/service/iotwireless/api_op_UntagResource.go b/service/iotwireless/api_op_UntagResource.go new file mode 100644 index 00000000000..cbe60364129 --- /dev/null +++ b/service/iotwireless/api_op_UntagResource.go @@ -0,0 +1,114 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes one or more tags from a resource. +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The ARN of the resource to remove tags from. + // + // This member is required. + ResourceArn *string + + // A list of the keys of the tags to remove from the resource. + // + // This member is required. + TagKeys []string +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "iotwireless", + OperationName: "UntagResource", + } +} diff --git a/service/iotwireless/api_op_UpdateDestination.go b/service/iotwireless/api_op_UpdateDestination.go new file mode 100644 index 00000000000..d0cc2ced913 --- /dev/null +++ b/service/iotwireless/api_op_UpdateDestination.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates properties of a destination. +func (c *Client) UpdateDestination(ctx context.Context, params *UpdateDestinationInput, optFns ...func(*Options)) (*UpdateDestinationOutput, error) { + if params == nil { + params = &UpdateDestinationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateDestination", params, optFns, addOperationUpdateDestinationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateDestinationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateDestinationInput struct { + + // The new name of the resource. + // + // This member is required. + Name *string + + // A new description of the resource. + Description *string + + // The new rule name or topic rule to send messages to. + Expression *string + + // The type of value in Expression. + ExpressionType types.ExpressionType + + // The ARN of the IAM Role that authorizes the destination. + RoleArn *string +} + +type UpdateDestinationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationUpdateDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateDestination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateDestination{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateDestinationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDestination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opUpdateDestination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "UpdateDestination", + } +} diff --git a/service/iotwireless/api_op_UpdatePartnerAccount.go b/service/iotwireless/api_op_UpdatePartnerAccount.go new file mode 100644 index 00000000000..cf7834ff49f --- /dev/null +++ b/service/iotwireless/api_op_UpdatePartnerAccount.go @@ -0,0 +1,120 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates properties of a partner account. +func (c *Client) UpdatePartnerAccount(ctx context.Context, params *UpdatePartnerAccountInput, optFns ...func(*Options)) (*UpdatePartnerAccountOutput, error) { + if params == nil { + params = &UpdatePartnerAccountInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdatePartnerAccount", params, optFns, addOperationUpdatePartnerAccountMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdatePartnerAccountOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdatePartnerAccountInput struct { + + // The ID of the partner account to update. + // + // This member is required. + PartnerAccountId *string + + // The partner type. + // + // This member is required. + PartnerType types.PartnerType + + // The Sidewalk account credentials. + // + // This member is required. + Sidewalk *types.SidewalkUpdateAccount +} + +type UpdatePartnerAccountOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationUpdatePartnerAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdatePartnerAccount{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdatePartnerAccount{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdatePartnerAccountValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePartnerAccount(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opUpdatePartnerAccount(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "UpdatePartnerAccount", + } +} diff --git a/service/iotwireless/api_op_UpdateWirelessDevice.go b/service/iotwireless/api_op_UpdateWirelessDevice.go new file mode 100644 index 00000000000..c236da6ec3e --- /dev/null +++ b/service/iotwireless/api_op_UpdateWirelessDevice.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates properties of a wireless device. +func (c *Client) UpdateWirelessDevice(ctx context.Context, params *UpdateWirelessDeviceInput, optFns ...func(*Options)) (*UpdateWirelessDeviceOutput, error) { + if params == nil { + params = &UpdateWirelessDeviceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateWirelessDevice", params, optFns, addOperationUpdateWirelessDeviceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateWirelessDeviceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateWirelessDeviceInput struct { + + // The ID of the resource to update. + // + // This member is required. + Id *string + + // A new description of the resource. + Description *string + + // The name of the new destination for the device. + DestinationName *string + + // The updated wireless device's configuration. + LoRaWAN *types.LoRaWANUpdateDevice + + // The new name of the resource. + Name *string +} + +type UpdateWirelessDeviceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationUpdateWirelessDeviceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateWirelessDevice{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateWirelessDevice{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateWirelessDeviceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateWirelessDevice(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opUpdateWirelessDevice(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "UpdateWirelessDevice", + } +} diff --git a/service/iotwireless/api_op_UpdateWirelessGateway.go b/service/iotwireless/api_op_UpdateWirelessGateway.go new file mode 100644 index 00000000000..6e0aa96cead --- /dev/null +++ b/service/iotwireless/api_op_UpdateWirelessGateway.go @@ -0,0 +1,115 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates properties of a wireless gateway. +func (c *Client) UpdateWirelessGateway(ctx context.Context, params *UpdateWirelessGatewayInput, optFns ...func(*Options)) (*UpdateWirelessGatewayOutput, error) { + if params == nil { + params = &UpdateWirelessGatewayInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateWirelessGateway", params, optFns, addOperationUpdateWirelessGatewayMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateWirelessGatewayOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateWirelessGatewayInput struct { + + // The ID of the resource to update. + // + // This member is required. + Id *string + + // A new description of the resource. + Description *string + + // The new name of the resource. + Name *string +} + +type UpdateWirelessGatewayOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationUpdateWirelessGatewayMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateWirelessGateway{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateWirelessGateway{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateWirelessGatewayValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateWirelessGateway(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opUpdateWirelessGateway(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotwireless", + OperationName: "UpdateWirelessGateway", + } +} diff --git a/service/iotwireless/deserializers.go b/service/iotwireless/deserializers.go new file mode 100644 index 00000000000..e089e76c4ba --- /dev/null +++ b/service/iotwireless/deserializers.go @@ -0,0 +1,10328 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/iotwireless/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "strings" +) + +type awsRestjson1_deserializeOpAssociateAwsAccountWithPartnerAccount struct { +} + +func (*awsRestjson1_deserializeOpAssociateAwsAccountWithPartnerAccount) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpAssociateAwsAccountWithPartnerAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorAssociateAwsAccountWithPartnerAccount(response, &metadata) + } + output := &AssociateAwsAccountWithPartnerAccountOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentAssociateAwsAccountWithPartnerAccountOutput(&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_deserializeOpErrorAssociateAwsAccountWithPartnerAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentAssociateAwsAccountWithPartnerAccountOutput(v **AssociateAwsAccountWithPartnerAccountOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *AssociateAwsAccountWithPartnerAccountOutput + if *v == nil { + sv = &AssociateAwsAccountWithPartnerAccountOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Sidewalk": + if err := awsRestjson1_deserializeDocumentSidewalkAccountInfo(&sv.Sidewalk, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpAssociateWirelessDeviceWithThing struct { +} + +func (*awsRestjson1_deserializeOpAssociateWirelessDeviceWithThing) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpAssociateWirelessDeviceWithThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorAssociateWirelessDeviceWithThing(response, &metadata) + } + output := &AssociateWirelessDeviceWithThingOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorAssociateWirelessDeviceWithThing(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpAssociateWirelessGatewayWithCertificate struct { +} + +func (*awsRestjson1_deserializeOpAssociateWirelessGatewayWithCertificate) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpAssociateWirelessGatewayWithCertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorAssociateWirelessGatewayWithCertificate(response, &metadata) + } + output := &AssociateWirelessGatewayWithCertificateOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentAssociateWirelessGatewayWithCertificateOutput(&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_deserializeOpErrorAssociateWirelessGatewayWithCertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentAssociateWirelessGatewayWithCertificateOutput(v **AssociateWirelessGatewayWithCertificateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *AssociateWirelessGatewayWithCertificateOutput + if *v == nil { + sv = &AssociateWirelessGatewayWithCertificateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "IotCertificateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IotCertificateId to be of type string, got %T instead", value) + } + sv.IotCertificateId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpAssociateWirelessGatewayWithThing struct { +} + +func (*awsRestjson1_deserializeOpAssociateWirelessGatewayWithThing) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpAssociateWirelessGatewayWithThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorAssociateWirelessGatewayWithThing(response, &metadata) + } + output := &AssociateWirelessGatewayWithThingOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorAssociateWirelessGatewayWithThing(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpCreateDestination struct { +} + +func (*awsRestjson1_deserializeOpCreateDestination) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateDestination(response, &metadata) + } + output := &CreateDestinationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateDestinationOutput(&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_deserializeOpErrorCreateDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateDestinationOutput(v **CreateDestinationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateDestinationOutput + if *v == nil { + sv = &CreateDestinationOutput{} + } 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 DestinationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateDeviceProfile struct { +} + +func (*awsRestjson1_deserializeOpCreateDeviceProfile) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateDeviceProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateDeviceProfile(response, &metadata) + } + output := &CreateDeviceProfileOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateDeviceProfileOutput(&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_deserializeOpErrorCreateDeviceProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateDeviceProfileOutput(v **CreateDeviceProfileOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateDeviceProfileOutput + if *v == nil { + sv = &CreateDeviceProfileOutput{} + } 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 DeviceProfileArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeviceProfileId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateServiceProfile struct { +} + +func (*awsRestjson1_deserializeOpCreateServiceProfile) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateServiceProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateServiceProfile(response, &metadata) + } + output := &CreateServiceProfileOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateServiceProfileOutput(&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_deserializeOpErrorCreateServiceProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateServiceProfileOutput(v **CreateServiceProfileOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateServiceProfileOutput + if *v == nil { + sv = &CreateServiceProfileOutput{} + } 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 ServiceProfileArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceProfileId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateWirelessDevice struct { +} + +func (*awsRestjson1_deserializeOpCreateWirelessDevice) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateWirelessDevice) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateWirelessDevice(response, &metadata) + } + output := &CreateWirelessDeviceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateWirelessDeviceOutput(&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_deserializeOpErrorCreateWirelessDevice(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateWirelessDeviceOutput(v **CreateWirelessDeviceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateWirelessDeviceOutput + if *v == nil { + sv = &CreateWirelessDeviceOutput{} + } 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 WirelessDeviceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessDeviceId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateWirelessGateway struct { +} + +func (*awsRestjson1_deserializeOpCreateWirelessGateway) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateWirelessGateway) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateWirelessGateway(response, &metadata) + } + output := &CreateWirelessGatewayOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateWirelessGatewayOutput(&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_deserializeOpErrorCreateWirelessGateway(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateWirelessGatewayOutput(v **CreateWirelessGatewayOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateWirelessGatewayOutput + if *v == nil { + sv = &CreateWirelessGatewayOutput{} + } 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 WirelessGatewayArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessDeviceId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateWirelessGatewayTask struct { +} + +func (*awsRestjson1_deserializeOpCreateWirelessGatewayTask) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateWirelessGatewayTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateWirelessGatewayTask(response, &metadata) + } + output := &CreateWirelessGatewayTaskOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateWirelessGatewayTaskOutput(&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_deserializeOpErrorCreateWirelessGatewayTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateWirelessGatewayTaskOutput(v **CreateWirelessGatewayTaskOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateWirelessGatewayTaskOutput + if *v == nil { + sv = &CreateWirelessGatewayTaskOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessGatewayTaskStatus to be of type string, got %T instead", value) + } + sv.Status = types.WirelessGatewayTaskStatus(jtv) + } + + case "WirelessGatewayTaskDefinitionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessGatewayTaskDefinitionId to be of type string, got %T instead", value) + } + sv.WirelessGatewayTaskDefinitionId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateWirelessGatewayTaskDefinition struct { +} + +func (*awsRestjson1_deserializeOpCreateWirelessGatewayTaskDefinition) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateWirelessGatewayTaskDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateWirelessGatewayTaskDefinition(response, &metadata) + } + output := &CreateWirelessGatewayTaskDefinitionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateWirelessGatewayTaskDefinitionOutput(&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_deserializeOpErrorCreateWirelessGatewayTaskDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateWirelessGatewayTaskDefinitionOutput(v **CreateWirelessGatewayTaskDefinitionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateWirelessGatewayTaskDefinitionOutput + if *v == nil { + sv = &CreateWirelessGatewayTaskDefinitionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessGatewayTaskDefinitionId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteDestination struct { +} + +func (*awsRestjson1_deserializeOpDeleteDestination) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteDestination(response, &metadata) + } + output := &DeleteDestinationOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteDeviceProfile struct { +} + +func (*awsRestjson1_deserializeOpDeleteDeviceProfile) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteDeviceProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteDeviceProfile(response, &metadata) + } + output := &DeleteDeviceProfileOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteDeviceProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteServiceProfile struct { +} + +func (*awsRestjson1_deserializeOpDeleteServiceProfile) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteServiceProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteServiceProfile(response, &metadata) + } + output := &DeleteServiceProfileOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteServiceProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteWirelessDevice struct { +} + +func (*awsRestjson1_deserializeOpDeleteWirelessDevice) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteWirelessDevice) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteWirelessDevice(response, &metadata) + } + output := &DeleteWirelessDeviceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteWirelessDevice(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteWirelessGateway struct { +} + +func (*awsRestjson1_deserializeOpDeleteWirelessGateway) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteWirelessGateway) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteWirelessGateway(response, &metadata) + } + output := &DeleteWirelessGatewayOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteWirelessGateway(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteWirelessGatewayTask struct { +} + +func (*awsRestjson1_deserializeOpDeleteWirelessGatewayTask) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteWirelessGatewayTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteWirelessGatewayTask(response, &metadata) + } + output := &DeleteWirelessGatewayTaskOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteWirelessGatewayTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteWirelessGatewayTaskDefinition struct { +} + +func (*awsRestjson1_deserializeOpDeleteWirelessGatewayTaskDefinition) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteWirelessGatewayTaskDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteWirelessGatewayTaskDefinition(response, &metadata) + } + output := &DeleteWirelessGatewayTaskDefinitionOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteWirelessGatewayTaskDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDisassociateAwsAccountFromPartnerAccount struct { +} + +func (*awsRestjson1_deserializeOpDisassociateAwsAccountFromPartnerAccount) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDisassociateAwsAccountFromPartnerAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDisassociateAwsAccountFromPartnerAccount(response, &metadata) + } + output := &DisassociateAwsAccountFromPartnerAccountOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDisassociateAwsAccountFromPartnerAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDisassociateWirelessDeviceFromThing struct { +} + +func (*awsRestjson1_deserializeOpDisassociateWirelessDeviceFromThing) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDisassociateWirelessDeviceFromThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDisassociateWirelessDeviceFromThing(response, &metadata) + } + output := &DisassociateWirelessDeviceFromThingOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDisassociateWirelessDeviceFromThing(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDisassociateWirelessGatewayFromCertificate struct { +} + +func (*awsRestjson1_deserializeOpDisassociateWirelessGatewayFromCertificate) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDisassociateWirelessGatewayFromCertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDisassociateWirelessGatewayFromCertificate(response, &metadata) + } + output := &DisassociateWirelessGatewayFromCertificateOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDisassociateWirelessGatewayFromCertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDisassociateWirelessGatewayFromThing struct { +} + +func (*awsRestjson1_deserializeOpDisassociateWirelessGatewayFromThing) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDisassociateWirelessGatewayFromThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDisassociateWirelessGatewayFromThing(response, &metadata) + } + output := &DisassociateWirelessGatewayFromThingOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDisassociateWirelessGatewayFromThing(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpGetDestination struct { +} + +func (*awsRestjson1_deserializeOpGetDestination) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetDestination(response, &metadata) + } + output := &GetDestinationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetDestinationOutput(&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_deserializeOpErrorGetDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetDestinationOutput(v **GetDestinationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetDestinationOutput + if *v == nil { + sv = &GetDestinationOutput{} + } 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 DestinationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "Expression": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Expression to be of type string, got %T instead", value) + } + sv.Expression = ptr.String(jtv) + } + + case "ExpressionType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExpressionType to be of type string, got %T instead", value) + } + sv.ExpressionType = types.ExpressionType(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "RoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) + } + sv.RoleArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetDeviceProfile struct { +} + +func (*awsRestjson1_deserializeOpGetDeviceProfile) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetDeviceProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetDeviceProfile(response, &metadata) + } + output := &GetDeviceProfileOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetDeviceProfileOutput(&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_deserializeOpErrorGetDeviceProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetDeviceProfileOutput(v **GetDeviceProfileOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetDeviceProfileOutput + if *v == nil { + sv = &GetDeviceProfileOutput{} + } 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 DeviceProfileArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeviceProfileId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "LoRaWAN": + if err := awsRestjson1_deserializeDocumentLoRaWANDeviceProfile(&sv.LoRaWAN, value); err != nil { + return err + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeviceProfileName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetPartnerAccount struct { +} + +func (*awsRestjson1_deserializeOpGetPartnerAccount) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetPartnerAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetPartnerAccount(response, &metadata) + } + output := &GetPartnerAccountOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetPartnerAccountOutput(&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_deserializeOpErrorGetPartnerAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetPartnerAccountOutput(v **GetPartnerAccountOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetPartnerAccountOutput + if *v == nil { + sv = &GetPartnerAccountOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AccountLinked": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected AccountLinked to be of type *bool, got %T instead", value) + } + sv.AccountLinked = jtv + } + + case "Sidewalk": + if err := awsRestjson1_deserializeDocumentSidewalkAccountInfoWithFingerprint(&sv.Sidewalk, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetServiceEndpoint struct { +} + +func (*awsRestjson1_deserializeOpGetServiceEndpoint) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetServiceEndpoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetServiceEndpoint(response, &metadata) + } + output := &GetServiceEndpointOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetServiceEndpointOutput(&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_deserializeOpErrorGetServiceEndpoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetServiceEndpointOutput(v **GetServiceEndpointOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetServiceEndpointOutput + if *v == nil { + sv = &GetServiceEndpointOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ServerTrust": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificatePEM to be of type string, got %T instead", value) + } + sv.ServerTrust = ptr.String(jtv) + } + + case "ServiceEndpoint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EndPoint to be of type string, got %T instead", value) + } + sv.ServiceEndpoint = ptr.String(jtv) + } + + case "ServiceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessGatewayServiceType to be of type string, got %T instead", value) + } + sv.ServiceType = types.WirelessGatewayServiceType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetServiceProfile struct { +} + +func (*awsRestjson1_deserializeOpGetServiceProfile) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetServiceProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetServiceProfile(response, &metadata) + } + output := &GetServiceProfileOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetServiceProfileOutput(&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_deserializeOpErrorGetServiceProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetServiceProfileOutput(v **GetServiceProfileOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetServiceProfileOutput + if *v == nil { + sv = &GetServiceProfileOutput{} + } 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 ServiceProfileArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceProfileId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "LoRaWAN": + if err := awsRestjson1_deserializeDocumentLoRaWANGetServiceProfileInfo(&sv.LoRaWAN, value); err != nil { + return err + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceProfileName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetWirelessDevice struct { +} + +func (*awsRestjson1_deserializeOpGetWirelessDevice) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetWirelessDevice) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetWirelessDevice(response, &metadata) + } + output := &GetWirelessDeviceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetWirelessDeviceOutput(&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_deserializeOpErrorGetWirelessDevice(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetWirelessDeviceOutput(v **GetWirelessDeviceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetWirelessDeviceOutput + if *v == nil { + sv = &GetWirelessDeviceOutput{} + } 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 WirelessDeviceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "DestinationName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationName to be of type string, got %T instead", value) + } + sv.DestinationName = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessDeviceId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "LoRaWAN": + if err := awsRestjson1_deserializeDocumentLoRaWANDevice(&sv.LoRaWAN, value); err != nil { + return err + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessDeviceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "ThingArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ThingArn to be of type string, got %T instead", value) + } + sv.ThingArn = ptr.String(jtv) + } + + case "ThingName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ThingName to be of type string, got %T instead", value) + } + sv.ThingName = ptr.String(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessDeviceType to be of type string, got %T instead", value) + } + sv.Type = types.WirelessDeviceType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetWirelessDeviceStatistics struct { +} + +func (*awsRestjson1_deserializeOpGetWirelessDeviceStatistics) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetWirelessDeviceStatistics) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetWirelessDeviceStatistics(response, &metadata) + } + output := &GetWirelessDeviceStatisticsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetWirelessDeviceStatisticsOutput(&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_deserializeOpErrorGetWirelessDeviceStatistics(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetWirelessDeviceStatisticsOutput(v **GetWirelessDeviceStatisticsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetWirelessDeviceStatisticsOutput + if *v == nil { + sv = &GetWirelessDeviceStatisticsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LastUplinkReceivedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ISODateTimeString to be of type string, got %T instead", value) + } + sv.LastUplinkReceivedAt = ptr.String(jtv) + } + + case "LoRaWAN": + if err := awsRestjson1_deserializeDocumentLoRaWANDeviceMetadata(&sv.LoRaWAN, value); err != nil { + return err + } + + case "WirelessDeviceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessDeviceId to be of type string, got %T instead", value) + } + sv.WirelessDeviceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetWirelessGateway struct { +} + +func (*awsRestjson1_deserializeOpGetWirelessGateway) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetWirelessGateway) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetWirelessGateway(response, &metadata) + } + output := &GetWirelessGatewayOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetWirelessGatewayOutput(&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_deserializeOpErrorGetWirelessGateway(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetWirelessGatewayOutput(v **GetWirelessGatewayOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetWirelessGatewayOutput + if *v == nil { + sv = &GetWirelessGatewayOutput{} + } 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 WirelessGatewayArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessGatewayId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "LoRaWAN": + if err := awsRestjson1_deserializeDocumentLoRaWANGateway(&sv.LoRaWAN, value); err != nil { + return err + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessGatewayName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "ThingArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ThingArn to be of type string, got %T instead", value) + } + sv.ThingArn = ptr.String(jtv) + } + + case "ThingName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ThingName to be of type string, got %T instead", value) + } + sv.ThingName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetWirelessGatewayCertificate struct { +} + +func (*awsRestjson1_deserializeOpGetWirelessGatewayCertificate) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetWirelessGatewayCertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetWirelessGatewayCertificate(response, &metadata) + } + output := &GetWirelessGatewayCertificateOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetWirelessGatewayCertificateOutput(&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_deserializeOpErrorGetWirelessGatewayCertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetWirelessGatewayCertificateOutput(v **GetWirelessGatewayCertificateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetWirelessGatewayCertificateOutput + if *v == nil { + sv = &GetWirelessGatewayCertificateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "IotCertificateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IotCertificateId to be of type string, got %T instead", value) + } + sv.IotCertificateId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetWirelessGatewayFirmwareInformation struct { +} + +func (*awsRestjson1_deserializeOpGetWirelessGatewayFirmwareInformation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetWirelessGatewayFirmwareInformation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetWirelessGatewayFirmwareInformation(response, &metadata) + } + output := &GetWirelessGatewayFirmwareInformationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetWirelessGatewayFirmwareInformationOutput(&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_deserializeOpErrorGetWirelessGatewayFirmwareInformation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetWirelessGatewayFirmwareInformationOutput(v **GetWirelessGatewayFirmwareInformationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetWirelessGatewayFirmwareInformationOutput + if *v == nil { + sv = &GetWirelessGatewayFirmwareInformationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LoRaWAN": + if err := awsRestjson1_deserializeDocumentLoRaWANGatewayCurrentVersion(&sv.LoRaWAN, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetWirelessGatewayStatistics struct { +} + +func (*awsRestjson1_deserializeOpGetWirelessGatewayStatistics) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetWirelessGatewayStatistics) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetWirelessGatewayStatistics(response, &metadata) + } + output := &GetWirelessGatewayStatisticsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetWirelessGatewayStatisticsOutput(&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_deserializeOpErrorGetWirelessGatewayStatistics(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetWirelessGatewayStatisticsOutput(v **GetWirelessGatewayStatisticsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetWirelessGatewayStatisticsOutput + if *v == nil { + sv = &GetWirelessGatewayStatisticsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LastUplinkReceivedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ISODateTimeString to be of type string, got %T instead", value) + } + sv.LastUplinkReceivedAt = ptr.String(jtv) + } + + case "WirelessGatewayId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessGatewayId to be of type string, got %T instead", value) + } + sv.WirelessGatewayId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetWirelessGatewayTask struct { +} + +func (*awsRestjson1_deserializeOpGetWirelessGatewayTask) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetWirelessGatewayTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetWirelessGatewayTask(response, &metadata) + } + output := &GetWirelessGatewayTaskOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetWirelessGatewayTaskOutput(&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_deserializeOpErrorGetWirelessGatewayTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetWirelessGatewayTaskOutput(v **GetWirelessGatewayTaskOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetWirelessGatewayTaskOutput + if *v == nil { + sv = &GetWirelessGatewayTaskOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LastUplinkReceivedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ISODateTimeString to be of type string, got %T instead", value) + } + sv.LastUplinkReceivedAt = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessGatewayTaskStatus to be of type string, got %T instead", value) + } + sv.Status = types.WirelessGatewayTaskStatus(jtv) + } + + case "TaskCreatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ISODateTimeString to be of type string, got %T instead", value) + } + sv.TaskCreatedAt = ptr.String(jtv) + } + + case "WirelessGatewayId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessGatewayId to be of type string, got %T instead", value) + } + sv.WirelessGatewayId = ptr.String(jtv) + } + + case "WirelessGatewayTaskDefinitionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessGatewayTaskDefinitionId to be of type string, got %T instead", value) + } + sv.WirelessGatewayTaskDefinitionId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetWirelessGatewayTaskDefinition struct { +} + +func (*awsRestjson1_deserializeOpGetWirelessGatewayTaskDefinition) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetWirelessGatewayTaskDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetWirelessGatewayTaskDefinition(response, &metadata) + } + output := &GetWirelessGatewayTaskDefinitionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetWirelessGatewayTaskDefinitionOutput(&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_deserializeOpErrorGetWirelessGatewayTaskDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetWirelessGatewayTaskDefinitionOutput(v **GetWirelessGatewayTaskDefinitionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetWirelessGatewayTaskDefinitionOutput + if *v == nil { + sv = &GetWirelessGatewayTaskDefinitionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AutoCreateTasks": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected AutoCreateTasks to be of type *bool, got %T instead", value) + } + sv.AutoCreateTasks = jtv + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessGatewayTaskName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Update": + if err := awsRestjson1_deserializeDocumentUpdateWirelessGatewayTaskCreate(&sv.Update, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListDestinations struct { +} + +func (*awsRestjson1_deserializeOpListDestinations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListDestinations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListDestinations(response, &metadata) + } + output := &ListDestinationsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListDestinationsOutput(&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_deserializeOpErrorListDestinations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListDestinationsOutput(v **ListDestinationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListDestinationsOutput + if *v == nil { + sv = &ListDestinationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DestinationList": + if err := awsRestjson1_deserializeDocumentDestinationList(&sv.DestinationList, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListDeviceProfiles struct { +} + +func (*awsRestjson1_deserializeOpListDeviceProfiles) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListDeviceProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListDeviceProfiles(response, &metadata) + } + output := &ListDeviceProfilesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListDeviceProfilesOutput(&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_deserializeOpErrorListDeviceProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListDeviceProfilesOutput(v **ListDeviceProfilesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListDeviceProfilesOutput + if *v == nil { + sv = &ListDeviceProfilesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DeviceProfileList": + if err := awsRestjson1_deserializeDocumentDeviceProfileList(&sv.DeviceProfileList, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListPartnerAccounts struct { +} + +func (*awsRestjson1_deserializeOpListPartnerAccounts) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListPartnerAccounts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListPartnerAccounts(response, &metadata) + } + output := &ListPartnerAccountsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListPartnerAccountsOutput(&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_deserializeOpErrorListPartnerAccounts(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListPartnerAccountsOutput(v **ListPartnerAccountsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListPartnerAccountsOutput + if *v == nil { + sv = &ListPartnerAccountsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "Sidewalk": + if err := awsRestjson1_deserializeDocumentSidewalkAccountList(&sv.Sidewalk, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListServiceProfiles struct { +} + +func (*awsRestjson1_deserializeOpListServiceProfiles) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListServiceProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListServiceProfiles(response, &metadata) + } + output := &ListServiceProfilesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListServiceProfilesOutput(&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_deserializeOpErrorListServiceProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListServiceProfilesOutput(v **ListServiceProfilesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListServiceProfilesOutput + if *v == nil { + sv = &ListServiceProfilesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "ServiceProfileList": + if err := awsRestjson1_deserializeDocumentServiceProfileList(&sv.ServiceProfileList, 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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(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_deserializeOpListWirelessDevices struct { +} + +func (*awsRestjson1_deserializeOpListWirelessDevices) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListWirelessDevices) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListWirelessDevices(response, &metadata) + } + output := &ListWirelessDevicesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListWirelessDevicesOutput(&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_deserializeOpErrorListWirelessDevices(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListWirelessDevicesOutput(v **ListWirelessDevicesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListWirelessDevicesOutput + if *v == nil { + sv = &ListWirelessDevicesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "WirelessDeviceList": + if err := awsRestjson1_deserializeDocumentWirelessDeviceStatisticsList(&sv.WirelessDeviceList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListWirelessGateways struct { +} + +func (*awsRestjson1_deserializeOpListWirelessGateways) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListWirelessGateways) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListWirelessGateways(response, &metadata) + } + output := &ListWirelessGatewaysOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListWirelessGatewaysOutput(&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_deserializeOpErrorListWirelessGateways(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListWirelessGatewaysOutput(v **ListWirelessGatewaysOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListWirelessGatewaysOutput + if *v == nil { + sv = &ListWirelessGatewaysOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "WirelessGatewayList": + if err := awsRestjson1_deserializeDocumentWirelessGatewayStatisticsList(&sv.WirelessGatewayList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListWirelessGatewayTaskDefinitions struct { +} + +func (*awsRestjson1_deserializeOpListWirelessGatewayTaskDefinitions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListWirelessGatewayTaskDefinitions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListWirelessGatewayTaskDefinitions(response, &metadata) + } + output := &ListWirelessGatewayTaskDefinitionsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListWirelessGatewayTaskDefinitionsOutput(&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_deserializeOpErrorListWirelessGatewayTaskDefinitions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListWirelessGatewayTaskDefinitionsOutput(v **ListWirelessGatewayTaskDefinitionsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListWirelessGatewayTaskDefinitionsOutput + if *v == nil { + sv = &ListWirelessGatewayTaskDefinitionsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "TaskDefinitions": + if err := awsRestjson1_deserializeDocumentWirelessGatewayTaskDefinitionList(&sv.TaskDefinitions, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpSendDataToWirelessDevice struct { +} + +func (*awsRestjson1_deserializeOpSendDataToWirelessDevice) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSendDataToWirelessDevice) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorSendDataToWirelessDevice(response, &metadata) + } + output := &SendDataToWirelessDeviceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentSendDataToWirelessDeviceOutput(&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_deserializeOpErrorSendDataToWirelessDevice(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentSendDataToWirelessDeviceOutput(v **SendDataToWirelessDeviceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *SendDataToWirelessDeviceOutput + if *v == nil { + sv = &SendDataToWirelessDeviceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MessageId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MessageId to be of type string, got %T instead", value) + } + sv.MessageId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpTagResource struct { +} + +func (*awsRestjson1_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(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_deserializeOpTestWirelessDevice struct { +} + +func (*awsRestjson1_deserializeOpTestWirelessDevice) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTestWirelessDevice) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorTestWirelessDevice(response, &metadata) + } + output := &TestWirelessDeviceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentTestWirelessDeviceOutput(&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_deserializeOpErrorTestWirelessDevice(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentTestWirelessDeviceOutput(v **TestWirelessDeviceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *TestWirelessDeviceOutput + if *v == nil { + sv = &TestWirelessDeviceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Result": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Result to be of type string, got %T instead", value) + } + sv.Result = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateDestination struct { +} + +func (*awsRestjson1_deserializeOpUpdateDestination) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateDestination(response, &metadata) + } + output := &UpdateDestinationOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdatePartnerAccount struct { +} + +func (*awsRestjson1_deserializeOpUpdatePartnerAccount) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdatePartnerAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdatePartnerAccount(response, &metadata) + } + output := &UpdatePartnerAccountOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdatePartnerAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateWirelessDevice struct { +} + +func (*awsRestjson1_deserializeOpUpdateWirelessDevice) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateWirelessDevice) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateWirelessDevice(response, &metadata) + } + output := &UpdateWirelessDeviceOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateWirelessDevice(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateWirelessGateway struct { +} + +func (*awsRestjson1_deserializeOpUpdateWirelessGateway) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateWirelessGateway) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateWirelessGateway(response, &metadata) + } + output := &UpdateWirelessGatewayOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateWirelessGateway(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_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_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_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_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_deserializeDocumentAbpV1_0_x(v **types.AbpV1_0_x, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AbpV1_0_x + if *v == nil { + sv = &types.AbpV1_0_x{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DevAddr": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DevAddr to be of type string, got %T instead", value) + } + sv.DevAddr = ptr.String(jtv) + } + + case "SessionKeys": + if err := awsRestjson1_deserializeDocumentSessionKeysAbpV1_0_x(&sv.SessionKeys, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAbpV1_1(v **types.AbpV1_1, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AbpV1_1 + if *v == nil { + sv = &types.AbpV1_1{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DevAddr": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DevAddr to be of type string, got %T instead", value) + } + sv.DevAddr = ptr.String(jtv) + } + + case "SessionKeys": + if err := awsRestjson1_deserializeDocumentSessionKeysAbpV1_1(&sv.SessionKeys, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +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 Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "ResourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "ResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDestinationList(v *[]types.Destinations, 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.Destinations + if *v == nil { + cv = []types.Destinations{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Destinations + destAddr := &col + if err := awsRestjson1_deserializeDocumentDestinations(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentDestinations(v **types.Destinations, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Destinations + if *v == nil { + sv = &types.Destinations{} + } 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 DestinationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "Expression": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Expression to be of type string, got %T instead", value) + } + sv.Expression = ptr.String(jtv) + } + + case "ExpressionType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExpressionType to be of type string, got %T instead", value) + } + sv.ExpressionType = types.ExpressionType(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "RoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) + } + sv.RoleArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDeviceProfile(v **types.DeviceProfile, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DeviceProfile + if *v == nil { + sv = &types.DeviceProfile{} + } 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 DeviceProfileArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeviceProfileId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeviceProfileName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDeviceProfileList(v *[]types.DeviceProfile, 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.DeviceProfile + if *v == nil { + cv = []types.DeviceProfile{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DeviceProfile + destAddr := &col + if err := awsRestjson1_deserializeDocumentDeviceProfile(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFactoryPresetFreqsList(v *[]int32, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []int32 + if *v == nil { + cv = []int32{} + } else { + cv = *v + } + + for _, value := range shape { + var col int32 + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected PresetFreq to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + col = int32(i64) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func 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 Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLoRaWANDevice(v **types.LoRaWANDevice, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LoRaWANDevice + if *v == nil { + sv = &types.LoRaWANDevice{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AbpV1_0_x": + if err := awsRestjson1_deserializeDocumentAbpV1_0_x(&sv.AbpV1_0_x, value); err != nil { + return err + } + + case "AbpV1_1": + if err := awsRestjson1_deserializeDocumentAbpV1_1(&sv.AbpV1_1, value); err != nil { + return err + } + + case "DevEui": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DevEui to be of type string, got %T instead", value) + } + sv.DevEui = ptr.String(jtv) + } + + case "DeviceProfileId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeviceProfileId to be of type string, got %T instead", value) + } + sv.DeviceProfileId = ptr.String(jtv) + } + + case "OtaaV1_0_x": + if err := awsRestjson1_deserializeDocumentOtaaV1_0_x(&sv.OtaaV1_0_x, value); err != nil { + return err + } + + case "OtaaV1_1": + if err := awsRestjson1_deserializeDocumentOtaaV1_1(&sv.OtaaV1_1, value); err != nil { + return err + } + + case "ServiceProfileId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceProfileId to be of type string, got %T instead", value) + } + sv.ServiceProfileId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLoRaWANDeviceMetadata(v **types.LoRaWANDeviceMetadata, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LoRaWANDeviceMetadata + if *v == nil { + sv = &types.LoRaWANDeviceMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DataRate": + 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.DataRate = ptr.Int32(int32(i64)) + } + + case "DevEui": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DevEui to be of type string, got %T instead", value) + } + sv.DevEui = ptr.String(jtv) + } + + case "FPort": + 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.FPort = ptr.Int32(int32(i64)) + } + + case "Frequency": + 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.Frequency = ptr.Int32(int32(i64)) + } + + case "Gateways": + if err := awsRestjson1_deserializeDocumentLoRaWANGatewayMetadataList(&sv.Gateways, value); err != nil { + return err + } + + case "Timestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ISODateTimeString to be of type string, got %T instead", value) + } + sv.Timestamp = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLoRaWANDeviceProfile(v **types.LoRaWANDeviceProfile, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LoRaWANDeviceProfile + if *v == nil { + sv = &types.LoRaWANDeviceProfile{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ClassBTimeout": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ClassBTimeout to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ClassBTimeout = ptr.Int32(int32(i64)) + } + + case "ClassCTimeout": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ClassCTimeout to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ClassCTimeout = ptr.Int32(int32(i64)) + } + + case "FactoryPresetFreqsList": + if err := awsRestjson1_deserializeDocumentFactoryPresetFreqsList(&sv.FactoryPresetFreqsList, value); err != nil { + return err + } + + case "MacVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MacVersion to be of type string, got %T instead", value) + } + sv.MacVersion = ptr.String(jtv) + } + + case "MaxDutyCycle": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaxDutyCycle to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxDutyCycle = ptr.Int32(int32(i64)) + } + + case "MaxEirp": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MaxEirp to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxEirp = ptr.Int32(int32(i64)) + } + + case "PingSlotDr": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected PingSlotDr to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.PingSlotDr = ptr.Int32(int32(i64)) + } + + case "PingSlotFreq": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected PingSlotFreq to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.PingSlotFreq = ptr.Int32(int32(i64)) + } + + case "PingSlotPeriod": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected PingSlotPeriod to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.PingSlotPeriod = ptr.Int32(int32(i64)) + } + + case "RegParamsRevision": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RegParamsRevision to be of type string, got %T instead", value) + } + sv.RegParamsRevision = ptr.String(jtv) + } + + case "RfRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RfRegion to be of type string, got %T instead", value) + } + sv.RfRegion = ptr.String(jtv) + } + + case "RxDataRate2": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RxDataRate2 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RxDataRate2 = ptr.Int32(int32(i64)) + } + + case "RxDelay1": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RxDelay1 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RxDelay1 = ptr.Int32(int32(i64)) + } + + case "RxDrOffset1": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RxDrOffset1 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RxDrOffset1 = ptr.Int32(int32(i64)) + } + + case "RxFreq2": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RxFreq2 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RxFreq2 = ptr.Int32(int32(i64)) + } + + case "Supports32BitFCnt": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Supports32BitFCnt to be of type *bool, got %T instead", value) + } + sv.Supports32BitFCnt = jtv + } + + case "SupportsClassB": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected SupportsClassB to be of type *bool, got %T instead", value) + } + sv.SupportsClassB = jtv + } + + case "SupportsClassC": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected SupportsClassC to be of type *bool, got %T instead", value) + } + sv.SupportsClassC = jtv + } + + case "SupportsJoin": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected SupportsJoin to be of type *bool, got %T instead", value) + } + sv.SupportsJoin = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLoRaWANGateway(v **types.LoRaWANGateway, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LoRaWANGateway + if *v == nil { + sv = &types.LoRaWANGateway{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "GatewayEui": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GatewayEui to be of type string, got %T instead", value) + } + sv.GatewayEui = ptr.String(jtv) + } + + case "RfRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RfRegion to be of type string, got %T instead", value) + } + sv.RfRegion = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLoRaWANGatewayCurrentVersion(v **types.LoRaWANGatewayCurrentVersion, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LoRaWANGatewayCurrentVersion + if *v == nil { + sv = &types.LoRaWANGatewayCurrentVersion{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CurrentVersion": + if err := awsRestjson1_deserializeDocumentLoRaWANGatewayVersion(&sv.CurrentVersion, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLoRaWANGatewayMetadata(v **types.LoRaWANGatewayMetadata, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LoRaWANGatewayMetadata + if *v == nil { + sv = &types.LoRaWANGatewayMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "GatewayEui": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GatewayEui to be of type string, got %T instead", value) + } + sv.GatewayEui = ptr.String(jtv) + } + + case "Rssi": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Double to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Rssi = ptr.Float64(f64) + } + + case "Snr": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Double to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Snr = ptr.Float64(f64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLoRaWANGatewayMetadataList(v *[]types.LoRaWANGatewayMetadata, 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.LoRaWANGatewayMetadata + if *v == nil { + cv = []types.LoRaWANGatewayMetadata{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LoRaWANGatewayMetadata + destAddr := &col + if err := awsRestjson1_deserializeDocumentLoRaWANGatewayMetadata(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentLoRaWANGatewayVersion(v **types.LoRaWANGatewayVersion, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LoRaWANGatewayVersion + if *v == nil { + sv = &types.LoRaWANGatewayVersion{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Model": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Model to be of type string, got %T instead", value) + } + sv.Model = ptr.String(jtv) + } + + case "PackageVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PackageVersion to be of type string, got %T instead", value) + } + sv.PackageVersion = ptr.String(jtv) + } + + case "Station": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Station to be of type string, got %T instead", value) + } + sv.Station = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLoRaWANGetServiceProfileInfo(v **types.LoRaWANGetServiceProfileInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LoRaWANGetServiceProfileInfo + if *v == nil { + sv = &types.LoRaWANGetServiceProfileInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AddGwMetadata": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected AddGwMetadata to be of type *bool, got %T instead", value) + } + sv.AddGwMetadata = jtv + } + + case "ChannelMask": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ChannelMask to be of type string, got %T instead", value) + } + sv.ChannelMask = ptr.String(jtv) + } + + case "DevStatusReqFreq": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DevStatusReqFreq to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.DevStatusReqFreq = ptr.Int32(int32(i64)) + } + + case "DlBucketSize": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DlBucketSize to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.DlBucketSize = ptr.Int32(int32(i64)) + } + + case "DlRate": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DlRate to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.DlRate = ptr.Int32(int32(i64)) + } + + case "DlRatePolicy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DlRatePolicy to be of type string, got %T instead", value) + } + sv.DlRatePolicy = ptr.String(jtv) + } + + case "DrMax": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DrMax to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.DrMax = int32(i64) + } + + case "DrMin": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DrMin to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.DrMin = int32(i64) + } + + case "HrAllowed": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected HrAllowed to be of type *bool, got %T instead", value) + } + sv.HrAllowed = jtv + } + + case "MinGwDiversity": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MinGwDiversity to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MinGwDiversity = ptr.Int32(int32(i64)) + } + + case "NwkGeoLoc": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected NwkGeoLoc to be of type *bool, got %T instead", value) + } + sv.NwkGeoLoc = jtv + } + + case "PrAllowed": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected PrAllowed to be of type *bool, got %T instead", value) + } + sv.PrAllowed = jtv + } + + case "RaAllowed": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected RaAllowed to be of type *bool, got %T instead", value) + } + sv.RaAllowed = jtv + } + + case "ReportDevStatusBattery": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected ReportDevStatusBattery to be of type *bool, got %T instead", value) + } + sv.ReportDevStatusBattery = jtv + } + + case "ReportDevStatusMargin": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected ReportDevStatusMargin to be of type *bool, got %T instead", value) + } + sv.ReportDevStatusMargin = jtv + } + + case "TargetPer": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected TargetPer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TargetPer = int32(i64) + } + + case "UlBucketSize": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UlBucketSize to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.UlBucketSize = ptr.Int32(int32(i64)) + } + + case "UlRate": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected UlRate to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.UlRate = ptr.Int32(int32(i64)) + } + + case "UlRatePolicy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UlRatePolicy to be of type string, got %T instead", value) + } + sv.UlRatePolicy = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLoRaWANListDevice(v **types.LoRaWANListDevice, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LoRaWANListDevice + if *v == nil { + sv = &types.LoRaWANListDevice{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DevEui": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DevEui to be of type string, got %T instead", value) + } + sv.DevEui = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLoRaWANUpdateGatewayTaskCreate(v **types.LoRaWANUpdateGatewayTaskCreate, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LoRaWANUpdateGatewayTaskCreate + if *v == nil { + sv = &types.LoRaWANUpdateGatewayTaskCreate{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CurrentVersion": + if err := awsRestjson1_deserializeDocumentLoRaWANGatewayVersion(&sv.CurrentVersion, value); err != nil { + return err + } + + case "SigKeyCrc": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Crc to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.SigKeyCrc = ptr.Int64(i64) + } + + case "UpdateSignature": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UpdateSignature to be of type string, got %T instead", value) + } + sv.UpdateSignature = ptr.String(jtv) + } + + case "UpdateVersion": + if err := awsRestjson1_deserializeDocumentLoRaWANGatewayVersion(&sv.UpdateVersion, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLoRaWANUpdateGatewayTaskEntry(v **types.LoRaWANUpdateGatewayTaskEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LoRaWANUpdateGatewayTaskEntry + if *v == nil { + sv = &types.LoRaWANUpdateGatewayTaskEntry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CurrentVersion": + if err := awsRestjson1_deserializeDocumentLoRaWANGatewayVersion(&sv.CurrentVersion, value); err != nil { + return err + } + + case "UpdateVersion": + if err := awsRestjson1_deserializeDocumentLoRaWANGatewayVersion(&sv.UpdateVersion, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentOtaaV1_0_x(v **types.OtaaV1_0_x, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.OtaaV1_0_x + if *v == nil { + sv = &types.OtaaV1_0_x{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AppEui": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AppEui to be of type string, got %T instead", value) + } + sv.AppEui = ptr.String(jtv) + } + + case "AppKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AppKey to be of type string, got %T instead", value) + } + sv.AppKey = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentOtaaV1_1(v **types.OtaaV1_1, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.OtaaV1_1 + if *v == nil { + sv = &types.OtaaV1_1{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AppKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AppKey to be of type string, got %T instead", value) + } + sv.AppKey = ptr.String(jtv) + } + + case "JoinEui": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JoinEui to be of type string, got %T instead", value) + } + sv.JoinEui = ptr.String(jtv) + } + + case "NwkKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NwkKey to be of type string, got %T instead", value) + } + sv.NwkKey = 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 Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "ResourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "ResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentServiceProfile(v **types.ServiceProfile, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ServiceProfile + if *v == nil { + sv = &types.ServiceProfile{} + } 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 ServiceProfileArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceProfileId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceProfileName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentServiceProfileList(v *[]types.ServiceProfile, 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.ServiceProfile + if *v == nil { + cv = []types.ServiceProfile{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ServiceProfile + destAddr := &col + if err := awsRestjson1_deserializeDocumentServiceProfile(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSessionKeysAbpV1_0_x(v **types.SessionKeysAbpV1_0_x, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SessionKeysAbpV1_0_x + if *v == nil { + sv = &types.SessionKeysAbpV1_0_x{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AppSKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AppSKey to be of type string, got %T instead", value) + } + sv.AppSKey = ptr.String(jtv) + } + + case "NwkSKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NwkSKey to be of type string, got %T instead", value) + } + sv.NwkSKey = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSessionKeysAbpV1_1(v **types.SessionKeysAbpV1_1, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SessionKeysAbpV1_1 + if *v == nil { + sv = &types.SessionKeysAbpV1_1{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AppSKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AppSKey to be of type string, got %T instead", value) + } + sv.AppSKey = ptr.String(jtv) + } + + case "FNwkSIntKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FNwkSIntKey to be of type string, got %T instead", value) + } + sv.FNwkSIntKey = ptr.String(jtv) + } + + case "NwkSEncKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NwkSEncKey to be of type string, got %T instead", value) + } + sv.NwkSEncKey = ptr.String(jtv) + } + + case "SNwkSIntKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SNwkSIntKey to be of type string, got %T instead", value) + } + sv.SNwkSIntKey = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSidewalkAccountInfo(v **types.SidewalkAccountInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SidewalkAccountInfo + if *v == nil { + sv = &types.SidewalkAccountInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AmazonId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AmazonId to be of type string, got %T instead", value) + } + sv.AmazonId = ptr.String(jtv) + } + + case "AppServerPrivateKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AppServerPrivateKey to be of type string, got %T instead", value) + } + sv.AppServerPrivateKey = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSidewalkAccountInfoWithFingerprint(v **types.SidewalkAccountInfoWithFingerprint, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SidewalkAccountInfoWithFingerprint + if *v == nil { + sv = &types.SidewalkAccountInfoWithFingerprint{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AmazonId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AmazonId to be of type string, got %T instead", value) + } + sv.AmazonId = ptr.String(jtv) + } + + case "Fingerprint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Fingerprint to be of type string, got %T instead", value) + } + sv.Fingerprint = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSidewalkAccountList(v *[]types.SidewalkAccountInfoWithFingerprint, 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.SidewalkAccountInfoWithFingerprint + if *v == nil { + cv = []types.SidewalkAccountInfoWithFingerprint{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SidewalkAccountInfoWithFingerprint + destAddr := &col + if err := awsRestjson1_deserializeDocumentSidewalkAccountInfoWithFingerprint(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSidewalkListDevice(v **types.SidewalkListDevice, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SidewalkListDevice + if *v == nil { + sv = &types.SidewalkListDevice{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AmazonId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AmazonId to be of type string, got %T instead", value) + } + sv.AmazonId = 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_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 Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + 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 Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "ResourceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) + } + sv.ResourceName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUpdateWirelessGatewayTaskCreate(v **types.UpdateWirelessGatewayTaskCreate, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UpdateWirelessGatewayTaskCreate + if *v == nil { + sv = &types.UpdateWirelessGatewayTaskCreate{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LoRaWAN": + if err := awsRestjson1_deserializeDocumentLoRaWANUpdateGatewayTaskCreate(&sv.LoRaWAN, value); err != nil { + return err + } + + case "UpdateDataRole": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UpdateDataSource to be of type string, got %T instead", value) + } + sv.UpdateDataRole = ptr.String(jtv) + } + + case "UpdateDataSource": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UpdateDataSource to be of type string, got %T instead", value) + } + sv.UpdateDataSource = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentUpdateWirelessGatewayTaskEntry(v **types.UpdateWirelessGatewayTaskEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UpdateWirelessGatewayTaskEntry + if *v == nil { + sv = &types.UpdateWirelessGatewayTaskEntry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessGatewayTaskDefinitionId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "LoRaWAN": + if err := awsRestjson1_deserializeDocumentLoRaWANUpdateGatewayTaskEntry(&sv.LoRaWAN, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentWirelessDeviceStatistics(v **types.WirelessDeviceStatistics, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.WirelessDeviceStatistics + if *v == nil { + sv = &types.WirelessDeviceStatistics{} + } 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 WirelessDeviceArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "DestinationName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationName to be of type string, got %T instead", value) + } + sv.DestinationName = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessDeviceId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "LastUplinkReceivedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ISODateTimeString to be of type string, got %T instead", value) + } + sv.LastUplinkReceivedAt = ptr.String(jtv) + } + + case "LoRaWAN": + if err := awsRestjson1_deserializeDocumentLoRaWANListDevice(&sv.LoRaWAN, value); err != nil { + return err + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessDeviceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Sidewalk": + if err := awsRestjson1_deserializeDocumentSidewalkListDevice(&sv.Sidewalk, value); err != nil { + return err + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessDeviceType to be of type string, got %T instead", value) + } + sv.Type = types.WirelessDeviceType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentWirelessDeviceStatisticsList(v *[]types.WirelessDeviceStatistics, 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.WirelessDeviceStatistics + if *v == nil { + cv = []types.WirelessDeviceStatistics{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.WirelessDeviceStatistics + destAddr := &col + if err := awsRestjson1_deserializeDocumentWirelessDeviceStatistics(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentWirelessGatewayStatistics(v **types.WirelessGatewayStatistics, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.WirelessGatewayStatistics + if *v == nil { + sv = &types.WirelessGatewayStatistics{} + } 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 WirelessGatewayArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessGatewayId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "LastUplinkReceivedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ISODateTimeString to be of type string, got %T instead", value) + } + sv.LastUplinkReceivedAt = ptr.String(jtv) + } + + case "LoRaWAN": + if err := awsRestjson1_deserializeDocumentLoRaWANGateway(&sv.LoRaWAN, value); err != nil { + return err + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WirelessGatewayName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentWirelessGatewayStatisticsList(v *[]types.WirelessGatewayStatistics, 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.WirelessGatewayStatistics + if *v == nil { + cv = []types.WirelessGatewayStatistics{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.WirelessGatewayStatistics + destAddr := &col + if err := awsRestjson1_deserializeDocumentWirelessGatewayStatistics(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentWirelessGatewayTaskDefinitionList(v *[]types.UpdateWirelessGatewayTaskEntry, 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.UpdateWirelessGatewayTaskEntry + if *v == nil { + cv = []types.UpdateWirelessGatewayTaskEntry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.UpdateWirelessGatewayTaskEntry + destAddr := &col + if err := awsRestjson1_deserializeDocumentUpdateWirelessGatewayTaskEntry(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} diff --git a/service/iotwireless/doc.go b/service/iotwireless/doc.go new file mode 100644 index 00000000000..3f4cac55ee9 --- /dev/null +++ b/service/iotwireless/doc.go @@ -0,0 +1,7 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package iotwireless provides the API client, operations, and parameter types for +// AWS IoT Wireless. +// +// AWS IoT Wireless API documentation +package iotwireless diff --git a/service/iotwireless/endpoints.go b/service/iotwireless/endpoints.go new file mode 100644 index 00000000000..5b755e743c4 --- /dev/null +++ b/service/iotwireless/endpoints.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +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/iotwireless/internal/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/url" +) + +// 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() +} + +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") + } + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), m.Options) + 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 = "iotwireless" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + 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.EndpointResolver + 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) + 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) +} + +// 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. +// awsResolver and fallbackResolver must not be nil +func WithEndpointResolver(awsResolver aws.EndpointResolver, fallbackResolver EndpointResolver) EndpointResolver { + return &wrappedEndpointResolver{ + awsResolver: awsResolver, + resolver: fallbackResolver, + } +} diff --git a/service/iotwireless/go.mod b/service/iotwireless/go.mod new file mode 100644 index 00000000000..46f1b81eca4 --- /dev/null +++ b/service/iotwireless/go.mod @@ -0,0 +1,10 @@ +module github.com/aws/aws-sdk-go-v2/service/iotwireless + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v0.30.1-0.20201222223005-ee883de66531 + github.com/aws/smithy-go v0.4.1-0.20201222001052-74df8ddd8c79 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/iotwireless/go.sum b/service/iotwireless/go.sum new file mode 100644 index 00000000000..934e2b5c702 --- /dev/null +++ b/service/iotwireless/go.sum @@ -0,0 +1,14 @@ +github.com/aws/smithy-go v0.4.1-0.20201222001052-74df8ddd8c79 h1:Ufuk/0gkbBZVZ7jlujsyzn5ruWhdTFBcZDCVIy60tsQ= +github.com/aws/smithy-go v0.4.1-0.20201222001052-74df8ddd8c79/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/iotwireless/internal/endpoints/endpoints.go b/service/iotwireless/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..7964c6c850f --- /dev/null +++ b/service/iotwireless/internal/endpoints/endpoints.go @@ -0,0 +1,91 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + DisableHTTPS bool +} + +// Resolver IoT Wireless 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 := endpoints.Options{ + DisableHTTPS: options.DisableHTTPS, + } + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: endpoints.Endpoint{ + Hostname: "iotwireless.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-cn", + Defaults: endpoints.Endpoint{ + Hostname: "iotwireless.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: endpoints.Endpoint{ + Hostname: "iotwireless.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: endpoints.Endpoint{ + Hostname: "iotwireless.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: endpoints.Endpoint{ + Hostname: "iotwireless.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, +} diff --git a/service/iotwireless/internal/endpoints/endpoints_test.go b/service/iotwireless/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/iotwireless/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/iotwireless/protocol_test.go b/service/iotwireless/protocol_test.go new file mode 100644 index 00000000000..3b777376ed1 --- /dev/null +++ b/service/iotwireless/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless diff --git a/service/iotwireless/serializers.go b/service/iotwireless/serializers.go new file mode 100644 index 00000000000..0cd55403ebe --- /dev/null +++ b/service/iotwireless/serializers.go @@ -0,0 +1,4258 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/iotwireless/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_serializeOpAssociateAwsAccountWithPartnerAccount struct { +} + +func (*awsRestjson1_serializeOpAssociateAwsAccountWithPartnerAccount) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpAssociateAwsAccountWithPartnerAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AssociateAwsAccountWithPartnerAccountInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/partner-accounts") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpDocumentAssociateAwsAccountWithPartnerAccountInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsAssociateAwsAccountWithPartnerAccountInput(v *AssociateAwsAccountWithPartnerAccountInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentAssociateAwsAccountWithPartnerAccountInput(v *AssociateAwsAccountWithPartnerAccountInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.Sidewalk != nil { + ok := object.Key("Sidewalk") + if err := awsRestjson1_serializeDocumentSidewalkAccountInfo(v.Sidewalk, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpAssociateWirelessDeviceWithThing struct { +} + +func (*awsRestjson1_serializeOpAssociateWirelessDeviceWithThing) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpAssociateWirelessDeviceWithThing) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AssociateWirelessDeviceWithThingInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-devices/{Id}/thing") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + request.URL.RawQuery = opQuery + } + + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsAssociateWirelessDeviceWithThingInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentAssociateWirelessDeviceWithThingInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsAssociateWirelessDeviceWithThingInput(v *AssociateWirelessDeviceWithThingInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentAssociateWirelessDeviceWithThingInput(v *AssociateWirelessDeviceWithThingInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ThingArn != nil { + ok := object.Key("ThingArn") + ok.String(*v.ThingArn) + } + + return nil +} + +type awsRestjson1_serializeOpAssociateWirelessGatewayWithCertificate struct { +} + +func (*awsRestjson1_serializeOpAssociateWirelessGatewayWithCertificate) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpAssociateWirelessGatewayWithCertificate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AssociateWirelessGatewayWithCertificateInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-gateways/{Id}/certificate") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + request.URL.RawQuery = opQuery + } + + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsAssociateWirelessGatewayWithCertificateInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentAssociateWirelessGatewayWithCertificateInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsAssociateWirelessGatewayWithCertificateInput(v *AssociateWirelessGatewayWithCertificateInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentAssociateWirelessGatewayWithCertificateInput(v *AssociateWirelessGatewayWithCertificateInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IotCertificateId != nil { + ok := object.Key("IotCertificateId") + ok.String(*v.IotCertificateId) + } + + return nil +} + +type awsRestjson1_serializeOpAssociateWirelessGatewayWithThing struct { +} + +func (*awsRestjson1_serializeOpAssociateWirelessGatewayWithThing) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpAssociateWirelessGatewayWithThing) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AssociateWirelessGatewayWithThingInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-gateways/{Id}/thing") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + request.URL.RawQuery = opQuery + } + + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsAssociateWirelessGatewayWithThingInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentAssociateWirelessGatewayWithThingInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsAssociateWirelessGatewayWithThingInput(v *AssociateWirelessGatewayWithThingInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentAssociateWirelessGatewayWithThingInput(v *AssociateWirelessGatewayWithThingInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ThingArn != nil { + ok := object.Key("ThingArn") + ok.String(*v.ThingArn) + } + + return nil +} + +type awsRestjson1_serializeOpCreateDestination struct { +} + +func (*awsRestjson1_serializeOpCreateDestination) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDestinationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/destinations") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpDocumentCreateDestinationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateDestinationInput(v *CreateDestinationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateDestinationInput(v *CreateDestinationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.Expression != nil { + ok := object.Key("Expression") + ok.String(*v.Expression) + } + + if len(v.ExpressionType) > 0 { + ok := object.Key("ExpressionType") + ok.String(string(v.ExpressionType)) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.RoleArn != nil { + ok := object.Key("RoleArn") + ok.String(*v.RoleArn) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateDeviceProfile struct { +} + +func (*awsRestjson1_serializeOpCreateDeviceProfile) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateDeviceProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDeviceProfileInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/device-profiles") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpDocumentCreateDeviceProfileInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateDeviceProfileInput(v *CreateDeviceProfileInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateDeviceProfileInput(v *CreateDeviceProfileInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.LoRaWAN != nil { + ok := object.Key("LoRaWAN") + if err := awsRestjson1_serializeDocumentLoRaWANDeviceProfile(v.LoRaWAN, ok); err != nil { + return err + } + } + + 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 + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateServiceProfile struct { +} + +func (*awsRestjson1_serializeOpCreateServiceProfile) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateServiceProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateServiceProfileInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/service-profiles") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpDocumentCreateServiceProfileInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateServiceProfileInput(v *CreateServiceProfileInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateServiceProfileInput(v *CreateServiceProfileInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.LoRaWAN != nil { + ok := object.Key("LoRaWAN") + if err := awsRestjson1_serializeDocumentLoRaWANServiceProfile(v.LoRaWAN, ok); err != nil { + return err + } + } + + 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 + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateWirelessDevice struct { +} + +func (*awsRestjson1_serializeOpCreateWirelessDevice) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateWirelessDevice) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateWirelessDeviceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-devices") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpDocumentCreateWirelessDeviceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateWirelessDeviceInput(v *CreateWirelessDeviceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateWirelessDeviceInput(v *CreateWirelessDeviceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.DestinationName != nil { + ok := object.Key("DestinationName") + ok.String(*v.DestinationName) + } + + if v.LoRaWAN != nil { + ok := object.Key("LoRaWAN") + if err := awsRestjson1_serializeDocumentLoRaWANDevice(v.LoRaWAN, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if len(v.Type) > 0 { + ok := object.Key("Type") + ok.String(string(v.Type)) + } + + return nil +} + +type awsRestjson1_serializeOpCreateWirelessGateway struct { +} + +func (*awsRestjson1_serializeOpCreateWirelessGateway) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateWirelessGateway) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateWirelessGatewayInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-gateways") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpDocumentCreateWirelessGatewayInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateWirelessGatewayInput(v *CreateWirelessGatewayInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateWirelessGatewayInput(v *CreateWirelessGatewayInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.LoRaWAN != nil { + ok := object.Key("LoRaWAN") + if err := awsRestjson1_serializeDocumentLoRaWANGateway(v.LoRaWAN, ok); err != nil { + return err + } + } + + 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 + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateWirelessGatewayTask struct { +} + +func (*awsRestjson1_serializeOpCreateWirelessGatewayTask) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateWirelessGatewayTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateWirelessGatewayTaskInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-gateways/{Id}/tasks") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsCreateWirelessGatewayTaskInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateWirelessGatewayTaskInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateWirelessGatewayTaskInput(v *CreateWirelessGatewayTaskInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateWirelessGatewayTaskInput(v *CreateWirelessGatewayTaskInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.WirelessGatewayTaskDefinitionId != nil { + ok := object.Key("WirelessGatewayTaskDefinitionId") + ok.String(*v.WirelessGatewayTaskDefinitionId) + } + + return nil +} + +type awsRestjson1_serializeOpCreateWirelessGatewayTaskDefinition struct { +} + +func (*awsRestjson1_serializeOpCreateWirelessGatewayTaskDefinition) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateWirelessGatewayTaskDefinition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateWirelessGatewayTaskDefinitionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-gateway-task-definitions") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpDocumentCreateWirelessGatewayTaskDefinitionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateWirelessGatewayTaskDefinitionInput(v *CreateWirelessGatewayTaskDefinitionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateWirelessGatewayTaskDefinitionInput(v *CreateWirelessGatewayTaskDefinitionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AutoCreateTasks { + ok := object.Key("AutoCreateTasks") + ok.Boolean(v.AutoCreateTasks) + } + + 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.Update != nil { + ok := object.Key("Update") + if err := awsRestjson1_serializeDocumentUpdateWirelessGatewayTaskCreate(v.Update, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteDestination struct { +} + +func (*awsRestjson1_serializeOpDeleteDestination) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDestinationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/destinations/{Name}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteDestinationInput(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_serializeOpHttpBindingsDeleteDestinationInput(v *DeleteDestinationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteDeviceProfile struct { +} + +func (*awsRestjson1_serializeOpDeleteDeviceProfile) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteDeviceProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDeviceProfileInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/device-profiles/{Id}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteDeviceProfileInput(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_serializeOpHttpBindingsDeleteDeviceProfileInput(v *DeleteDeviceProfileInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteServiceProfile struct { +} + +func (*awsRestjson1_serializeOpDeleteServiceProfile) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteServiceProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteServiceProfileInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/service-profiles/{Id}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteServiceProfileInput(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_serializeOpHttpBindingsDeleteServiceProfileInput(v *DeleteServiceProfileInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteWirelessDevice struct { +} + +func (*awsRestjson1_serializeOpDeleteWirelessDevice) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteWirelessDevice) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteWirelessDeviceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-devices/{Id}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteWirelessDeviceInput(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_serializeOpHttpBindingsDeleteWirelessDeviceInput(v *DeleteWirelessDeviceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteWirelessGateway struct { +} + +func (*awsRestjson1_serializeOpDeleteWirelessGateway) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteWirelessGateway) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteWirelessGatewayInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-gateways/{Id}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteWirelessGatewayInput(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_serializeOpHttpBindingsDeleteWirelessGatewayInput(v *DeleteWirelessGatewayInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteWirelessGatewayTask struct { +} + +func (*awsRestjson1_serializeOpDeleteWirelessGatewayTask) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteWirelessGatewayTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteWirelessGatewayTaskInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-gateways/{Id}/tasks") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteWirelessGatewayTaskInput(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_serializeOpHttpBindingsDeleteWirelessGatewayTaskInput(v *DeleteWirelessGatewayTaskInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteWirelessGatewayTaskDefinition struct { +} + +func (*awsRestjson1_serializeOpDeleteWirelessGatewayTaskDefinition) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteWirelessGatewayTaskDefinition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteWirelessGatewayTaskDefinitionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-gateway-task-definitions/{Id}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteWirelessGatewayTaskDefinitionInput(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_serializeOpHttpBindingsDeleteWirelessGatewayTaskDefinitionInput(v *DeleteWirelessGatewayTaskDefinitionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDisassociateAwsAccountFromPartnerAccount struct { +} + +func (*awsRestjson1_serializeOpDisassociateAwsAccountFromPartnerAccount) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDisassociateAwsAccountFromPartnerAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DisassociateAwsAccountFromPartnerAccountInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/partner-accounts/{PartnerAccountId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDisassociateAwsAccountFromPartnerAccountInput(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_serializeOpHttpBindingsDisassociateAwsAccountFromPartnerAccountInput(v *DisassociateAwsAccountFromPartnerAccountInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.PartnerAccountId == nil || len(*v.PartnerAccountId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member PartnerAccountId must not be empty")} + } + if v.PartnerAccountId != nil { + if err := encoder.SetURI("PartnerAccountId").String(*v.PartnerAccountId); err != nil { + return err + } + } + + if len(v.PartnerType) > 0 { + encoder.SetQuery("partnerType").String(string(v.PartnerType)) + } + + return nil +} + +type awsRestjson1_serializeOpDisassociateWirelessDeviceFromThing struct { +} + +func (*awsRestjson1_serializeOpDisassociateWirelessDeviceFromThing) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDisassociateWirelessDeviceFromThing) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DisassociateWirelessDeviceFromThingInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-devices/{Id}/thing") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDisassociateWirelessDeviceFromThingInput(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_serializeOpHttpBindingsDisassociateWirelessDeviceFromThingInput(v *DisassociateWirelessDeviceFromThingInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDisassociateWirelessGatewayFromCertificate struct { +} + +func (*awsRestjson1_serializeOpDisassociateWirelessGatewayFromCertificate) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDisassociateWirelessGatewayFromCertificate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DisassociateWirelessGatewayFromCertificateInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-gateways/{Id}/certificate") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDisassociateWirelessGatewayFromCertificateInput(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_serializeOpHttpBindingsDisassociateWirelessGatewayFromCertificateInput(v *DisassociateWirelessGatewayFromCertificateInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDisassociateWirelessGatewayFromThing struct { +} + +func (*awsRestjson1_serializeOpDisassociateWirelessGatewayFromThing) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDisassociateWirelessGatewayFromThing) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DisassociateWirelessGatewayFromThingInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-gateways/{Id}/thing") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDisassociateWirelessGatewayFromThingInput(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_serializeOpHttpBindingsDisassociateWirelessGatewayFromThingInput(v *DisassociateWirelessGatewayFromThingInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetDestination struct { +} + +func (*awsRestjson1_serializeOpGetDestination) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetDestinationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/destinations/{Name}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetDestinationInput(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_serializeOpHttpBindingsGetDestinationInput(v *GetDestinationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetDeviceProfile struct { +} + +func (*awsRestjson1_serializeOpGetDeviceProfile) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetDeviceProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetDeviceProfileInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/device-profiles/{Id}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetDeviceProfileInput(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_serializeOpHttpBindingsGetDeviceProfileInput(v *GetDeviceProfileInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetPartnerAccount struct { +} + +func (*awsRestjson1_serializeOpGetPartnerAccount) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetPartnerAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetPartnerAccountInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/partner-accounts/{PartnerAccountId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetPartnerAccountInput(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_serializeOpHttpBindingsGetPartnerAccountInput(v *GetPartnerAccountInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.PartnerAccountId == nil || len(*v.PartnerAccountId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member PartnerAccountId must not be empty")} + } + if v.PartnerAccountId != nil { + if err := encoder.SetURI("PartnerAccountId").String(*v.PartnerAccountId); err != nil { + return err + } + } + + if len(v.PartnerType) > 0 { + encoder.SetQuery("partnerType").String(string(v.PartnerType)) + } + + return nil +} + +type awsRestjson1_serializeOpGetServiceEndpoint struct { +} + +func (*awsRestjson1_serializeOpGetServiceEndpoint) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetServiceEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetServiceEndpointInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/service-endpoint") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetServiceEndpointInput(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_serializeOpHttpBindingsGetServiceEndpointInput(v *GetServiceEndpointInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.ServiceType) > 0 { + encoder.SetQuery("serviceType").String(string(v.ServiceType)) + } + + return nil +} + +type awsRestjson1_serializeOpGetServiceProfile struct { +} + +func (*awsRestjson1_serializeOpGetServiceProfile) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetServiceProfile) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetServiceProfileInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/service-profiles/{Id}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetServiceProfileInput(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_serializeOpHttpBindingsGetServiceProfileInput(v *GetServiceProfileInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetWirelessDevice struct { +} + +func (*awsRestjson1_serializeOpGetWirelessDevice) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetWirelessDevice) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetWirelessDeviceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-devices/{Identifier}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetWirelessDeviceInput(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_serializeOpHttpBindingsGetWirelessDeviceInput(v *GetWirelessDeviceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Identifier == nil || len(*v.Identifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Identifier must not be empty")} + } + if v.Identifier != nil { + if err := encoder.SetURI("Identifier").String(*v.Identifier); err != nil { + return err + } + } + + if len(v.IdentifierType) > 0 { + encoder.SetQuery("identifierType").String(string(v.IdentifierType)) + } + + return nil +} + +type awsRestjson1_serializeOpGetWirelessDeviceStatistics struct { +} + +func (*awsRestjson1_serializeOpGetWirelessDeviceStatistics) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetWirelessDeviceStatistics) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetWirelessDeviceStatisticsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-devices/{WirelessDeviceId}/statistics") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetWirelessDeviceStatisticsInput(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_serializeOpHttpBindingsGetWirelessDeviceStatisticsInput(v *GetWirelessDeviceStatisticsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.WirelessDeviceId == nil || len(*v.WirelessDeviceId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WirelessDeviceId must not be empty")} + } + if v.WirelessDeviceId != nil { + if err := encoder.SetURI("WirelessDeviceId").String(*v.WirelessDeviceId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetWirelessGateway struct { +} + +func (*awsRestjson1_serializeOpGetWirelessGateway) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetWirelessGateway) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetWirelessGatewayInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-gateways/{Identifier}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetWirelessGatewayInput(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_serializeOpHttpBindingsGetWirelessGatewayInput(v *GetWirelessGatewayInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Identifier == nil || len(*v.Identifier) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Identifier must not be empty")} + } + if v.Identifier != nil { + if err := encoder.SetURI("Identifier").String(*v.Identifier); err != nil { + return err + } + } + + if len(v.IdentifierType) > 0 { + encoder.SetQuery("identifierType").String(string(v.IdentifierType)) + } + + return nil +} + +type awsRestjson1_serializeOpGetWirelessGatewayCertificate struct { +} + +func (*awsRestjson1_serializeOpGetWirelessGatewayCertificate) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetWirelessGatewayCertificate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetWirelessGatewayCertificateInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-gateways/{Id}/certificate") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetWirelessGatewayCertificateInput(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_serializeOpHttpBindingsGetWirelessGatewayCertificateInput(v *GetWirelessGatewayCertificateInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetWirelessGatewayFirmwareInformation struct { +} + +func (*awsRestjson1_serializeOpGetWirelessGatewayFirmwareInformation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetWirelessGatewayFirmwareInformation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetWirelessGatewayFirmwareInformationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-gateways/{Id}/firmware-information") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetWirelessGatewayFirmwareInformationInput(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_serializeOpHttpBindingsGetWirelessGatewayFirmwareInformationInput(v *GetWirelessGatewayFirmwareInformationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetWirelessGatewayStatistics struct { +} + +func (*awsRestjson1_serializeOpGetWirelessGatewayStatistics) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetWirelessGatewayStatistics) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetWirelessGatewayStatisticsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-gateways/{WirelessGatewayId}/statistics") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetWirelessGatewayStatisticsInput(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_serializeOpHttpBindingsGetWirelessGatewayStatisticsInput(v *GetWirelessGatewayStatisticsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.WirelessGatewayId == nil || len(*v.WirelessGatewayId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WirelessGatewayId must not be empty")} + } + if v.WirelessGatewayId != nil { + if err := encoder.SetURI("WirelessGatewayId").String(*v.WirelessGatewayId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetWirelessGatewayTask struct { +} + +func (*awsRestjson1_serializeOpGetWirelessGatewayTask) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetWirelessGatewayTask) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetWirelessGatewayTaskInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-gateways/{Id}/tasks") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetWirelessGatewayTaskInput(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_serializeOpHttpBindingsGetWirelessGatewayTaskInput(v *GetWirelessGatewayTaskInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetWirelessGatewayTaskDefinition struct { +} + +func (*awsRestjson1_serializeOpGetWirelessGatewayTaskDefinition) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetWirelessGatewayTaskDefinition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetWirelessGatewayTaskDefinitionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-gateway-task-definitions/{Id}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetWirelessGatewayTaskDefinitionInput(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_serializeOpHttpBindingsGetWirelessGatewayTaskDefinitionInput(v *GetWirelessGatewayTaskDefinitionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListDestinations struct { +} + +func (*awsRestjson1_serializeOpListDestinations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListDestinations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListDestinationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/destinations") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListDestinationsInput(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_serializeOpHttpBindingsListDestinationsInput(v *ListDestinationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListDeviceProfiles struct { +} + +func (*awsRestjson1_serializeOpListDeviceProfiles) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListDeviceProfiles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListDeviceProfilesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/device-profiles") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListDeviceProfilesInput(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_serializeOpHttpBindingsListDeviceProfilesInput(v *ListDeviceProfilesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListPartnerAccounts struct { +} + +func (*awsRestjson1_serializeOpListPartnerAccounts) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListPartnerAccounts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListPartnerAccountsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/partner-accounts") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListPartnerAccountsInput(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_serializeOpHttpBindingsListPartnerAccountsInput(v *ListPartnerAccountsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListServiceProfiles struct { +} + +func (*awsRestjson1_serializeOpListServiceProfiles) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListServiceProfiles) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListServiceProfilesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/service-profiles") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListServiceProfilesInput(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_serializeOpHttpBindingsListServiceProfilesInput(v *ListServiceProfilesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListTagsForResource struct { +} + +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpListWirelessDevices struct { +} + +func (*awsRestjson1_serializeOpListWirelessDevices) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListWirelessDevices) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListWirelessDevicesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-devices") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListWirelessDevicesInput(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_serializeOpHttpBindingsListWirelessDevicesInput(v *ListWirelessDevicesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DestinationName != nil { + encoder.SetQuery("destinationName").String(*v.DestinationName) + } + + if v.DeviceProfileId != nil { + encoder.SetQuery("deviceProfileId").String(*v.DeviceProfileId) + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.ServiceProfileId != nil { + encoder.SetQuery("serviceProfileId").String(*v.ServiceProfileId) + } + + if len(v.WirelessDeviceType) > 0 { + encoder.SetQuery("wirelessDeviceType").String(string(v.WirelessDeviceType)) + } + + return nil +} + +type awsRestjson1_serializeOpListWirelessGateways struct { +} + +func (*awsRestjson1_serializeOpListWirelessGateways) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListWirelessGateways) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListWirelessGatewaysInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-gateways") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListWirelessGatewaysInput(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_serializeOpHttpBindingsListWirelessGatewaysInput(v *ListWirelessGatewaysInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListWirelessGatewayTaskDefinitions struct { +} + +func (*awsRestjson1_serializeOpListWirelessGatewayTaskDefinitions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListWirelessGatewayTaskDefinitions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListWirelessGatewayTaskDefinitionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-gateway-task-definitions") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListWirelessGatewayTaskDefinitionsInput(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_serializeOpHttpBindingsListWirelessGatewayTaskDefinitionsInput(v *ListWirelessGatewayTaskDefinitionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != 0 { + encoder.SetQuery("maxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if len(v.TaskDefinitionType) > 0 { + encoder.SetQuery("taskDefinitionType").String(string(v.TaskDefinitionType)) + } + + return nil +} + +type awsRestjson1_serializeOpSendDataToWirelessDevice struct { +} + +func (*awsRestjson1_serializeOpSendDataToWirelessDevice) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpSendDataToWirelessDevice) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SendDataToWirelessDeviceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-devices/{Id}/data") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsSendDataToWirelessDeviceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentSendDataToWirelessDeviceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsSendDataToWirelessDeviceInput(v *SendDataToWirelessDeviceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentSendDataToWirelessDeviceInput(v *SendDataToWirelessDeviceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PayloadData != nil { + ok := object.Key("PayloadData") + ok.String(*v.PayloadData) + } + + if v.TransmitMode != nil { + ok := object.Key("TransmitMode") + ok.Integer(*v.TransmitMode) + } + + if v.WirelessMetadata != nil { + ok := object.Key("WirelessMetadata") + if err := awsRestjson1_serializeDocumentWirelessMetadata(v.WirelessMetadata, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpTagResource struct { +} + +func (*awsRestjson1_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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 { + encoder.SetQuery("resourceArn").String(*v.ResourceArn) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpTestWirelessDevice struct { +} + +func (*awsRestjson1_serializeOpTestWirelessDevice) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpTestWirelessDevice) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TestWirelessDeviceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-devices/{Id}/test") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsTestWirelessDeviceInput(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_serializeOpHttpBindingsTestWirelessDeviceInput(v *TestWirelessDeviceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); 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") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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 { + encoder.SetQuery("resourceArn").String(*v.ResourceArn) + } + + if v.TagKeys != nil { + for i := range v.TagKeys { + encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateDestination struct { +} + +func (*awsRestjson1_serializeOpUpdateDestination) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateDestinationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/destinations/{Name}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsUpdateDestinationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateDestinationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateDestinationInput(v *UpdateDestinationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateDestinationInput(v *UpdateDestinationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.Expression != nil { + ok := object.Key("Expression") + ok.String(*v.Expression) + } + + if len(v.ExpressionType) > 0 { + ok := object.Key("ExpressionType") + ok.String(string(v.ExpressionType)) + } + + if v.RoleArn != nil { + ok := object.Key("RoleArn") + ok.String(*v.RoleArn) + } + + return nil +} + +type awsRestjson1_serializeOpUpdatePartnerAccount struct { +} + +func (*awsRestjson1_serializeOpUpdatePartnerAccount) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdatePartnerAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdatePartnerAccountInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/partner-accounts/{PartnerAccountId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsUpdatePartnerAccountInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdatePartnerAccountInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdatePartnerAccountInput(v *UpdatePartnerAccountInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.PartnerAccountId == nil || len(*v.PartnerAccountId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member PartnerAccountId must not be empty")} + } + if v.PartnerAccountId != nil { + if err := encoder.SetURI("PartnerAccountId").String(*v.PartnerAccountId); err != nil { + return err + } + } + + if len(v.PartnerType) > 0 { + encoder.SetQuery("partnerType").String(string(v.PartnerType)) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdatePartnerAccountInput(v *UpdatePartnerAccountInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Sidewalk != nil { + ok := object.Key("Sidewalk") + if err := awsRestjson1_serializeDocumentSidewalkUpdateAccount(v.Sidewalk, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateWirelessDevice struct { +} + +func (*awsRestjson1_serializeOpUpdateWirelessDevice) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateWirelessDevice) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateWirelessDeviceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-devices/{Id}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsUpdateWirelessDeviceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateWirelessDeviceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateWirelessDeviceInput(v *UpdateWirelessDeviceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateWirelessDeviceInput(v *UpdateWirelessDeviceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.DestinationName != nil { + ok := object.Key("DestinationName") + ok.String(*v.DestinationName) + } + + if v.LoRaWAN != nil { + ok := object.Key("LoRaWAN") + if err := awsRestjson1_serializeDocumentLoRaWANUpdateDevice(v.LoRaWAN, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateWirelessGateway struct { +} + +func (*awsRestjson1_serializeOpUpdateWirelessGateway) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateWirelessGateway) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateWirelessGatewayInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/wireless-gateways/{Id}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsUpdateWirelessGatewayInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateWirelessGatewayInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateWirelessGatewayInput(v *UpdateWirelessGatewayInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateWirelessGatewayInput(v *UpdateWirelessGatewayInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + return nil +} + +func awsRestjson1_serializeDocumentAbpV1_0_x(v *types.AbpV1_0_x, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DevAddr != nil { + ok := object.Key("DevAddr") + ok.String(*v.DevAddr) + } + + if v.SessionKeys != nil { + ok := object.Key("SessionKeys") + if err := awsRestjson1_serializeDocumentSessionKeysAbpV1_0_x(v.SessionKeys, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentAbpV1_1(v *types.AbpV1_1, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DevAddr != nil { + ok := object.Key("DevAddr") + ok.String(*v.DevAddr) + } + + if v.SessionKeys != nil { + ok := object.Key("SessionKeys") + if err := awsRestjson1_serializeDocumentSessionKeysAbpV1_1(v.SessionKeys, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentFactoryPresetFreqsList(v []int32, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.Integer(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentLoRaWANDevice(v *types.LoRaWANDevice, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AbpV1_0_x != nil { + ok := object.Key("AbpV1_0_x") + if err := awsRestjson1_serializeDocumentAbpV1_0_x(v.AbpV1_0_x, ok); err != nil { + return err + } + } + + if v.AbpV1_1 != nil { + ok := object.Key("AbpV1_1") + if err := awsRestjson1_serializeDocumentAbpV1_1(v.AbpV1_1, ok); err != nil { + return err + } + } + + if v.DevEui != nil { + ok := object.Key("DevEui") + ok.String(*v.DevEui) + } + + if v.DeviceProfileId != nil { + ok := object.Key("DeviceProfileId") + ok.String(*v.DeviceProfileId) + } + + if v.OtaaV1_0_x != nil { + ok := object.Key("OtaaV1_0_x") + if err := awsRestjson1_serializeDocumentOtaaV1_0_x(v.OtaaV1_0_x, ok); err != nil { + return err + } + } + + if v.OtaaV1_1 != nil { + ok := object.Key("OtaaV1_1") + if err := awsRestjson1_serializeDocumentOtaaV1_1(v.OtaaV1_1, ok); err != nil { + return err + } + } + + if v.ServiceProfileId != nil { + ok := object.Key("ServiceProfileId") + ok.String(*v.ServiceProfileId) + } + + return nil +} + +func awsRestjson1_serializeDocumentLoRaWANDeviceProfile(v *types.LoRaWANDeviceProfile, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClassBTimeout != nil { + ok := object.Key("ClassBTimeout") + ok.Integer(*v.ClassBTimeout) + } + + if v.ClassCTimeout != nil { + ok := object.Key("ClassCTimeout") + ok.Integer(*v.ClassCTimeout) + } + + if v.FactoryPresetFreqsList != nil { + ok := object.Key("FactoryPresetFreqsList") + if err := awsRestjson1_serializeDocumentFactoryPresetFreqsList(v.FactoryPresetFreqsList, ok); err != nil { + return err + } + } + + if v.MacVersion != nil { + ok := object.Key("MacVersion") + ok.String(*v.MacVersion) + } + + if v.MaxDutyCycle != nil { + ok := object.Key("MaxDutyCycle") + ok.Integer(*v.MaxDutyCycle) + } + + if v.MaxEirp != nil { + ok := object.Key("MaxEirp") + ok.Integer(*v.MaxEirp) + } + + if v.PingSlotDr != nil { + ok := object.Key("PingSlotDr") + ok.Integer(*v.PingSlotDr) + } + + if v.PingSlotFreq != nil { + ok := object.Key("PingSlotFreq") + ok.Integer(*v.PingSlotFreq) + } + + if v.PingSlotPeriod != nil { + ok := object.Key("PingSlotPeriod") + ok.Integer(*v.PingSlotPeriod) + } + + if v.RegParamsRevision != nil { + ok := object.Key("RegParamsRevision") + ok.String(*v.RegParamsRevision) + } + + if v.RfRegion != nil { + ok := object.Key("RfRegion") + ok.String(*v.RfRegion) + } + + if v.RxDataRate2 != nil { + ok := object.Key("RxDataRate2") + ok.Integer(*v.RxDataRate2) + } + + if v.RxDelay1 != nil { + ok := object.Key("RxDelay1") + ok.Integer(*v.RxDelay1) + } + + if v.RxDrOffset1 != nil { + ok := object.Key("RxDrOffset1") + ok.Integer(*v.RxDrOffset1) + } + + if v.RxFreq2 != nil { + ok := object.Key("RxFreq2") + ok.Integer(*v.RxFreq2) + } + + if v.Supports32BitFCnt { + ok := object.Key("Supports32BitFCnt") + ok.Boolean(v.Supports32BitFCnt) + } + + if v.SupportsClassB { + ok := object.Key("SupportsClassB") + ok.Boolean(v.SupportsClassB) + } + + if v.SupportsClassC { + ok := object.Key("SupportsClassC") + ok.Boolean(v.SupportsClassC) + } + + if v.SupportsJoin != nil { + ok := object.Key("SupportsJoin") + ok.Boolean(*v.SupportsJoin) + } + + return nil +} + +func awsRestjson1_serializeDocumentLoRaWANGateway(v *types.LoRaWANGateway, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.GatewayEui != nil { + ok := object.Key("GatewayEui") + ok.String(*v.GatewayEui) + } + + if v.RfRegion != nil { + ok := object.Key("RfRegion") + ok.String(*v.RfRegion) + } + + return nil +} + +func awsRestjson1_serializeDocumentLoRaWANGatewayVersion(v *types.LoRaWANGatewayVersion, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Model != nil { + ok := object.Key("Model") + ok.String(*v.Model) + } + + if v.PackageVersion != nil { + ok := object.Key("PackageVersion") + ok.String(*v.PackageVersion) + } + + if v.Station != nil { + ok := object.Key("Station") + ok.String(*v.Station) + } + + return nil +} + +func awsRestjson1_serializeDocumentLoRaWANSendDataToDevice(v *types.LoRaWANSendDataToDevice, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FPort != nil { + ok := object.Key("FPort") + ok.Integer(*v.FPort) + } + + return nil +} + +func awsRestjson1_serializeDocumentLoRaWANServiceProfile(v *types.LoRaWANServiceProfile, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AddGwMetadata { + ok := object.Key("AddGwMetadata") + ok.Boolean(v.AddGwMetadata) + } + + return nil +} + +func awsRestjson1_serializeDocumentLoRaWANUpdateDevice(v *types.LoRaWANUpdateDevice, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DeviceProfileId != nil { + ok := object.Key("DeviceProfileId") + ok.String(*v.DeviceProfileId) + } + + if v.ServiceProfileId != nil { + ok := object.Key("ServiceProfileId") + ok.String(*v.ServiceProfileId) + } + + return nil +} + +func awsRestjson1_serializeDocumentLoRaWANUpdateGatewayTaskCreate(v *types.LoRaWANUpdateGatewayTaskCreate, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CurrentVersion != nil { + ok := object.Key("CurrentVersion") + if err := awsRestjson1_serializeDocumentLoRaWANGatewayVersion(v.CurrentVersion, ok); err != nil { + return err + } + } + + if v.SigKeyCrc != nil { + ok := object.Key("SigKeyCrc") + ok.Long(*v.SigKeyCrc) + } + + if v.UpdateSignature != nil { + ok := object.Key("UpdateSignature") + ok.String(*v.UpdateSignature) + } + + if v.UpdateVersion != nil { + ok := object.Key("UpdateVersion") + if err := awsRestjson1_serializeDocumentLoRaWANGatewayVersion(v.UpdateVersion, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentOtaaV1_0_x(v *types.OtaaV1_0_x, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AppEui != nil { + ok := object.Key("AppEui") + ok.String(*v.AppEui) + } + + if v.AppKey != nil { + ok := object.Key("AppKey") + ok.String(*v.AppKey) + } + + return nil +} + +func awsRestjson1_serializeDocumentOtaaV1_1(v *types.OtaaV1_1, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AppKey != nil { + ok := object.Key("AppKey") + ok.String(*v.AppKey) + } + + if v.JoinEui != nil { + ok := object.Key("JoinEui") + ok.String(*v.JoinEui) + } + + if v.NwkKey != nil { + ok := object.Key("NwkKey") + ok.String(*v.NwkKey) + } + + return nil +} + +func awsRestjson1_serializeDocumentSessionKeysAbpV1_0_x(v *types.SessionKeysAbpV1_0_x, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AppSKey != nil { + ok := object.Key("AppSKey") + ok.String(*v.AppSKey) + } + + if v.NwkSKey != nil { + ok := object.Key("NwkSKey") + ok.String(*v.NwkSKey) + } + + return nil +} + +func awsRestjson1_serializeDocumentSessionKeysAbpV1_1(v *types.SessionKeysAbpV1_1, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AppSKey != nil { + ok := object.Key("AppSKey") + ok.String(*v.AppSKey) + } + + if v.FNwkSIntKey != nil { + ok := object.Key("FNwkSIntKey") + ok.String(*v.FNwkSIntKey) + } + + if v.NwkSEncKey != nil { + ok := object.Key("NwkSEncKey") + ok.String(*v.NwkSEncKey) + } + + if v.SNwkSIntKey != nil { + ok := object.Key("SNwkSIntKey") + ok.String(*v.SNwkSIntKey) + } + + return nil +} + +func awsRestjson1_serializeDocumentSidewalkAccountInfo(v *types.SidewalkAccountInfo, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AmazonId != nil { + ok := object.Key("AmazonId") + ok.String(*v.AmazonId) + } + + if v.AppServerPrivateKey != nil { + ok := object.Key("AppServerPrivateKey") + ok.String(*v.AppServerPrivateKey) + } + + return nil +} + +func awsRestjson1_serializeDocumentSidewalkSendDataToDevice(v *types.SidewalkSendDataToDevice, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Seq != nil { + ok := object.Key("Seq") + ok.Integer(*v.Seq) + } + + return nil +} + +func awsRestjson1_serializeDocumentSidewalkUpdateAccount(v *types.SidewalkUpdateAccount, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AppServerPrivateKey != nil { + ok := object.Key("AppServerPrivateKey") + ok.String(*v.AppServerPrivateKey) + } + + return nil +} + +func awsRestjson1_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("Key") + ok.String(*v.Key) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsRestjson1_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentTag(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentUpdateWirelessGatewayTaskCreate(v *types.UpdateWirelessGatewayTaskCreate, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LoRaWAN != nil { + ok := object.Key("LoRaWAN") + if err := awsRestjson1_serializeDocumentLoRaWANUpdateGatewayTaskCreate(v.LoRaWAN, ok); err != nil { + return err + } + } + + if v.UpdateDataRole != nil { + ok := object.Key("UpdateDataRole") + ok.String(*v.UpdateDataRole) + } + + if v.UpdateDataSource != nil { + ok := object.Key("UpdateDataSource") + ok.String(*v.UpdateDataSource) + } + + return nil +} + +func awsRestjson1_serializeDocumentWirelessMetadata(v *types.WirelessMetadata, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LoRaWAN != nil { + ok := object.Key("LoRaWAN") + if err := awsRestjson1_serializeDocumentLoRaWANSendDataToDevice(v.LoRaWAN, ok); err != nil { + return err + } + } + + if v.Sidewalk != nil { + ok := object.Key("Sidewalk") + if err := awsRestjson1_serializeDocumentSidewalkSendDataToDevice(v.Sidewalk, ok); err != nil { + return err + } + } + + return nil +} diff --git a/service/iotwireless/types/enums.go b/service/iotwireless/types/enums.go new file mode 100644 index 00000000000..91f0f635c77 --- /dev/null +++ b/service/iotwireless/types/enums.go @@ -0,0 +1,154 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type ExpressionType string + +// Enum values for ExpressionType +const ( + ExpressionTypeRulename ExpressionType = "RuleName" +) + +// Values returns all known values for ExpressionType. 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 (ExpressionType) Values() []ExpressionType { + return []ExpressionType{ + "RuleName", + } +} + +type PartnerType string + +// Enum values for PartnerType +const ( + PartnerTypeSidewalk PartnerType = "Sidewalk" +) + +// Values returns all known values for PartnerType. 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 (PartnerType) Values() []PartnerType { + return []PartnerType{ + "Sidewalk", + } +} + +type WirelessDeviceIdType string + +// Enum values for WirelessDeviceIdType +const ( + WirelessDeviceIdTypeWirelessdeviceid WirelessDeviceIdType = "WirelessDeviceId" + WirelessDeviceIdTypeDeveui WirelessDeviceIdType = "DevEui" + WirelessDeviceIdTypeThingname WirelessDeviceIdType = "ThingName" +) + +// Values returns all known values for WirelessDeviceIdType. 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 (WirelessDeviceIdType) Values() []WirelessDeviceIdType { + return []WirelessDeviceIdType{ + "WirelessDeviceId", + "DevEui", + "ThingName", + } +} + +type WirelessDeviceType string + +// Enum values for WirelessDeviceType +const ( + WirelessDeviceTypeSidewalk WirelessDeviceType = "Sidewalk" + WirelessDeviceTypeLorawan WirelessDeviceType = "LoRaWAN" +) + +// Values returns all known values for WirelessDeviceType. 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 (WirelessDeviceType) Values() []WirelessDeviceType { + return []WirelessDeviceType{ + "Sidewalk", + "LoRaWAN", + } +} + +type WirelessGatewayIdType string + +// Enum values for WirelessGatewayIdType +const ( + WirelessGatewayIdTypeGatewayeui WirelessGatewayIdType = "GatewayEui" + WirelessGatewayIdTypeWirelessgatewayid WirelessGatewayIdType = "WirelessGatewayId" + WirelessGatewayIdTypeThingname WirelessGatewayIdType = "ThingName" +) + +// Values returns all known values for WirelessGatewayIdType. 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 (WirelessGatewayIdType) Values() []WirelessGatewayIdType { + return []WirelessGatewayIdType{ + "GatewayEui", + "WirelessGatewayId", + "ThingName", + } +} + +type WirelessGatewayServiceType string + +// Enum values for WirelessGatewayServiceType +const ( + WirelessGatewayServiceTypeCups WirelessGatewayServiceType = "CUPS" + WirelessGatewayServiceTypeLns WirelessGatewayServiceType = "LNS" +) + +// Values returns all known values for WirelessGatewayServiceType. 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 (WirelessGatewayServiceType) Values() []WirelessGatewayServiceType { + return []WirelessGatewayServiceType{ + "CUPS", + "LNS", + } +} + +type WirelessGatewayTaskDefinitionType string + +// Enum values for WirelessGatewayTaskDefinitionType +const ( + WirelessGatewayTaskDefinitionTypeUpdate WirelessGatewayTaskDefinitionType = "UPDATE" +) + +// Values returns all known values for WirelessGatewayTaskDefinitionType. 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 (WirelessGatewayTaskDefinitionType) Values() []WirelessGatewayTaskDefinitionType { + return []WirelessGatewayTaskDefinitionType{ + "UPDATE", + } +} + +type WirelessGatewayTaskStatus string + +// Enum values for WirelessGatewayTaskStatus +const ( + WirelessGatewayTaskStatusPending WirelessGatewayTaskStatus = "PENDING" + WirelessGatewayTaskStatusInProgress WirelessGatewayTaskStatus = "IN_PROGRESS" + WirelessGatewayTaskStatusFirstRetry WirelessGatewayTaskStatus = "FIRST_RETRY" + WirelessGatewayTaskStatusSecondRetry WirelessGatewayTaskStatus = "SECOND_RETRY" + WirelessGatewayTaskStatusCompleted WirelessGatewayTaskStatus = "COMPLETED" + WirelessGatewayTaskStatusFailed WirelessGatewayTaskStatus = "FAILED" +) + +// Values returns all known values for WirelessGatewayTaskStatus. 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 (WirelessGatewayTaskStatus) Values() []WirelessGatewayTaskStatus { + return []WirelessGatewayTaskStatus{ + "PENDING", + "IN_PROGRESS", + "FIRST_RETRY", + "SECOND_RETRY", + "COMPLETED", + "FAILED", + } +} diff --git a/service/iotwireless/types/errors.go b/service/iotwireless/types/errors.go new file mode 100644 index 00000000000..806e1757ff5 --- /dev/null +++ b/service/iotwireless/types/errors.go @@ -0,0 +1,135 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// User does not have permission to perform this action. +type AccessDeniedException struct { + Message *string +} + +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 { return "AccessDeniedException" } +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Adding, updating, or deleting the resource can cause an inconsistent state. +type ConflictException struct { + Message *string + + ResourceId *string + ResourceType *string +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { return "ConflictException" } +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// An unexpected error occurred while processing a request. +type InternalServerException struct { + Message *string +} + +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 { return "InternalServerException" } +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// Resource does not exist. +type ResourceNotFoundException struct { + Message *string + + ResourceId *string + ResourceType *string +} + +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 { return "ResourceNotFoundException" } +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was denied because it exceeded the allowed API request rate. +type ThrottlingException struct { + Message *string +} + +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 { return "ThrottlingException" } +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was denied because the resource can't have any more tags. +type TooManyTagsException struct { + Message *string + + ResourceName *string +} + +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 { return "TooManyTagsException" } +func (e *TooManyTagsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The input did not meet the specified constraints. +type ValidationException struct { + Message *string +} + +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 { return "ValidationException" } +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/iotwireless/types/types.go b/service/iotwireless/types/types.go new file mode 100644 index 00000000000..59903821b53 --- /dev/null +++ b/service/iotwireless/types/types.go @@ -0,0 +1,528 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +// ABP device object for LoRaWAN specification v1.0.x +type AbpV1_0_x struct { + + // The DevAddr value. + DevAddr *string + + // Session keys for ABP v1.0.x + SessionKeys *SessionKeysAbpV1_0_x +} + +// ABP device object for LoRaWAN specification v1.1 +type AbpV1_1 struct { + + // The DevAddr value. + DevAddr *string + + // Session keys for ABP v1.1 + SessionKeys *SessionKeysAbpV1_1 +} + +// Describes a destination. +type Destinations struct { + + // The Amazon Resource Name of the resource. + Arn *string + + // The description of the resource. + Description *string + + // The rule name or topic rule to send messages to. + Expression *string + + // The type of value in Expression. + ExpressionType ExpressionType + + // The name of the resource. + Name *string + + // The ARN of the IAM Role that authorizes the destination. + RoleArn *string +} + +// Describes a device profile. +type DeviceProfile struct { + + // The Amazon Resource Name of the resource. + Arn *string + + // The ID of the device profile. + Id *string + + // The name of the resource. + Name *string +} + +// LoRaWAN object for create functions. +type LoRaWANDevice struct { + + // LoRaWAN object for create APIs + AbpV1_0_x *AbpV1_0_x + + // ABP device object for create APIs for v1.1 + AbpV1_1 *AbpV1_1 + + // The DevEUI value. + DevEui *string + + // The ID of the device profile for the new wireless device. + DeviceProfileId *string + + // OTAA device object for create APIs for v1.0.x + OtaaV1_0_x *OtaaV1_0_x + + // OTAA device object for v1.1 for create APIs + OtaaV1_1 *OtaaV1_1 + + // The ID of the service profile. + ServiceProfileId *string +} + +// LoRaWAN device metatdata. +type LoRaWANDeviceMetadata struct { + + // The DataRate value. + DataRate *int32 + + // The DevEUI value. + DevEui *string + + // The FPort value. + FPort *int32 + + // The device's channel frequency in Hz. + Frequency *int32 + + // Information about the gateways accessed by the device. + Gateways []LoRaWANGatewayMetadata + + // The date and time of the metadata. + Timestamp *string +} + +// LoRaWANDeviceProfile object. +type LoRaWANDeviceProfile struct { + + // The ClassBTimeout value. + ClassBTimeout *int32 + + // The ClassCTimeout value. + ClassCTimeout *int32 + + // The list of values that make up the FactoryPresetFreqs value. + FactoryPresetFreqsList []int32 + + // The MAC version (such as OTAA 1.1 or OTAA 1.0.3) to use with this device + // profile. + MacVersion *string + + // The MaxDutyCycle value. + MaxDutyCycle *int32 + + // The MaxEIRP value. + MaxEirp *int32 + + // The PingSlotDR value. + PingSlotDr *int32 + + // The PingSlotFreq value. + PingSlotFreq *int32 + + // The PingSlotPeriod value. + PingSlotPeriod *int32 + + // The version of regional parameters. + RegParamsRevision *string + + // The frequency band (RFRegion) value. + RfRegion *string + + // The RXDataRate2 value. + RxDataRate2 *int32 + + // The RXDelay1 value. + RxDelay1 *int32 + + // The RXDROffset1 value. + RxDrOffset1 *int32 + + // The RXFreq2 value. + RxFreq2 *int32 + + // The Supports32BitFCnt value. + Supports32BitFCnt bool + + // The SupportsClassB value. + SupportsClassB bool + + // The SupportsClassC value. + SupportsClassC bool + + // The SupportsJoin value. + SupportsJoin *bool +} + +// LoRaWANGateway object. +type LoRaWANGateway struct { + + // The gateway's EUI value. + GatewayEui *string + + // The frequency band (RFRegion) value. + RfRegion *string +} + +// LoRaWANGatewayCurrentVersion object. +type LoRaWANGatewayCurrentVersion struct { + + // The version of the gateways that should receive the update. + CurrentVersion *LoRaWANGatewayVersion +} + +// LoRaWAN gateway metatdata. +type LoRaWANGatewayMetadata struct { + + // The gateway's EUI value. + GatewayEui *string + + // The RSSI value. + Rssi *float64 + + // The SNR value. + Snr *float64 +} + +// LoRaWANGatewayVersion object. +type LoRaWANGatewayVersion struct { + + // The model number of the wireless gateway. + Model *string + + // The version of the wireless gateway firmware. + PackageVersion *string + + // The basic station version of the wireless gateway. + Station *string +} + +// LoRaWANGetServiceProfileInfo object. +type LoRaWANGetServiceProfileInfo struct { + + // The AddGWMetaData value. + AddGwMetadata bool + + // The ChannelMask value. + ChannelMask *string + + // The DevStatusReqFreq value. + DevStatusReqFreq *int32 + + // The DLBucketSize value. + DlBucketSize *int32 + + // The DLRate value. + DlRate *int32 + + // The DLRatePolicy value. + DlRatePolicy *string + + // The DRMax value. + DrMax int32 + + // The DRMin value. + DrMin int32 + + // The HRAllowed value that describes whether handover roaming is allowed. + HrAllowed bool + + // The MinGwDiversity value. + MinGwDiversity *int32 + + // The NwkGeoLoc value. + NwkGeoLoc bool + + // The PRAllowed value that describes whether passive roaming is allowed. + PrAllowed bool + + // The RAAllowed value that describes whether roaming activation is allowed. + RaAllowed bool + + // The ReportDevStatusBattery value. + ReportDevStatusBattery bool + + // The ReportDevStatusMargin value. + ReportDevStatusMargin bool + + // The TargetPER value. + TargetPer int32 + + // The ULBucketSize value. + UlBucketSize *int32 + + // The ULRate value. + UlRate *int32 + + // The ULRatePolicy value. + UlRatePolicy *string +} + +// LoRaWAN object for list functions. +type LoRaWANListDevice struct { + + // The DevEUI value. + DevEui *string +} + +// LoRaWAN router info. +type LoRaWANSendDataToDevice struct { + + // The Fport value. + FPort *int32 +} + +// LoRaWANServiceProfile object. +type LoRaWANServiceProfile struct { + + // The AddGWMetaData value. + AddGwMetadata bool +} + +// LoRaWAN object for update functions. +type LoRaWANUpdateDevice struct { + + // The ID of the device profile for the wireless device. + DeviceProfileId *string + + // The ID of the service profile. + ServiceProfileId *string +} + +// LoRaWANUpdateGatewayTaskCreate object. +type LoRaWANUpdateGatewayTaskCreate struct { + + // The version of the gateways that should receive the update. + CurrentVersion *LoRaWANGatewayVersion + + // The CRC of the signature private key to check. + SigKeyCrc *int64 + + // The signature used to verify the update firmware. + UpdateSignature *string + + // The firmware version to update the gateway to. + UpdateVersion *LoRaWANGatewayVersion +} + +// LoRaWANUpdateGatewayTaskEntry object. +type LoRaWANUpdateGatewayTaskEntry struct { + + // The version of the gateways that should receive the update. + CurrentVersion *LoRaWANGatewayVersion + + // The firmware version to update the gateway to. + UpdateVersion *LoRaWANGatewayVersion +} + +// OTAA device object for v1.0.x +type OtaaV1_0_x struct { + + // The AppEUI value. + AppEui *string + + // The AppKey value. + AppKey *string +} + +// OTAA device object for v1.1 +type OtaaV1_1 struct { + + // The AppKey value. + AppKey *string + + // The JoinEUI value. + JoinEui *string + + // The NwkKey value. + NwkKey *string +} + +// Information about a service profile. +type ServiceProfile struct { + + // The Amazon Resource Name of the resource. + Arn *string + + // The ID of the service profile. + Id *string + + // The name of the resource. + Name *string +} + +// Session keys for ABP v1.1 +type SessionKeysAbpV1_0_x struct { + + // The AppSKey value. + AppSKey *string + + // The NwkSKey value. + NwkSKey *string +} + +// Session keys for ABP v1.1 +type SessionKeysAbpV1_1 struct { + + // The AppSKey value. + AppSKey *string + + // The FNwkSIntKey value. + FNwkSIntKey *string + + // The NwkSEncKey value. + NwkSEncKey *string + + // The SNwkSIntKey value. + SNwkSIntKey *string +} + +// Information about a Sidewalk account. +type SidewalkAccountInfo struct { + + // The Sidewalk Amazon ID. + AmazonId *string + + // The Sidewalk application server private key. + AppServerPrivateKey *string +} + +// Information about a Sidewalk account. +type SidewalkAccountInfoWithFingerprint struct { + + // The Sidewalk Amazon ID. + AmazonId *string + + // Fingerprint for Sidewalk application server private key. + Fingerprint *string +} + +// Sidewalk object used by list functions. +type SidewalkListDevice struct { + + // The Sidewalk Amazon ID. + AmazonId *string +} + +// Information about a Sidewalk router. +type SidewalkSendDataToDevice struct { + + // The sequence number. + Seq *int32 +} + +// Sidewalk update. +type SidewalkUpdateAccount struct { + + // The new Sidewalk application server private key. + AppServerPrivateKey *string +} + +// A simple label consisting of a customer-defined key-value pair +type Tag struct { + + // The tag's key value. + // + // This member is required. + Key *string + + // The tag's value. + // + // This member is required. + Value *string +} + +// UpdateWirelessGatewayTaskCreate object. +type UpdateWirelessGatewayTaskCreate struct { + + // The properties that relate to the LoRaWAN wireless gateway. + LoRaWAN *LoRaWANUpdateGatewayTaskCreate + + // The IAM role used to read data from the S3 bucket. + UpdateDataRole *string + + // The link to the S3 bucket. + UpdateDataSource *string +} + +// UpdateWirelessGatewayTaskEntry object. +type UpdateWirelessGatewayTaskEntry struct { + + // The ID of the new wireless gateway task entry. + Id *string + + // The properties that relate to the LoRaWAN wireless gateway. + LoRaWAN *LoRaWANUpdateGatewayTaskEntry +} + +// Information about a wireless device's operation. +type WirelessDeviceStatistics struct { + + // The Amazon Resource Name of the resource. + Arn *string + + // The name of the destination to which the device is assigned. + DestinationName *string + + // The ID of the wireless device reporting the data. + Id *string + + // The date and time when the most recent uplink was received. + LastUplinkReceivedAt *string + + // LoRaWAN device info. + LoRaWAN *LoRaWANListDevice + + // The name of the resource. + Name *string + + // The Sidewalk account credentials. + Sidewalk *SidewalkListDevice + + // The wireless device type. + Type WirelessDeviceType +} + +// Information about a wireless gateway's operation. +type WirelessGatewayStatistics struct { + + // The Amazon Resource Name of the resource. + Arn *string + + // The description of the resource. + Description *string + + // The ID of the wireless gateway reporting the data. + Id *string + + // The date and time when the most recent uplink was received. + LastUplinkReceivedAt *string + + // LoRaWAN gateway info. + LoRaWAN *LoRaWANGateway + + // The name of the resource. + Name *string +} + +// WirelessMetadata object. +type WirelessMetadata struct { + + // LoRaWAN device info. + LoRaWAN *LoRaWANSendDataToDevice + + // The Sidewalk account credentials. + Sidewalk *SidewalkSendDataToDevice +} diff --git a/service/iotwireless/validators.go b/service/iotwireless/validators.go new file mode 100644 index 00000000000..0d11ce23a76 --- /dev/null +++ b/service/iotwireless/validators.go @@ -0,0 +1,1792 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotwireless + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/iotwireless/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpAssociateAwsAccountWithPartnerAccount struct { +} + +func (*validateOpAssociateAwsAccountWithPartnerAccount) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssociateAwsAccountWithPartnerAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssociateAwsAccountWithPartnerAccountInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssociateAwsAccountWithPartnerAccountInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpAssociateWirelessDeviceWithThing struct { +} + +func (*validateOpAssociateWirelessDeviceWithThing) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssociateWirelessDeviceWithThing) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssociateWirelessDeviceWithThingInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssociateWirelessDeviceWithThingInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpAssociateWirelessGatewayWithCertificate struct { +} + +func (*validateOpAssociateWirelessGatewayWithCertificate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssociateWirelessGatewayWithCertificate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssociateWirelessGatewayWithCertificateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssociateWirelessGatewayWithCertificateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpAssociateWirelessGatewayWithThing struct { +} + +func (*validateOpAssociateWirelessGatewayWithThing) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssociateWirelessGatewayWithThing) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssociateWirelessGatewayWithThingInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssociateWirelessGatewayWithThingInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateDestination struct { +} + +func (*validateOpCreateDestination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDestinationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDestinationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateDeviceProfile struct { +} + +func (*validateOpCreateDeviceProfile) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDeviceProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDeviceProfileInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDeviceProfileInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateServiceProfile struct { +} + +func (*validateOpCreateServiceProfile) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateServiceProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateServiceProfileInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateServiceProfileInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateWirelessDevice struct { +} + +func (*validateOpCreateWirelessDevice) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateWirelessDevice) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateWirelessDeviceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateWirelessDeviceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateWirelessGateway struct { +} + +func (*validateOpCreateWirelessGateway) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateWirelessGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateWirelessGatewayInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateWirelessGatewayInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateWirelessGatewayTaskDefinition struct { +} + +func (*validateOpCreateWirelessGatewayTaskDefinition) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateWirelessGatewayTaskDefinition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateWirelessGatewayTaskDefinitionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateWirelessGatewayTaskDefinitionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateWirelessGatewayTask struct { +} + +func (*validateOpCreateWirelessGatewayTask) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateWirelessGatewayTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateWirelessGatewayTaskInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateWirelessGatewayTaskInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDestination struct { +} + +func (*validateOpDeleteDestination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDestinationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDestinationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDeviceProfile struct { +} + +func (*validateOpDeleteDeviceProfile) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDeviceProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDeviceProfileInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDeviceProfileInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteServiceProfile struct { +} + +func (*validateOpDeleteServiceProfile) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteServiceProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteServiceProfileInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteServiceProfileInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteWirelessDevice struct { +} + +func (*validateOpDeleteWirelessDevice) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteWirelessDevice) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteWirelessDeviceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteWirelessDeviceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteWirelessGateway struct { +} + +func (*validateOpDeleteWirelessGateway) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteWirelessGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteWirelessGatewayInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteWirelessGatewayInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteWirelessGatewayTaskDefinition struct { +} + +func (*validateOpDeleteWirelessGatewayTaskDefinition) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteWirelessGatewayTaskDefinition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteWirelessGatewayTaskDefinitionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteWirelessGatewayTaskDefinitionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteWirelessGatewayTask struct { +} + +func (*validateOpDeleteWirelessGatewayTask) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteWirelessGatewayTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteWirelessGatewayTaskInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteWirelessGatewayTaskInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDisassociateAwsAccountFromPartnerAccount struct { +} + +func (*validateOpDisassociateAwsAccountFromPartnerAccount) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDisassociateAwsAccountFromPartnerAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DisassociateAwsAccountFromPartnerAccountInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDisassociateAwsAccountFromPartnerAccountInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDisassociateWirelessDeviceFromThing struct { +} + +func (*validateOpDisassociateWirelessDeviceFromThing) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDisassociateWirelessDeviceFromThing) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DisassociateWirelessDeviceFromThingInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDisassociateWirelessDeviceFromThingInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDisassociateWirelessGatewayFromCertificate struct { +} + +func (*validateOpDisassociateWirelessGatewayFromCertificate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDisassociateWirelessGatewayFromCertificate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DisassociateWirelessGatewayFromCertificateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDisassociateWirelessGatewayFromCertificateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDisassociateWirelessGatewayFromThing struct { +} + +func (*validateOpDisassociateWirelessGatewayFromThing) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDisassociateWirelessGatewayFromThing) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DisassociateWirelessGatewayFromThingInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDisassociateWirelessGatewayFromThingInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetDestination struct { +} + +func (*validateOpGetDestination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetDestinationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetDestinationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetDeviceProfile struct { +} + +func (*validateOpGetDeviceProfile) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetDeviceProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetDeviceProfileInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetDeviceProfileInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetPartnerAccount struct { +} + +func (*validateOpGetPartnerAccount) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetPartnerAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetPartnerAccountInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetPartnerAccountInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetServiceProfile struct { +} + +func (*validateOpGetServiceProfile) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetServiceProfile) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetServiceProfileInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetServiceProfileInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetWirelessDevice struct { +} + +func (*validateOpGetWirelessDevice) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetWirelessDevice) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetWirelessDeviceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetWirelessDeviceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetWirelessDeviceStatistics struct { +} + +func (*validateOpGetWirelessDeviceStatistics) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetWirelessDeviceStatistics) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetWirelessDeviceStatisticsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetWirelessDeviceStatisticsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetWirelessGatewayCertificate struct { +} + +func (*validateOpGetWirelessGatewayCertificate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetWirelessGatewayCertificate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetWirelessGatewayCertificateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetWirelessGatewayCertificateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetWirelessGatewayFirmwareInformation struct { +} + +func (*validateOpGetWirelessGatewayFirmwareInformation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetWirelessGatewayFirmwareInformation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetWirelessGatewayFirmwareInformationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetWirelessGatewayFirmwareInformationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetWirelessGateway struct { +} + +func (*validateOpGetWirelessGateway) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetWirelessGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetWirelessGatewayInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetWirelessGatewayInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetWirelessGatewayStatistics struct { +} + +func (*validateOpGetWirelessGatewayStatistics) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetWirelessGatewayStatistics) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetWirelessGatewayStatisticsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetWirelessGatewayStatisticsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetWirelessGatewayTaskDefinition struct { +} + +func (*validateOpGetWirelessGatewayTaskDefinition) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetWirelessGatewayTaskDefinition) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetWirelessGatewayTaskDefinitionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetWirelessGatewayTaskDefinitionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetWirelessGatewayTask struct { +} + +func (*validateOpGetWirelessGatewayTask) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetWirelessGatewayTask) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetWirelessGatewayTaskInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetWirelessGatewayTaskInput(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 validateOpSendDataToWirelessDevice struct { +} + +func (*validateOpSendDataToWirelessDevice) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSendDataToWirelessDevice) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SendDataToWirelessDeviceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSendDataToWirelessDeviceInput(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 validateOpTestWirelessDevice struct { +} + +func (*validateOpTestWirelessDevice) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTestWirelessDevice) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TestWirelessDeviceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTestWirelessDeviceInput(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 validateOpUpdateDestination struct { +} + +func (*validateOpUpdateDestination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateDestinationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateDestinationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdatePartnerAccount struct { +} + +func (*validateOpUpdatePartnerAccount) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdatePartnerAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdatePartnerAccountInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdatePartnerAccountInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateWirelessDevice struct { +} + +func (*validateOpUpdateWirelessDevice) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateWirelessDevice) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateWirelessDeviceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateWirelessDeviceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateWirelessGateway struct { +} + +func (*validateOpUpdateWirelessGateway) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateWirelessGateway) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateWirelessGatewayInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateWirelessGatewayInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpAssociateAwsAccountWithPartnerAccountValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssociateAwsAccountWithPartnerAccount{}, middleware.After) +} + +func addOpAssociateWirelessDeviceWithThingValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssociateWirelessDeviceWithThing{}, middleware.After) +} + +func addOpAssociateWirelessGatewayWithCertificateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssociateWirelessGatewayWithCertificate{}, middleware.After) +} + +func addOpAssociateWirelessGatewayWithThingValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssociateWirelessGatewayWithThing{}, middleware.After) +} + +func addOpCreateDestinationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDestination{}, middleware.After) +} + +func addOpCreateDeviceProfileValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDeviceProfile{}, middleware.After) +} + +func addOpCreateServiceProfileValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateServiceProfile{}, middleware.After) +} + +func addOpCreateWirelessDeviceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateWirelessDevice{}, middleware.After) +} + +func addOpCreateWirelessGatewayValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateWirelessGateway{}, middleware.After) +} + +func addOpCreateWirelessGatewayTaskDefinitionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateWirelessGatewayTaskDefinition{}, middleware.After) +} + +func addOpCreateWirelessGatewayTaskValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateWirelessGatewayTask{}, middleware.After) +} + +func addOpDeleteDestinationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDestination{}, middleware.After) +} + +func addOpDeleteDeviceProfileValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDeviceProfile{}, middleware.After) +} + +func addOpDeleteServiceProfileValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteServiceProfile{}, middleware.After) +} + +func addOpDeleteWirelessDeviceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteWirelessDevice{}, middleware.After) +} + +func addOpDeleteWirelessGatewayValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteWirelessGateway{}, middleware.After) +} + +func addOpDeleteWirelessGatewayTaskDefinitionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteWirelessGatewayTaskDefinition{}, middleware.After) +} + +func addOpDeleteWirelessGatewayTaskValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteWirelessGatewayTask{}, middleware.After) +} + +func addOpDisassociateAwsAccountFromPartnerAccountValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDisassociateAwsAccountFromPartnerAccount{}, middleware.After) +} + +func addOpDisassociateWirelessDeviceFromThingValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDisassociateWirelessDeviceFromThing{}, middleware.After) +} + +func addOpDisassociateWirelessGatewayFromCertificateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDisassociateWirelessGatewayFromCertificate{}, middleware.After) +} + +func addOpDisassociateWirelessGatewayFromThingValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDisassociateWirelessGatewayFromThing{}, middleware.After) +} + +func addOpGetDestinationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetDestination{}, middleware.After) +} + +func addOpGetDeviceProfileValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetDeviceProfile{}, middleware.After) +} + +func addOpGetPartnerAccountValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetPartnerAccount{}, middleware.After) +} + +func addOpGetServiceProfileValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetServiceProfile{}, middleware.After) +} + +func addOpGetWirelessDeviceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetWirelessDevice{}, middleware.After) +} + +func addOpGetWirelessDeviceStatisticsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetWirelessDeviceStatistics{}, middleware.After) +} + +func addOpGetWirelessGatewayCertificateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetWirelessGatewayCertificate{}, middleware.After) +} + +func addOpGetWirelessGatewayFirmwareInformationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetWirelessGatewayFirmwareInformation{}, middleware.After) +} + +func addOpGetWirelessGatewayValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetWirelessGateway{}, middleware.After) +} + +func addOpGetWirelessGatewayStatisticsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetWirelessGatewayStatistics{}, middleware.After) +} + +func addOpGetWirelessGatewayTaskDefinitionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetWirelessGatewayTaskDefinition{}, middleware.After) +} + +func addOpGetWirelessGatewayTaskValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetWirelessGatewayTask{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpSendDataToWirelessDeviceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSendDataToWirelessDevice{}, middleware.After) +} + +func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) +} + +func addOpTestWirelessDeviceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTestWirelessDevice{}, middleware.After) +} + +func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) +} + +func addOpUpdateDestinationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateDestination{}, middleware.After) +} + +func addOpUpdatePartnerAccountValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdatePartnerAccount{}, middleware.After) +} + +func addOpUpdateWirelessDeviceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateWirelessDevice{}, middleware.After) +} + +func addOpUpdateWirelessGatewayValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateWirelessGateway{}, middleware.After) +} + +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 validateOpAssociateAwsAccountWithPartnerAccountInput(v *AssociateAwsAccountWithPartnerAccountInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssociateAwsAccountWithPartnerAccountInput"} + if v.Sidewalk == nil { + invalidParams.Add(smithy.NewErrParamRequired("Sidewalk")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAssociateWirelessDeviceWithThingInput(v *AssociateWirelessDeviceWithThingInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssociateWirelessDeviceWithThingInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if v.ThingArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ThingArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAssociateWirelessGatewayWithCertificateInput(v *AssociateWirelessGatewayWithCertificateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssociateWirelessGatewayWithCertificateInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if v.IotCertificateId == nil { + invalidParams.Add(smithy.NewErrParamRequired("IotCertificateId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAssociateWirelessGatewayWithThingInput(v *AssociateWirelessGatewayWithThingInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssociateWirelessGatewayWithThingInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if v.ThingArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ThingArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDestinationInput(v *CreateDestinationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDestinationInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.ExpressionType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ExpressionType")) + } + if v.Expression == nil { + invalidParams.Add(smithy.NewErrParamRequired("Expression")) + } + if v.RoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) + } + 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 validateOpCreateDeviceProfileInput(v *CreateDeviceProfileInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDeviceProfileInput"} + 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 validateOpCreateServiceProfileInput(v *CreateServiceProfileInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateServiceProfileInput"} + 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 validateOpCreateWirelessDeviceInput(v *CreateWirelessDeviceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateWirelessDeviceInput"} + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if v.DestinationName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DestinationName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateWirelessGatewayInput(v *CreateWirelessGatewayInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateWirelessGatewayInput"} + if v.LoRaWAN == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoRaWAN")) + } + 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 validateOpCreateWirelessGatewayTaskDefinitionInput(v *CreateWirelessGatewayTaskDefinitionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateWirelessGatewayTaskDefinitionInput"} + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateWirelessGatewayTaskInput(v *CreateWirelessGatewayTaskInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateWirelessGatewayTaskInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if v.WirelessGatewayTaskDefinitionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WirelessGatewayTaskDefinitionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDestinationInput(v *DeleteDestinationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDestinationInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDeviceProfileInput(v *DeleteDeviceProfileInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDeviceProfileInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteServiceProfileInput(v *DeleteServiceProfileInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteServiceProfileInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteWirelessDeviceInput(v *DeleteWirelessDeviceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteWirelessDeviceInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteWirelessGatewayInput(v *DeleteWirelessGatewayInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteWirelessGatewayInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteWirelessGatewayTaskDefinitionInput(v *DeleteWirelessGatewayTaskDefinitionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteWirelessGatewayTaskDefinitionInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteWirelessGatewayTaskInput(v *DeleteWirelessGatewayTaskInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteWirelessGatewayTaskInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDisassociateAwsAccountFromPartnerAccountInput(v *DisassociateAwsAccountFromPartnerAccountInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DisassociateAwsAccountFromPartnerAccountInput"} + if v.PartnerAccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PartnerAccountId")) + } + if len(v.PartnerType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("PartnerType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDisassociateWirelessDeviceFromThingInput(v *DisassociateWirelessDeviceFromThingInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DisassociateWirelessDeviceFromThingInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDisassociateWirelessGatewayFromCertificateInput(v *DisassociateWirelessGatewayFromCertificateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DisassociateWirelessGatewayFromCertificateInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDisassociateWirelessGatewayFromThingInput(v *DisassociateWirelessGatewayFromThingInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DisassociateWirelessGatewayFromThingInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetDestinationInput(v *GetDestinationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetDestinationInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetDeviceProfileInput(v *GetDeviceProfileInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetDeviceProfileInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetPartnerAccountInput(v *GetPartnerAccountInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetPartnerAccountInput"} + if v.PartnerAccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PartnerAccountId")) + } + if len(v.PartnerType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("PartnerType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetServiceProfileInput(v *GetServiceProfileInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetServiceProfileInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetWirelessDeviceInput(v *GetWirelessDeviceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetWirelessDeviceInput"} + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } + if len(v.IdentifierType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("IdentifierType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetWirelessDeviceStatisticsInput(v *GetWirelessDeviceStatisticsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetWirelessDeviceStatisticsInput"} + if v.WirelessDeviceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WirelessDeviceId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetWirelessGatewayCertificateInput(v *GetWirelessGatewayCertificateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetWirelessGatewayCertificateInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetWirelessGatewayFirmwareInformationInput(v *GetWirelessGatewayFirmwareInformationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetWirelessGatewayFirmwareInformationInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetWirelessGatewayInput(v *GetWirelessGatewayInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetWirelessGatewayInput"} + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } + if len(v.IdentifierType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("IdentifierType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetWirelessGatewayStatisticsInput(v *GetWirelessGatewayStatisticsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetWirelessGatewayStatisticsInput"} + if v.WirelessGatewayId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WirelessGatewayId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetWirelessGatewayTaskDefinitionInput(v *GetWirelessGatewayTaskDefinitionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetWirelessGatewayTaskDefinitionInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetWirelessGatewayTaskInput(v *GetWirelessGatewayTaskInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetWirelessGatewayTaskInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + 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 validateOpSendDataToWirelessDeviceInput(v *SendDataToWirelessDeviceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SendDataToWirelessDeviceInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if v.TransmitMode == nil { + invalidParams.Add(smithy.NewErrParamRequired("TransmitMode")) + } + if v.PayloadData == nil { + invalidParams.Add(smithy.NewErrParamRequired("PayloadData")) + } + 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 validateOpTestWirelessDeviceInput(v *TestWirelessDeviceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TestWirelessDeviceInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + 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 validateOpUpdateDestinationInput(v *UpdateDestinationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateDestinationInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdatePartnerAccountInput(v *UpdatePartnerAccountInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdatePartnerAccountInput"} + if v.Sidewalk == nil { + invalidParams.Add(smithy.NewErrParamRequired("Sidewalk")) + } + if v.PartnerAccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PartnerAccountId")) + } + if len(v.PartnerType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("PartnerType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateWirelessDeviceInput(v *UpdateWirelessDeviceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateWirelessDeviceInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateWirelessGatewayInput(v *UpdateWirelessGatewayInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateWirelessGatewayInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/kms/api_op_CancelKeyDeletion.go b/service/kms/api_op_CancelKeyDeletion.go index 2a96f69efab..631c388a625 100644 --- a/service/kms/api_op_CancelKeyDeletion.go +++ b/service/kms/api_op_CancelKeyDeletion.go @@ -12,15 +12,18 @@ import ( // Cancels the deletion of a customer master key (CMK). When this operation // succeeds, the key state of the CMK is Disabled. To enable the CMK, use -// EnableKey. You cannot perform this operation on a CMK in a different AWS -// account. For more information about scheduling and canceling deletion of a CMK, -// see Deleting Customer Master Keys +// EnableKey. For more information about scheduling and canceling deletion of a +// CMK, see Deleting Customer Master Keys // (https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html) in // the AWS Key Management Service Developer Guide. The CMK that you use for this // operation must be in a compatible key state. For details, see How Key State // Affects Use of a Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a CMK in a different AWS account. Required +// permissions: kms:CancelKeyDeletion +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: ScheduleKeyDeletion func (c *Client) CancelKeyDeletion(ctx context.Context, params *CancelKeyDeletionInput, optFns ...func(*Options)) (*CancelKeyDeletionOutput, error) { if params == nil { params = &CancelKeyDeletionInput{} diff --git a/service/kms/api_op_ConnectCustomKeyStore.go b/service/kms/api_op_ConnectCustomKeyStore.go index e4d9950c74a..58adcb4ab66 100644 --- a/service/kms/api_op_ConnectCustomKeyStore.go +++ b/service/kms/api_op_ConnectCustomKeyStore.go @@ -43,7 +43,23 @@ import ( // again. If you are having trouble connecting or disconnecting a custom key store, // see Troubleshooting a Custom Key Store // (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a custom key store in a different AWS account. +// Required permissions: kms:ConnectCustomKeyStore +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) Related operations +// +// * CreateCustomKeyStore +// +// * +// DeleteCustomKeyStore +// +// * DescribeCustomKeyStores +// +// * DisconnectCustomKeyStore +// +// * +// UpdateCustomKeyStore func (c *Client) ConnectCustomKeyStore(ctx context.Context, params *ConnectCustomKeyStoreInput, optFns ...func(*Options)) (*ConnectCustomKeyStoreOutput, error) { if params == nil { params = &ConnectCustomKeyStoreInput{} diff --git a/service/kms/api_op_CreateAlias.go b/service/kms/api_op_CreateAlias.go index fdc65cc81f9..3d1da1519fb 100644 --- a/service/kms/api_op_CreateAlias.go +++ b/service/kms/api_op_CreateAlias.go @@ -10,73 +10,46 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a display name for a customer managed customer master key (CMK). You can -// use an alias to identify a CMK in cryptographic operations +// Creates a friendly name for a customer master key (CMK). You can use an alias to +// identify a CMK in the AWS KMS console, in the DescribeKey operation and in +// cryptographic operations // (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations), -// such as Encrypt and GenerateDataKey. You can change the CMK associated with the -// alias at any time. Aliases are easier to remember than key IDs. They can also -// help to simplify your applications. For example, if you use an alias in your -// code, you can change the CMK your code uses by associating a given alias with a -// different CMK. To run the same code in multiple AWS regions, use an alias in -// your code, such as alias/ApplicationKey. Then, in each AWS Region, create an -// alias/ApplicationKey alias that is associated with a CMK in that Region. When -// you run your code, it uses the alias/ApplicationKey CMK for that AWS Region -// without any Region-specific code. This operation does not return a response. To -// get the alias that you created, use the ListAliases operation. To use aliases -// successfully, be aware of the following information. -// -// * Each alias points to -// only one CMK at a time, although a single CMK can have multiple aliases. The -// alias and its associated CMK must be in the same AWS account and Region. +// such as Encrypt and GenerateDataKey. You can also change the CMK that's +// associated with the alias (UpdateAlias) or delete the alias (DeleteAlias) at any +// time. These operations don't affect the underlying CMK. You can associate the +// alias with any customer managed CMK in the same AWS Region. Each alias is +// associated with only on CMK at a time, but a CMK can have multiple aliases. A +// valid CMK is required. You can't create an alias without a CMK. The alias must +// be unique in the account and Region, but you can have aliases with the same name +// in different Regions. For detailed information about aliases, see Using aliases +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html) in the +// AWS Key Management Service Developer Guide. This operation does not return a +// response. To get the alias that you created, use the ListAliases operation. The +// CMK that you use for this operation must be in a compatible key state. For +// details, see How Key State Affects Use of a Customer Master Key +// (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the +// AWS Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on an alias in a different AWS account. Required +// permissions // -// * You -// can associate an alias with any customer managed CMK in the same AWS account and -// Region. However, you do not have permission to associate an alias with an AWS -// managed CMK -// (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk) -// or an AWS owned CMK -// (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk). +// * kms:CreateAlias +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the alias (IAM policy). // -// * -// To change the CMK associated with an alias, use the UpdateAlias operation. The -// current CMK and the new CMK must be the same type (both symmetric or both -// asymmetric) and they must have the same key usage (ENCRYPT_DECRYPT or -// SIGN_VERIFY). This restriction prevents cryptographic errors in code that uses -// aliases. +// * kms:CreateAlias +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the CMK (key policy). // -// * The alias name must begin with alias/ followed by a name, such as -// alias/ExampleAlias. It can contain only alphanumeric characters, forward slashes -// (/), underscores (_), and dashes (-). The alias name cannot begin with -// alias/aws/. The alias/aws/ prefix is reserved for AWS managed CMKs -// (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). +// For details, see Controlling access to aliases +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access) +// in the AWS Key Management Service Developer Guide. Related operations: // // * -// The alias name must be unique within an AWS Region. However, you can use the -// same alias name in multiple Regions of the same AWS account. Each instance of -// the alias is associated with a CMK in its Region. -// -// * After you create an alias, -// you cannot change its alias name. However, you can use the DeleteAlias operation -// to delete the alias and then create a new alias with the desired name. +// DeleteAlias // -// * You -// can use an alias name or alias ARN to identify a CMK in AWS KMS cryptographic -// operations -// (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations) -// and in the DescribeKey operation. However, you cannot use alias names or alias -// ARNs in API operations that manage CMKs, such as DisableKey or GetKeyPolicy. For -// information about the valid CMK identifiers for each AWS KMS API operation, see -// the descriptions of the KeyId parameter in the API operation -// documentation. +// * ListAliases // -// Because an alias is not a property of a CMK, you can delete and -// change the aliases of a CMK without affecting the CMK. Also, aliases do not -// appear in the response from the DescribeKey operation. To get the aliases and -// alias ARNs of CMKs in each AWS account and Region, use the ListAliases -// operation. The CMK that you use for this operation must be in a compatible key -// state. For details, see How Key State Affects Use of a Customer Master Key -// (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// * UpdateAlias func (c *Client) CreateAlias(ctx context.Context, params *CreateAliasInput, optFns ...func(*Options)) (*CreateAliasOutput, error) { if params == nil { params = &CreateAliasInput{} @@ -95,17 +68,32 @@ func (c *Client) CreateAlias(ctx context.Context, params *CreateAliasInput, optF type CreateAliasInput struct { // Specifies the alias name. This value must begin with alias/ followed by a name, - // such as alias/ExampleAlias. The alias name cannot begin with alias/aws/. The - // alias/aws/ prefix is reserved for AWS managed CMKs. + // such as alias/ExampleAlias. The AliasName value must be string of 1-256 + // characters. It can contain only alphanumeric characters, forward slashes (/), + // underscores (_), and dashes (-). The alias name cannot begin with alias/aws/. + // The alias/aws/ prefix is reserved for AWS managed CMKs + // (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). // // This member is required. AliasName *string - // Identifies the CMK to which the alias refers. Specify the key ID or the Amazon - // Resource Name (ARN) of the CMK. You cannot specify another alias. For help + // Associates the alias with the specified customer managed CMK + // (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk). + // The CMK must be in the same AWS Region. A valid CMK ID is required. If you + // supply a null or empty string value, this operation returns an error. For help // finding the key ID and ARN, see Finding the Key ID and ARN // (https://docs.aws.amazon.com/kms/latest/developerguide/viewing-keys.html#find-cmk-id-arn) - // in the AWS Key Management Service Developer Guide. + // in the AWS Key Management Service Developer Guide. Specify the key ID or the + // Amazon Resource Name (ARN) of the CMK. For example: + // + // * Key ID: + // 1234abcd-12ab-34cd-56ef-1234567890ab + // + // * Key ARN: + // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab + // + // To + // get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. // // This member is required. TargetKeyId *string diff --git a/service/kms/api_op_CreateCustomKeyStore.go b/service/kms/api_op_CreateCustomKeyStore.go index 028e9a96729..7710cca7277 100644 --- a/service/kms/api_op_CreateCustomKeyStore.go +++ b/service/kms/api_op_CreateCustomKeyStore.go @@ -30,7 +30,23 @@ import ( // verify that all settings are correct and then disconnect it until you are ready // to use it. For help with failures, see Troubleshooting a Custom Key Store // (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a custom key store in a different AWS account. +// Required permissions: kms:CreateCustomKeyStore +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy). Related operations: +// +// * ConnectCustomKeyStore +// +// * +// DeleteCustomKeyStore +// +// * DescribeCustomKeyStores +// +// * DisconnectCustomKeyStore +// +// * +// UpdateCustomKeyStore func (c *Client) CreateCustomKeyStore(ctx context.Context, params *CreateCustomKeyStoreInput, optFns ...func(*Options)) (*CreateCustomKeyStoreOutput, error) { if params == nil { params = &CreateCustomKeyStoreInput{} diff --git a/service/kms/api_op_CreateGrant.go b/service/kms/api_op_CreateGrant.go index e84f026a77c..8deae534a1e 100644 --- a/service/kms/api_op_CreateGrant.go +++ b/service/kms/api_op_CreateGrant.go @@ -53,15 +53,27 @@ import ( // For information about // symmetric and asymmetric CMKs, see Using Symmetric and Asymmetric CMKs // (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html) -// in the AWS Key Management Service Developer Guide. To perform this operation on -// a CMK in a different AWS account, specify the key ARN in the value of the KeyId -// parameter. For more information about grants, see Grants +// in the AWS Key Management Service Developer Guide. For more information about +// grants, see Grants // (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html) in the AWS // Key Management Service Developer Guide . The CMK that you use for this operation // must be in a compatible key state. For details, see How Key State Affects Use of // a Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: Yes. To perform +// this operation on a CMK in a different AWS account, specify the key ARN in the +// value of the KeyId parameter. Required permissions: kms:CreateGrant +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// +// * ListGrants +// +// * ListRetirableGrants +// +// * +// RetireGrant +// +// * RevokeGrant func (c *Client) CreateGrant(ctx context.Context, params *CreateGrantInput, optFns ...func(*Options)) (*CreateGrantOutput, error) { if params == nil { params = &CreateGrantInput{} @@ -119,7 +131,10 @@ type CreateGrantInput struct { // specified in this structure. For more information about encryption context, see // Encryption Context // (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#encrypt_context) - // in the AWS Key Management Service Developer Guide . + // in the AWS Key Management Service Developer Guide . Grant constraints are not + // applied to operations that do not support an encryption context, such as + // cryptographic operations with asymmetric CMKs and management operations, such as + // DescribeKey or RetireGrant. Constraints *types.GrantConstraints // A list of grant tokens. For more information, see Grant Tokens @@ -127,16 +142,16 @@ type CreateGrantInput struct { // in the AWS Key Management Service Developer Guide. GrantTokens []string - // A friendly name for identifying the grant. Use this value to prevent the - // unintended creation of duplicate grants when retrying this request. When this - // value is absent, all CreateGrant requests result in a new grant with a unique - // GrantId even if all the supplied parameters are identical. This can result in - // unintended duplicates when you retry the CreateGrant request. When this value is - // present, you can retry a CreateGrant request with identical parameters; if the - // grant already exists, the original GrantId is returned without creating a new - // grant. Note that the returned grant token is unique with every CreateGrant - // request, even when a duplicate GrantId is returned. All grant tokens obtained in - // this way can be used interchangeably. + // A friendly name for the grant. Use this value to prevent the unintended creation + // of duplicate grants when retrying this request. When this value is absent, all + // CreateGrant requests result in a new grant with a unique GrantId even if all the + // supplied parameters are identical. This can result in unintended duplicates when + // you retry the CreateGrant request. When this value is present, you can retry a + // CreateGrant request with identical parameters; if the grant already exists, the + // original GrantId is returned without creating a new grant. Note that the + // returned grant token is unique with every CreateGrant request, even when a + // duplicate GrantId is returned. All grant tokens for the same grant ID can be + // used interchangeably. Name *string // The principal that is given permission to retire the grant by using RetireGrant diff --git a/service/kms/api_op_CreateKey.go b/service/kms/api_op_CreateKey.go index b3fa99e4f93..30c04a865fa 100644 --- a/service/kms/api_op_CreateKey.go +++ b/service/kms/api_op_CreateKey.go @@ -13,14 +13,13 @@ import ( // Creates a unique customer managed customer master key // (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master-keys) -// (CMK) in your AWS account and Region. You cannot use this operation to create a -// CMK in a different AWS account. You can use the CreateKey operation to create -// symmetric or asymmetric CMKs. +// (CMK) in your AWS account and Region. You can use the CreateKey operation to +// create symmetric or asymmetric CMKs. // -// * Symmetric CMKs contain a 256-bit symmetric key -// that never leaves AWS KMS unencrypted. To use the CMK, you must call AWS KMS. -// You can use a symmetric CMK to encrypt and decrypt small amounts of data, but -// they are typically used to generate data keys +// * Symmetric CMKs contain a 256-bit +// symmetric key that never leaves AWS KMS unencrypted. To use the CMK, you must +// call AWS KMS. You can use a symmetric CMK to encrypt and decrypt small amounts +// of data, but they are typically used to generate data keys // (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-keys) // and data keys pairs // (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#data-key-pairs). @@ -64,7 +63,23 @@ import ( // an asymmetric CMK in a custom key store. For information about custom key stores // in AWS KMS see Using Custom Key Stores // (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) -// in the AWS Key Management Service Developer Guide . +// in the AWS Key Management Service Developer Guide . Cross-account use: No. You +// cannot use this operation to create a CMK in a different AWS account. Required +// permissions: kms:CreateKey +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy). To use the Tags parameter, kms:TagResource +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy). For examples and information about related permissions, see Allow +// a user to create CMKs +// (https://docs.aws.amazon.com/kms/latest/developerguide/iam-policies.html#iam-policy-example-create-key) +// in the AWS Key Management Service Developer Guide. Related operations: +// +// * +// DescribeKey +// +// * ListKeys +// +// * ScheduleKeyDeletion func (c *Client) CreateKey(ctx context.Context, params *CreateKeyInput, optFns ...func(*Options)) (*CreateKeyOutput, error) { if params == nil { params = &CreateKeyInput{} @@ -225,7 +240,10 @@ type CreateKeyInput struct { // information, see Default Key Policy // (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html#key-policy-default) // in the AWS Key Management Service Developer Guide. The key policy size quota is - // 32 kilobytes (32768 bytes). + // 32 kilobytes (32768 bytes). For help writing and formatting a JSON policy + // document, see the IAM JSON Policy Reference + // (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html) in + // the IAM User Guide . Policy *string // One or more tags. Each tag consists of a tag key and a tag value. Both the tag @@ -235,7 +253,10 @@ type CreateKeyInput struct { // changing, deleting and listing tags for CMKs, see Tagging Keys // (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html). Use // this parameter to tag the CMK when it is created. To add tags to an existing - // CMK, use the TagResource operation. + // CMK, use the TagResource operation. To use this parameter, you must have + // kms:TagResource + // (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) + // permission in an IAM policy. Tags []types.Tag } diff --git a/service/kms/api_op_Decrypt.go b/service/kms/api_op_Decrypt.go index 6e02da470a6..2165f7c9ae1 100644 --- a/service/kms/api_op_Decrypt.go +++ b/service/kms/api_op_Decrypt.go @@ -40,22 +40,41 @@ import ( // S3 client-side encryption // (https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingClientSideEncryption.html). // These libraries return a ciphertext format that is incompatible with AWS KMS. If -// the ciphertext was encrypted under a symmetric CMK, you do not need to specify -// the CMK or the encryption algorithm. AWS KMS can get this information from -// metadata that it adds to the symmetric ciphertext blob. However, if you prefer, -// you can specify the KeyId to ensure that a particular CMK is used to decrypt the -// ciphertext. If you specify a different CMK than the one used to encrypt the -// ciphertext, the Decrypt operation fails. Whenever possible, use key policies to -// give users permission to call the Decrypt operation on a particular CMK, instead -// of using IAM policies. Otherwise, you might create an IAM user policy that gives -// the user Decrypt permission on all CMKs. This user could decrypt ciphertext that -// was encrypted by CMKs in other accounts if the key policy for the cross-account -// CMK permits it. If you must use an IAM policy for Decrypt permissions, limit the -// user to particular CMKs or particular trusted accounts. The CMK that you use for -// this operation must be in a compatible key state. For details, see How Key State +// the ciphertext was encrypted under a symmetric CMK, the KeyId parameter is +// optional. AWS KMS can get this information from metadata that it adds to the +// symmetric ciphertext blob. This feature adds durability to your implementation +// by ensuring that authorized users can decrypt ciphertext decades after it was +// encrypted, even if they've lost track of the CMK ID. However, specifying the CMK +// is always recommended as a best practice. When you use the KeyId parameter to +// specify a CMK, AWS KMS only uses the CMK you specify. If the ciphertext was +// encrypted under a different CMK, the Decrypt operation fails. This practice +// ensures that you use the CMK that you intend. Whenever possible, use key +// policies to give users permission to call the Decrypt operation on a particular +// CMK, instead of using IAM policies. Otherwise, you might create an IAM user +// policy that gives the user Decrypt permission on all CMKs. This user could +// decrypt ciphertext that was encrypted by CMKs in other accounts if the key +// policy for the cross-account CMK permits it. If you must use an IAM policy for +// Decrypt permissions, limit the user to particular CMKs or particular trusted +// accounts. For details, see Best practices for IAM policies +// (https://docs.aws.amazon.com/kms/latest/developerguide/iam-policies.html#iam-policies-best-practices) +// in the AWS Key Management Service Developer Guide. The CMK that you use for this +// operation must be in a compatible key state. For details, see How Key State // Affects Use of a Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: Yes. You can +// decrypt a ciphertext using a CMK in a different AWS account. Required +// permissions: kms:Decrypt +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// +// * Encrypt +// +// * GenerateDataKey +// +// * +// GenerateDataKeyPair +// +// * ReEncrypt func (c *Client) Decrypt(ctx context.Context, params *DecryptInput, optFns ...func(*Options)) (*DecryptOutput, error) { if params == nil { params = &DecryptInput{} @@ -105,19 +124,18 @@ type DecryptInput struct { // in the AWS Key Management Service Developer Guide. GrantTokens []string - // Specifies the customer master key (CMK) that AWS KMS will use to decrypt the + // Specifies the customer master key (CMK) that AWS KMS uses to decrypt the // ciphertext. Enter a key ID of the CMK that was used to encrypt the ciphertext. - // If you specify a KeyId value, the Decrypt operation succeeds only if the - // specified CMK was used to encrypt the ciphertext. This parameter is required - // only when the ciphertext was encrypted under an asymmetric CMK. Otherwise, AWS - // KMS uses the metadata that it adds to the ciphertext blob to determine which CMK - // was used to encrypt the ciphertext. However, you can use this parameter to - // ensure that a particular CMK (of any kind) is used to decrypt the ciphertext. To - // specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, or alias - // ARN. When using an alias name, prefix it with "alias/". For example: + // This parameter is required only when the ciphertext was encrypted under an + // asymmetric CMK. If you used a symmetric CMK, AWS KMS can get the CMK from + // metadata that it adds to the symmetric ciphertext blob. However, it is always + // recommended as a best practice. This practice ensures that you use the CMK that + // you intend. To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias + // name, or alias ARN. When using an alias name, prefix it with "alias/". To + // specify a CMK in a different AWS account, you must use the key ARN or alias ARN. + // For example: // - // * Key ID: - // 1234abcd-12ab-34cd-56ef-1234567890ab + // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab diff --git a/service/kms/api_op_DeleteAlias.go b/service/kms/api_op_DeleteAlias.go index 4c4ce9eda11..df37d6bcf24 100644 --- a/service/kms/api_op_DeleteAlias.go +++ b/service/kms/api_op_DeleteAlias.go @@ -10,14 +10,34 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes the specified alias. You cannot perform this operation on an alias in a -// different AWS account. Because an alias is not a property of a CMK, you can -// delete and change the aliases of a CMK without affecting the CMK. Also, aliases -// do not appear in the response from the DescribeKey operation. To get the aliases -// of all CMKs, use the ListAliases operation. Each CMK can have multiple aliases. -// To change the alias of a CMK, use DeleteAlias to delete the current alias and -// CreateAlias to create a new alias. To associate an existing alias with a -// different customer master key (CMK), call UpdateAlias. +// Deletes the specified alias. Because an alias is not a property of a CMK, you +// can delete and change the aliases of a CMK without affecting the CMK. Also, +// aliases do not appear in the response from the DescribeKey operation. To get the +// aliases of all CMKs, use the ListAliases operation. Each CMK can have multiple +// aliases. To change the alias of a CMK, use DeleteAlias to delete the current +// alias and CreateAlias to create a new alias. To associate an existing alias with +// a different customer master key (CMK), call UpdateAlias. Cross-account use: No. +// You cannot perform this operation on an alias in a different AWS account. +// Required permissions +// +// * kms:DeleteAlias +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the alias (IAM policy). +// +// * kms:DeleteAlias +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the CMK (key policy). +// +// For details, see Controlling access to aliases +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access) +// in the AWS Key Management Service Developer Guide. Related operations: +// +// * +// CreateAlias +// +// * ListAliases +// +// * UpdateAlias func (c *Client) DeleteAlias(ctx context.Context, params *DeleteAliasInput, optFns ...func(*Options)) (*DeleteAliasOutput, error) { if params == nil { params = &DeleteAliasInput{} diff --git a/service/kms/api_op_DeleteCustomKeyStore.go b/service/kms/api_op_DeleteCustomKeyStore.go index c174728df36..55bc98248e0 100644 --- a/service/kms/api_op_DeleteCustomKeyStore.go +++ b/service/kms/api_op_DeleteCustomKeyStore.go @@ -36,6 +36,22 @@ import ( // (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) // feature in AWS KMS, which combines the convenience and extensive integration of // AWS KMS with the isolation and control of a single-tenant key store. +// Cross-account use: No. You cannot perform this operation on a custom key store +// in a different AWS account. Required permissions: kms:DeleteCustomKeyStore +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) Related operations: +// +// * ConnectCustomKeyStore +// +// * +// CreateCustomKeyStore +// +// * DescribeCustomKeyStores +// +// * DisconnectCustomKeyStore +// +// * +// UpdateCustomKeyStore func (c *Client) DeleteCustomKeyStore(ctx context.Context, params *DeleteCustomKeyStoreInput, optFns ...func(*Options)) (*DeleteCustomKeyStoreOutput, error) { if params == nil { params = &DeleteCustomKeyStoreInput{} diff --git a/service/kms/api_op_DeleteImportedKeyMaterial.go b/service/kms/api_op_DeleteImportedKeyMaterial.go index ccdb16b06d5..c0344ecd61b 100644 --- a/service/kms/api_op_DeleteImportedKeyMaterial.go +++ b/service/kms/api_op_DeleteImportedKeyMaterial.go @@ -14,15 +14,22 @@ import ( // specified customer master key (CMK) unusable. For more information about // importing key material into AWS KMS, see Importing Key Material // (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html) in -// the AWS Key Management Service Developer Guide. You cannot perform this -// operation on a CMK in a different AWS account. When the specified CMK is in the +// the AWS Key Management Service Developer Guide. When the specified CMK is in the // PendingDeletion state, this operation does not change the CMK's state. // Otherwise, it changes the CMK's state to PendingImport. After you delete key // material, you can use ImportKeyMaterial to reimport the same key material into // the CMK. The CMK that you use for this operation must be in a compatible key // state. For details, see How Key State Affects Use of a Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a CMK in a different AWS account. Required +// permissions: kms:DeleteImportedKeyMaterial +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// +// * GetParametersForImport +// +// * ImportKeyMaterial func (c *Client) DeleteImportedKeyMaterial(ctx context.Context, params *DeleteImportedKeyMaterialInput, optFns ...func(*Options)) (*DeleteImportedKeyMaterialOutput, error) { if params == nil { params = &DeleteImportedKeyMaterialInput{} diff --git a/service/kms/api_op_DescribeCustomKeyStores.go b/service/kms/api_op_DescribeCustomKeyStores.go index a96cf4be1cc..28be936e62d 100644 --- a/service/kms/api_op_DescribeCustomKeyStores.go +++ b/service/kms/api_op_DescribeCustomKeyStores.go @@ -33,7 +33,23 @@ import ( // and contains the minimum number of HSMs required for the operation, if any. For // help repairing your custom key store, see the Troubleshooting Custom Key Stores // (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html) topic -// in the AWS Key Management Service Developer Guide. +// in the AWS Key Management Service Developer Guide. Cross-account use: No. You +// cannot perform this operation on a custom key store in a different AWS account. +// Required permissions: kms:DescribeCustomKeyStores +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) Related operations: +// +// * ConnectCustomKeyStore +// +// * +// CreateCustomKeyStore +// +// * DeleteCustomKeyStore +// +// * DisconnectCustomKeyStore +// +// * +// UpdateCustomKeyStore func (c *Client) DescribeCustomKeyStores(ctx context.Context, params *DescribeCustomKeyStoresInput, optFns ...func(*Options)) (*DescribeCustomKeyStoresOutput, error) { if params == nil { params = &DescribeCustomKeyStoresInput{} diff --git a/service/kms/api_op_DescribeKey.go b/service/kms/api_op_DescribeKey.go index d9bdad0e37e..cfeb10d6335 100644 --- a/service/kms/api_op_DescribeKey.go +++ b/service/kms/api_op_DescribeKey.go @@ -47,9 +47,26 @@ import ( // KMS creates an AWS managed CMK // (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys). // Then, it associates the alias with the new CMK, and returns the KeyId and Arn of -// the new CMK in the response. To perform this operation on a CMK in a different -// AWS account, specify the key ARN or alias ARN in the value of the KeyId -// parameter. +// the new CMK in the response. Cross-account use: Yes. To perform this operation +// with a CMK in a different AWS account, specify the key ARN or alias ARN in the +// value of the KeyId parameter. Required permissions: kms:DescribeKey +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// +// * GetKeyPolicy +// +// * GetKeyRotationStatus +// +// * +// ListAliases +// +// * ListGrants +// +// * ListKeys +// +// * ListResourceTags +// +// * ListRetirableGrants func (c *Client) DescribeKey(ctx context.Context, params *DescribeKeyInput, optFns ...func(*Options)) (*DescribeKeyOutput, error) { if params == nil { params = &DescribeKeyInput{} diff --git a/service/kms/api_op_DisableKey.go b/service/kms/api_op_DisableKey.go index 991576ee1a9..96f87929a31 100644 --- a/service/kms/api_op_DisableKey.go +++ b/service/kms/api_op_DisableKey.go @@ -10,18 +10,21 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Sets the state of a customer master key (CMK) to disabled, thereby preventing -// its use for cryptographic operations +// Sets the state of a customer master key (CMK) to disabled. This change +// temporarily prevents use of the CMK for cryptographic operations // (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations). -// You cannot perform this operation on a CMK in a different AWS account. For more -// information about how key state affects the use of a CMK, see How Key State -// Affects the Use of a Customer Master Key +// For more information about how key state affects the use of a CMK, see How Key +// State Affects the Use of a Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the // AWS Key Management Service Developer Guide . The CMK that you use for this // operation must be in a compatible key state. For details, see How Key State // Affects Use of a Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a CMK in a different AWS account. Required +// permissions: kms:DisableKey +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: EnableKey func (c *Client) DisableKey(ctx context.Context, params *DisableKeyInput, optFns ...func(*Options)) (*DisableKeyOutput, error) { if params == nil { params = &DisableKeyInput{} diff --git a/service/kms/api_op_DisableKeyRotation.go b/service/kms/api_op_DisableKeyRotation.go index 4ae5e068494..0f3fc34f322 100644 --- a/service/kms/api_op_DisableKeyRotation.go +++ b/service/kms/api_op_DisableKeyRotation.go @@ -16,11 +16,18 @@ import ( // rotation of asymmetric CMKs, CMKs with imported key material, or CMKs in a // custom key store // (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). -// You cannot perform this operation on a CMK in a different AWS account. The CMK -// that you use for this operation must be in a compatible key state. For details, -// see How Key State Affects Use of a Customer Master Key +// The CMK that you use for this operation must be in a compatible key state. For +// details, see How Key State Affects Use of a Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a CMK in a different AWS account. Required +// permissions: kms:DisableKeyRotation +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// +// * EnableKeyRotation +// +// * GetKeyRotationStatus func (c *Client) DisableKeyRotation(ctx context.Context, params *DisableKeyRotationInput, optFns ...func(*Options)) (*DisableKeyRotationOutput, error) { if params == nil { params = &DisableKeyRotationInput{} @@ -38,8 +45,8 @@ func (c *Client) DisableKeyRotation(ctx context.Context, params *DisableKeyRotat type DisableKeyRotationInput struct { - // Identifies a symmetric customer master key (CMK). You cannot enable automatic - // rotation of asymmetric CMKs + // Identifies a symmetric customer master key (CMK). You cannot enable or disable + // automatic rotation of asymmetric CMKs // (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html#asymmetric-cmks), // CMKs with imported key material // (https://docs.aws.amazon.com/kms/latest/developerguide/importing-keys.html), or diff --git a/service/kms/api_op_DisconnectCustomKeyStore.go b/service/kms/api_op_DisconnectCustomKeyStore.go index f598cfc16c4..0aed0bb9bac 100644 --- a/service/kms/api_op_DisconnectCustomKeyStore.go +++ b/service/kms/api_op_DisconnectCustomKeyStore.go @@ -28,6 +28,22 @@ import ( // (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) // feature in AWS KMS, which combines the convenience and extensive integration of // AWS KMS with the isolation and control of a single-tenant key store. +// Cross-account use: No. You cannot perform this operation on a custom key store +// in a different AWS account. Required permissions: kms:DisconnectCustomKeyStore +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) Related operations: +// +// * ConnectCustomKeyStore +// +// * +// CreateCustomKeyStore +// +// * DeleteCustomKeyStore +// +// * DescribeCustomKeyStores +// +// * +// UpdateCustomKeyStore func (c *Client) DisconnectCustomKeyStore(ctx context.Context, params *DisconnectCustomKeyStoreInput, optFns ...func(*Options)) (*DisconnectCustomKeyStoreOutput, error) { if params == nil { params = &DisconnectCustomKeyStoreInput{} diff --git a/service/kms/api_op_EnableKey.go b/service/kms/api_op_EnableKey.go index 2877edc270c..53b2a3d5f62 100644 --- a/service/kms/api_op_EnableKey.go +++ b/service/kms/api_op_EnableKey.go @@ -13,11 +13,14 @@ import ( // Sets the key state of a customer master key (CMK) to enabled. This allows you to // use the CMK for cryptographic operations // (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#cryptographic-operations). -// You cannot perform this operation on a CMK in a different AWS account. The CMK -// that you use for this operation must be in a compatible key state. For details, -// see How Key State Affects Use of a Customer Master Key +// The CMK that you use for this operation must be in a compatible key state. For +// details, see How Key State Affects Use of a Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a CMK in a different AWS account. Required +// permissions: kms:EnableKey +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: DisableKey func (c *Client) EnableKey(ctx context.Context, params *EnableKeyInput, optFns ...func(*Options)) (*EnableKeyOutput, error) { if params == nil { params = &EnableKeyInput{} diff --git a/service/kms/api_op_EnableKeyRotation.go b/service/kms/api_op_EnableKeyRotation.go index a1322d88941..bce14a5ec1b 100644 --- a/service/kms/api_op_EnableKeyRotation.go +++ b/service/kms/api_op_EnableKeyRotation.go @@ -12,14 +12,22 @@ import ( // Enables automatic rotation of the key material // (https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html) for the -// specified symmetric customer master key (CMK). You cannot perform this operation -// on a CMK in a different AWS account. You cannot enable automatic rotation of -// asymmetric CMKs, CMKs with imported key material, or CMKs in a custom key store +// specified symmetric customer master key (CMK). You cannot enable automatic +// rotation of asymmetric CMKs, CMKs with imported key material, or CMKs in a +// custom key store // (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html). // The CMK that you use for this operation must be in a compatible key state. For // details, see How Key State Affects Use of a Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a CMK in a different AWS account. Required +// permissions: kms:EnableKeyRotation +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// +// * DisableKeyRotation +// +// * GetKeyRotationStatus func (c *Client) EnableKeyRotation(ctx context.Context, params *EnableKeyRotationInput, optFns ...func(*Options)) (*EnableKeyRotationOutput, error) { if params == nil { params = &EnableKeyRotationInput{} diff --git a/service/kms/api_op_Encrypt.go b/service/kms/api_op_Encrypt.go index 502c2ce6821..4b45fa19cce 100644 --- a/service/kms/api_op_Encrypt.go +++ b/service/kms/api_op_Encrypt.go @@ -81,9 +81,18 @@ import ( // CMK that you use for this operation must be in a compatible key state. For // details, see How Key State Affects Use of a Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. To perform this operation on a CMK -// in a different AWS account, specify the key ARN or alias ARN in the value of the -// KeyId parameter. +// AWS Key Management Service Developer Guide. Cross-account use: Yes. To perform +// this operation with a CMK in a different AWS account, specify the key ARN or +// alias ARN in the value of the KeyId parameter. Required permissions: kms:Encrypt +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// +// * Decrypt +// +// * GenerateDataKey +// +// * +// GenerateDataKeyPair func (c *Client) Encrypt(ctx context.Context, params *EncryptInput, optFns ...func(*Options)) (*EncryptOutput, error) { if params == nil { params = &EncryptInput{} diff --git a/service/kms/api_op_GenerateDataKey.go b/service/kms/api_op_GenerateDataKey.go index 6f43e1b24ab..de305c578d3 100644 --- a/service/kms/api_op_GenerateDataKey.go +++ b/service/kms/api_op_GenerateDataKey.go @@ -66,6 +66,24 @@ import ( // * // Use the plaintext data key to decrypt data outside of AWS KMS, then erase the // plaintext data key from memory. +// +// Cross-account use: Yes. To perform this +// operation with a CMK in a different AWS account, specify the key ARN or alias +// ARN in the value of the KeyId parameter. Required permissions: +// kms:GenerateDataKey +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// +// * Decrypt +// +// * Encrypt +// +// * GenerateDataKeyPair +// +// * +// GenerateDataKeyPairWithoutPlaintext +// +// * GenerateDataKeyWithoutPlaintext func (c *Client) GenerateDataKey(ctx context.Context, params *GenerateDataKeyInput, optFns ...func(*Options)) (*GenerateDataKeyOutput, error) { if params == nil { params = &GenerateDataKeyInput{} diff --git a/service/kms/api_op_GenerateDataKeyPair.go b/service/kms/api_op_GenerateDataKeyPair.go index 1589005c3af..d4143153910 100644 --- a/service/kms/api_op_GenerateDataKeyPair.go +++ b/service/kms/api_op_GenerateDataKeyPair.go @@ -42,7 +42,23 @@ import ( // operation must be in a compatible key state. For details, see How Key State // Affects Use of a Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: Yes. To perform +// this operation with a CMK in a different AWS account, specify the key ARN or +// alias ARN in the value of the KeyId parameter. Required permissions: +// kms:GenerateDataKeyPair +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// +// * Decrypt +// +// * Encrypt +// +// * GenerateDataKey +// +// * +// GenerateDataKeyPairWithoutPlaintext +// +// * GenerateDataKeyWithoutPlaintext func (c *Client) GenerateDataKeyPair(ctx context.Context, params *GenerateDataKeyPairInput, optFns ...func(*Options)) (*GenerateDataKeyPairOutput, error) { if params == nil { params = &GenerateDataKeyPairInput{} diff --git a/service/kms/api_op_GenerateDataKeyPairWithoutPlaintext.go b/service/kms/api_op_GenerateDataKeyPairWithoutPlaintext.go index a2af54e6ec1..61152401837 100644 --- a/service/kms/api_op_GenerateDataKeyPairWithoutPlaintext.go +++ b/service/kms/api_op_GenerateDataKeyPairWithoutPlaintext.go @@ -36,7 +36,23 @@ import ( // operation must be in a compatible key state. For details, see How Key State // Affects Use of a Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: Yes. To perform +// this operation with a CMK in a different AWS account, specify the key ARN or +// alias ARN in the value of the KeyId parameter. Required permissions: +// kms:GenerateDataKeyPairWithoutPlaintext +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// +// * Decrypt +// +// * Encrypt +// +// * GenerateDataKey +// +// * +// GenerateDataKeyPair +// +// * GenerateDataKeyWithoutPlaintext func (c *Client) GenerateDataKeyPairWithoutPlaintext(ctx context.Context, params *GenerateDataKeyPairWithoutPlaintextInput, optFns ...func(*Options)) (*GenerateDataKeyPairWithoutPlaintextOutput, error) { if params == nil { params = &GenerateDataKeyPairWithoutPlaintextInput{} @@ -58,8 +74,9 @@ type GenerateDataKeyPairWithoutPlaintextInput struct { // specify a symmetric CMK. You cannot use an asymmetric CMK or a CMK in a custom // key store. To get the type and origin of your CMK, use the DescribeKey // operation. To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias - // name, or alias ARN. When using an alias name, prefix it with "alias/". For - // example: + // name, or alias ARN. When using an alias name, prefix it with "alias/". To + // specify a CMK in a different AWS account, you must use the key ARN or alias ARN. + // For example: // // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // diff --git a/service/kms/api_op_GenerateDataKeyWithoutPlaintext.go b/service/kms/api_op_GenerateDataKeyWithoutPlaintext.go index 822796abe87..49597957b97 100644 --- a/service/kms/api_op_GenerateDataKeyWithoutPlaintext.go +++ b/service/kms/api_op_GenerateDataKeyWithoutPlaintext.go @@ -43,7 +43,23 @@ import ( // operation must be in a compatible key state. For details, see How Key State // Affects Use of a Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: Yes. To perform +// this operation with a CMK in a different AWS account, specify the key ARN or +// alias ARN in the value of the KeyId parameter. Required permissions: +// kms:GenerateDataKeyWithoutPlaintext +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// +// * Decrypt +// +// * Encrypt +// +// * GenerateDataKey +// +// * +// GenerateDataKeyPair +// +// * GenerateDataKeyPairWithoutPlaintext func (c *Client) GenerateDataKeyWithoutPlaintext(ctx context.Context, params *GenerateDataKeyWithoutPlaintextInput, optFns ...func(*Options)) (*GenerateDataKeyWithoutPlaintextOutput, error) { if params == nil { params = &GenerateDataKeyWithoutPlaintextInput{} diff --git a/service/kms/api_op_GenerateRandom.go b/service/kms/api_op_GenerateRandom.go index 2bdc03455fb..f48b7693af2 100644 --- a/service/kms/api_op_GenerateRandom.go +++ b/service/kms/api_op_GenerateRandom.go @@ -17,6 +17,9 @@ import ( // specify the custom key store ID. For more information about entropy and random // number generation, see the AWS Key Management Service Cryptographic Details // (https://d0.awsstatic.com/whitepapers/KMS-Cryptographic-Details.pdf) whitepaper. +// Required permissions: kms:GenerateRandom +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) func (c *Client) GenerateRandom(ctx context.Context, params *GenerateRandomInput, optFns ...func(*Options)) (*GenerateRandomOutput, error) { if params == nil { params = &GenerateRandomInput{} diff --git a/service/kms/api_op_GetKeyPolicy.go b/service/kms/api_op_GetKeyPolicy.go index 1ae2c957fc0..72597650382 100644 --- a/service/kms/api_op_GetKeyPolicy.go +++ b/service/kms/api_op_GetKeyPolicy.go @@ -10,8 +10,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets a key policy attached to the specified customer master key (CMK). You -// cannot perform this operation on a CMK in a different AWS account. +// Gets a key policy attached to the specified customer master key (CMK). +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. Required permissions: kms:GetKeyPolicy +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: PutKeyPolicy func (c *Client) GetKeyPolicy(ctx context.Context, params *GetKeyPolicyInput, optFns ...func(*Options)) (*GetKeyPolicyOutput, error) { if params == nil { params = &GetKeyPolicyInput{} diff --git a/service/kms/api_op_GetKeyRotationStatus.go b/service/kms/api_op_GetKeyRotationStatus.go index 0fe46c92b22..365867647be 100644 --- a/service/kms/api_op_GetKeyRotationStatus.go +++ b/service/kms/api_op_GetKeyRotationStatus.go @@ -32,8 +32,15 @@ import ( // backing key. If you cancel the deletion, the original key rotation status is // restored. // -// To perform this operation on a CMK in a different AWS account, -// specify the key ARN in the value of the KeyId parameter. +// Cross-account use: Yes. To perform this operation on a CMK in a +// different AWS account, specify the key ARN in the value of the KeyId parameter. +// Required permissions: kms:GetKeyRotationStatus +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// +// * DisableKeyRotation +// +// * EnableKeyRotation func (c *Client) GetKeyRotationStatus(ctx context.Context, params *GetKeyRotationStatusInput, optFns ...func(*Options)) (*GetKeyRotationStatusOutput, error) { if params == nil { params = &GetKeyRotationStatusInput{} diff --git a/service/kms/api_op_GetParametersForImport.go b/service/kms/api_op_GetParametersForImport.go index be9cb46f4be..d737810e31d 100644 --- a/service/kms/api_op_GetParametersForImport.go +++ b/service/kms/api_op_GetParametersForImport.go @@ -32,7 +32,16 @@ import ( // in a compatible key state. For details, see How Key State Affects Use of a // Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a CMK in a different AWS account. Required +// permissions: kms:GetParametersForImport +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// +// * ImportKeyMaterial +// +// * +// DeleteImportedKeyMaterial func (c *Client) GetParametersForImport(ctx context.Context, params *GetParametersForImportInput, optFns ...func(*Options)) (*GetParametersForImportOutput, error) { if params == nil { params = &GetParametersForImportInput{} diff --git a/service/kms/api_op_GetPublicKey.go b/service/kms/api_op_GetPublicKey.go index 5c3b306c3ac..ff9faf3c12f 100644 --- a/service/kms/api_op_GetPublicKey.go +++ b/service/kms/api_op_GetPublicKey.go @@ -56,7 +56,12 @@ import ( // use for this operation must be in a compatible key state. For details, see How // Key State Affects Use of a Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: Yes. To perform +// this operation with a CMK in a different AWS account, specify the key ARN or +// alias ARN in the value of the KeyId parameter. Required permissions: +// kms:GetPublicKey +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: CreateKey func (c *Client) GetPublicKey(ctx context.Context, params *GetPublicKeyInput, optFns ...func(*Options)) (*GetPublicKeyOutput, error) { if params == nil { params = &GetPublicKeyInput{} diff --git a/service/kms/api_op_ImportKeyMaterial.go b/service/kms/api_op_ImportKeyMaterial.go index c7b0f1ed008..82c494da3b5 100644 --- a/service/kms/api_op_ImportKeyMaterial.go +++ b/service/kms/api_op_ImportKeyMaterial.go @@ -58,7 +58,16 @@ import ( // operation must be in a compatible key state. For details, see How Key State // Affects Use of a Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a CMK in a different AWS account. Required +// permissions: kms:ImportKeyMaterial +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// +// * DeleteImportedKeyMaterial +// +// * +// GetParametersForImport func (c *Client) ImportKeyMaterial(ctx context.Context, params *ImportKeyMaterialInput, optFns ...func(*Options)) (*ImportKeyMaterialOutput, error) { if params == nil { params = &ImportKeyMaterialInput{} diff --git a/service/kms/api_op_ListAliases.go b/service/kms/api_op_ListAliases.go index 73f3116a537..a1ad45d92b6 100644 --- a/service/kms/api_op_ListAliases.go +++ b/service/kms/api_op_ListAliases.go @@ -12,19 +12,34 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets a list of aliases in the caller's AWS account and region. You cannot list -// aliases in other accounts. For more information about aliases, see CreateAlias. -// By default, the ListAliases command returns all aliases in the account and -// region. To get only the aliases that point to a particular customer master key -// (CMK), use the KeyId parameter. The ListAliases response can include aliases -// that you created and associated with your customer managed CMKs, and aliases -// that AWS created and associated with AWS managed CMKs in your account. You can -// recognize AWS aliases because their names have the format aws/, such as -// aws/dynamodb. The response might also include aliases that have no TargetKeyId -// field. These are predefined aliases that AWS has created but has not yet -// associated with a CMK. Aliases that AWS creates in your account, including -// predefined aliases, do not count against your AWS KMS aliases quota +// Gets a list of aliases in the caller's AWS account and region. For more +// information about aliases, see CreateAlias. By default, the ListAliases +// operation returns all aliases in the account and region. To get only the aliases +// associated with a particular customer master key (CMK), use the KeyId parameter. +// The ListAliases response can include aliases that you created and associated +// with your customer managed CMKs, and aliases that AWS created and associated +// with AWS managed CMKs in your account. You can recognize AWS aliases because +// their names have the format aws/, such as aws/dynamodb. The response might also +// include aliases that have no TargetKeyId field. These are predefined aliases +// that AWS has created but has not yet associated with a CMK. Aliases that AWS +// creates in your account, including predefined aliases, do not count against your +// AWS KMS aliases quota // (https://docs.aws.amazon.com/kms/latest/developerguide/limits.html#aliases-limit). +// Cross-account use: No. ListAliases does not return aliases in other AWS +// accounts. Required permissions: kms:ListAliases +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) For details, see Controlling access to aliases +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access) +// in the AWS Key Management Service Developer Guide. +// +// Related operations: +// +// * +// CreateAlias +// +// * DeleteAlias +// +// * UpdateAlias func (c *Client) ListAliases(ctx context.Context, params *ListAliasesInput, optFns ...func(*Options)) (*ListAliasesOutput, error) { if params == nil { params = &ListAliasesInput{} @@ -42,11 +57,19 @@ func (c *Client) ListAliases(ctx context.Context, params *ListAliasesInput, optF type ListAliasesInput struct { - // Lists only aliases that refer to the specified CMK. The value of this parameter - // can be the ID or Amazon Resource Name (ARN) of a CMK in the caller's account and - // region. You cannot use an alias name or alias ARN in this value. This parameter - // is optional. If you omit it, ListAliases returns all aliases in the account and - // region. + // Lists only aliases that are associated with the specified CMK. Enter a CMK in + // your AWS account. This parameter is optional. If you omit it, ListAliases + // returns all aliases in the account and Region. Specify the key ID or the Amazon + // Resource Name (ARN) of the CMK. For example: + // + // * Key ID: + // 1234abcd-12ab-34cd-56ef-1234567890ab + // + // * Key ARN: + // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab + // + // To + // get the key ID and key ARN for a CMK, use ListKeys or DescribeKey. KeyId *string // Use this parameter to specify the maximum number of items to return. When this diff --git a/service/kms/api_op_ListGrants.go b/service/kms/api_op_ListGrants.go index 394ad707ff0..6e952f0acbc 100644 --- a/service/kms/api_op_ListGrants.go +++ b/service/kms/api_op_ListGrants.go @@ -12,14 +12,27 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Gets a list of all grants for the specified customer master key (CMK). To -// perform this operation on a CMK in a different AWS account, specify the key ARN -// in the value of the KeyId parameter. The GranteePrincipal field in the -// ListGrants response usually contains the user or role designated as the grantee -// principal in the grant. However, when the grantee principal in the grant is an -// AWS service, the GranteePrincipal field contains the service principal +// Gets a list of all grants for the specified customer master key (CMK). The +// GranteePrincipal field in the ListGrants response usually contains the user or +// role designated as the grantee principal in the grant. However, when the grantee +// principal in the grant is an AWS service, the GranteePrincipal field contains +// the service principal // (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements_principal.html#principal-services), -// which might represent several different grantee principals. +// which might represent several different grantee principals. Cross-account use: +// Yes. To perform this operation on a CMK in a different AWS account, specify the +// key ARN in the value of the KeyId parameter. Required permissions: +// kms:ListGrants +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// +// * CreateGrant +// +// * ListRetirableGrants +// +// * +// RetireGrant +// +// * RevokeGrant func (c *Client) ListGrants(ctx context.Context, params *ListGrantsInput, optFns ...func(*Options)) (*ListGrantsOutput, error) { if params == nil { params = &ListGrantsInput{} diff --git a/service/kms/api_op_ListKeyPolicies.go b/service/kms/api_op_ListKeyPolicies.go index e250c0a20da..71a0b3ffead 100644 --- a/service/kms/api_op_ListKeyPolicies.go +++ b/service/kms/api_op_ListKeyPolicies.go @@ -13,8 +13,15 @@ import ( // Gets the names of the key policies that are attached to a customer master key // (CMK). This operation is designed to get policy names that you can use in a -// GetKeyPolicy operation. However, the only valid policy name is default. You -// cannot perform this operation on a CMK in a different AWS account. +// GetKeyPolicy operation. However, the only valid policy name is default. +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. Required permissions: kms:ListKeyPolicies +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// +// * GetKeyPolicy +// +// * PutKeyPolicy func (c *Client) ListKeyPolicies(ctx context.Context, params *ListKeyPoliciesInput, optFns ...func(*Options)) (*ListKeyPoliciesOutput, error) { if params == nil { params = &ListKeyPoliciesInput{} diff --git a/service/kms/api_op_ListKeys.go b/service/kms/api_op_ListKeys.go index c9cf0d22f6e..802a4c40b77 100644 --- a/service/kms/api_op_ListKeys.go +++ b/service/kms/api_op_ListKeys.go @@ -13,7 +13,19 @@ import ( ) // Gets a list of all customer master keys (CMKs) in the caller's AWS account and -// Region. +// Region. Cross-account use: No. You cannot perform this operation on a CMK in a +// different AWS account. Required permissions: kms:ListKeys +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) Related operations: +// +// * CreateKey +// +// * DescribeKey +// +// * ListAliases +// +// * +// ListResourceTags func (c *Client) ListKeys(ctx context.Context, params *ListKeysInput, optFns ...func(*Options)) (*ListKeysOutput, error) { if params == nil { params = &ListKeysInput{} diff --git a/service/kms/api_op_ListResourceTags.go b/service/kms/api_op_ListResourceTags.go index e6681e29454..5b6de6c91e2 100644 --- a/service/kms/api_op_ListResourceTags.go +++ b/service/kms/api_op_ListResourceTags.go @@ -11,8 +11,20 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a list of all tags for the specified customer master key (CMK). You -// cannot perform this operation on a CMK in a different AWS account. +// Returns all tags on the specified customer master key (CMK). For general +// information about tags, including the format and syntax, see Tagging AWS +// resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in +// the Amazon Web Services General Reference. For information about using tags in +// AWS KMS, see Tagging keys +// (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html). +// Cross-account use: No. You cannot perform this operation on a CMK in a different +// AWS account. Required permissions: kms:ListResourceTags +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// +// * TagResource +// +// * UntagResource func (c *Client) ListResourceTags(ctx context.Context, params *ListResourceTagsInput, optFns ...func(*Options)) (*ListResourceTagsOutput, error) { if params == nil { params = &ListResourceTagsInput{} diff --git a/service/kms/api_op_ListRetirableGrants.go b/service/kms/api_op_ListRetirableGrants.go index 46845250f8b..d761c288dcc 100644 --- a/service/kms/api_op_ListRetirableGrants.go +++ b/service/kms/api_op_ListRetirableGrants.go @@ -11,9 +11,26 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a list of all grants for which the grant's RetiringPrincipal matches the -// one specified. A typical use is to list all grants that you are able to retire. -// To retire a grant, use RetireGrant. +// Returns all grants in which the specified principal is the RetiringPrincipal in +// the grant. You can specify any principal in your AWS account. The grants that +// are returned include grants for CMKs in your AWS account and other AWS accounts. +// You might use this operation to determine which grants you may retire. To retire +// a grant, use the RetireGrant operation. Cross-account use: You must specify a +// principal in your AWS account. However, this operation can return grants in any +// AWS account. You do not need kms:ListRetirableGrants permission (or any other +// additional permission) in any AWS account other than your own. Required +// permissions: kms:ListRetirableGrants +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) in your AWS account. Related operations: +// +// * CreateGrant +// +// * +// ListGrants +// +// * RetireGrant +// +// * RevokeGrant func (c *Client) ListRetirableGrants(ctx context.Context, params *ListRetirableGrantsInput, optFns ...func(*Options)) (*ListRetirableGrantsOutput, error) { if params == nil { params = &ListRetirableGrantsInput{} @@ -31,8 +48,8 @@ func (c *Client) ListRetirableGrants(ctx context.Context, params *ListRetirableG type ListRetirableGrantsInput struct { - // The retiring principal for which to list grants. To specify the retiring - // principal, use the Amazon Resource Name (ARN) + // The retiring principal for which to list grants. Enter a principal in your AWS + // account. To specify the retiring principal, use the Amazon Resource Name (ARN) // (https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html) of // an AWS principal. Valid AWS principals include AWS accounts (root), IAM users, // federated users, and assumed role users. For examples of the ARN syntax for diff --git a/service/kms/api_op_PutKeyPolicy.go b/service/kms/api_op_PutKeyPolicy.go index ea356f5d22a..b4c10f55874 100644 --- a/service/kms/api_op_PutKeyPolicy.go +++ b/service/kms/api_op_PutKeyPolicy.go @@ -10,11 +10,20 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Attaches a key policy to the specified customer master key (CMK). You cannot -// perform this operation on a CMK in a different AWS account. For more information -// about key policies, see Key Policies +// Attaches a key policy to the specified customer master key (CMK). For more +// information about key policies, see Key Policies // (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. For help writing and formatting a +// JSON policy document, see the IAM JSON Policy Reference +// (https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies.html) in +// the IAM User Guide . For examples of adding a key policy in multiple programming +// languages, see Setting a key policy +// (https://docs.aws.amazon.com/kms/latest/developerguide/programming-key-policies.html#put-policy) +// in the AWS Key Management Service Developer Guide. Cross-account use: No. You +// cannot perform this operation on a CMK in a different AWS account. Required +// permissions: kms:PutKeyPolicy +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: GetKeyPolicy func (c *Client) PutKeyPolicy(ctx context.Context, params *PutKeyPolicyInput, optFns ...func(*Options)) (*PutKeyPolicyOutput, error) { if params == nil { params = &PutKeyPolicyInput{} diff --git a/service/kms/api_op_ReEncrypt.go b/service/kms/api_op_ReEncrypt.go index 4361c37c597..a1305362490 100644 --- a/service/kms/api_op_ReEncrypt.go +++ b/service/kms/api_op_ReEncrypt.go @@ -34,49 +34,69 @@ import ( // decrypt operation and the subsequent encrypt operation. // // * If your ciphertext -// was encrypted under an asymmetric CMK, you must identify the source CMK, that -// is, the CMK that encrypted the ciphertext. You must also supply the encryption -// algorithm that was used. This information is required to decrypt the data. +// was encrypted under an asymmetric CMK, you must use the SourceKeyId parameter to +// identify the CMK that encrypted the ciphertext. You must also supply the +// encryption algorithm that was used. This information is required to decrypt the +// data. // -// * It -// is optional, but you can specify a source CMK even when the ciphertext was -// encrypted under a symmetric CMK. This ensures that the ciphertext is decrypted -// only by using a particular CMK. If the CMK that you specify cannot decrypt the -// ciphertext, the ReEncrypt operation fails. +// * If your ciphertext was encrypted under a symmetric CMK, the SourceKeyId +// parameter is optional. AWS KMS can get this information from metadata that it +// adds to the symmetric ciphertext blob. This feature adds durability to your +// implementation by ensuring that authorized users can decrypt ciphertext decades +// after it was encrypted, even if they've lost track of the CMK ID. However, +// specifying the source CMK is always recommended as a best practice. When you use +// the SourceKeyId parameter to specify a CMK, AWS KMS uses only the CMK you +// specify. If the ciphertext was encrypted under a different CMK, the ReEncrypt +// operation fails. This practice ensures that you use the CMK that you intend. // -// * To reencrypt the data, you must -// specify the destination CMK, that is, the CMK that re-encrypts the data after it -// is decrypted. You can select a symmetric or asymmetric CMK. If the destination -// CMK is an asymmetric CMK, you must also provide the encryption algorithm. The -// algorithm that you choose must be compatible with the CMK. When you use an -// asymmetric CMK to encrypt or reencrypt data, be sure to record the CMK and -// encryption algorithm that you choose. You will be required to provide the same -// CMK and encryption algorithm when you decrypt the data. If the CMK and algorithm -// do not match the values used to encrypt the data, the decrypt operation fails. -// You are not required to supply the CMK ID and encryption algorithm when you -// decrypt with symmetric CMKs because AWS KMS stores this information in the -// ciphertext blob. AWS KMS cannot store metadata in ciphertext generated with -// asymmetric keys. The standard format for asymmetric key ciphertext does not -// include configurable fields. +// * +// To reencrypt the data, you must use the DestinationKeyId parameter specify the +// CMK that re-encrypts the data after it is decrypted. You can select a symmetric +// or asymmetric CMK. If the destination CMK is an asymmetric CMK, you must also +// provide the encryption algorithm. The algorithm that you choose must be +// compatible with the CMK. When you use an asymmetric CMK to encrypt or reencrypt +// data, be sure to record the CMK and encryption algorithm that you choose. You +// will be required to provide the same CMK and encryption algorithm when you +// decrypt the data. If the CMK and algorithm do not match the values used to +// encrypt the data, the decrypt operation fails. You are not required to supply +// the CMK ID and encryption algorithm when you decrypt with symmetric CMKs because +// AWS KMS stores this information in the ciphertext blob. AWS KMS cannot store +// metadata in ciphertext generated with asymmetric keys. The standard format for +// asymmetric key ciphertext does not include configurable fields. // -// Unlike other AWS KMS API operations, ReEncrypt -// callers must have two permissions: +// The CMK that +// you use for this operation must be in a compatible key state. For details, see +// How Key State Affects Use of a Customer Master Key +// (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the +// AWS Key Management Service Developer Guide. Cross-account use: Yes. The source +// CMK and destination CMK can be in different AWS accounts. Either or both CMKs +// can be in a different account than the caller. Required permissions: // -// * kms:ReEncryptFrom permission on the source -// CMK +// * +// kms:ReEncryptFrom +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// permission on the source CMK (key policy) // -// * kms:ReEncryptTo permission on the destination CMK +// * kms:ReEncryptTo +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// permission on the destination CMK (key policy) // -// To permit reencryption -// from or to a CMK, include the "kms:ReEncrypt*" permission in your key policy +// To permit reencryption from or +// to a CMK, include the "kms:ReEncrypt*" permission in your key policy // (https://docs.aws.amazon.com/kms/latest/developerguide/key-policies.html). This // permission is automatically included in the key policy when you use the console // to create a CMK. But you must include it manually when you create a CMK // programmatically or when you use the PutKeyPolicy operation to set a key policy. -// The CMK that you use for this operation must be in a compatible key state. For -// details, see How Key State Affects Use of a Customer Master Key -// (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// Related operations: +// +// * Decrypt +// +// * Encrypt +// +// * GenerateDataKey +// +// * +// GenerateDataKeyPair func (c *Client) ReEncrypt(ctx context.Context, params *ReEncryptInput, optFns ...func(*Options)) (*ReEncryptOutput, error) { if params == nil { params = &ReEncryptInput{} @@ -168,21 +188,21 @@ type ReEncryptInput struct { // in the AWS Key Management Service Developer Guide. SourceEncryptionContext map[string]string - // A unique identifier for the CMK that is used to decrypt the ciphertext before it - // reencrypts it using the destination CMK. This parameter is required only when - // the ciphertext was encrypted under an asymmetric CMK. Otherwise, AWS KMS uses - // the metadata that it adds to the ciphertext blob to determine which CMK was used - // to encrypt the ciphertext. However, you can use this parameter to ensure that a - // particular CMK (of any kind) is used to decrypt the ciphertext before it is - // reencrypted. If you specify a KeyId value, the decrypt part of the ReEncrypt - // operation succeeds only if the specified CMK was used to encrypt the ciphertext. - // To specify a CMK, use its key ID, Amazon Resource Name (ARN), alias name, or - // alias ARN. When using an alias name, prefix it with "alias/". For example: + // Specifies the customer master key (CMK) that AWS KMS will use to decrypt the + // ciphertext before it is re-encrypted. Enter a key ID of the CMK that was used to + // encrypt the ciphertext. This parameter is required only when the ciphertext was + // encrypted under an asymmetric CMK. If you used a symmetric CMK, AWS KMS can get + // the CMK from metadata that it adds to the symmetric ciphertext blob. However, it + // is always recommended as a best practice. This practice ensures that you use the + // CMK that you intend. To specify a CMK, use its key ID, Amazon Resource Name + // (ARN), alias name, or alias ARN. When using an alias name, prefix it with + // "alias/". To specify a CMK in a different AWS account, you must use the key ARN + // or alias ARN. For example: // - // * - // Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab // - // * Key ARN: + // * + // Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab // // * diff --git a/service/kms/api_op_RetireGrant.go b/service/kms/api_op_RetireGrant.go index 456ff71c4f6..556d7324245 100644 --- a/service/kms/api_op_RetireGrant.go +++ b/service/kms/api_op_RetireGrant.go @@ -27,7 +27,21 @@ import ( // or by a combination of the grant ID and the Amazon Resource Name (ARN) of the // customer master key (CMK). A grant token is a unique variable-length // base64-encoded string. A grant ID is a 64 character unique identifier of a -// grant. The CreateGrant operation returns both. +// grant. The CreateGrant operation returns both. Cross-account use: Yes. You can +// retire a grant on a CMK in a different AWS account. Required permissions:: +// Permission to retire a grant is specified in the grant. You cannot control +// access to this operation in a policy. For more information, see Using grants +// (https://docs.aws.amazon.com/kms/latest/developerguide/grants.html) in the AWS +// Key Management Service Developer Guide. Related operations: +// +// * CreateGrant +// +// * +// ListGrants +// +// * ListRetirableGrants +// +// * RevokeGrant func (c *Client) RetireGrant(ctx context.Context, params *RetireGrantInput, optFns ...func(*Options)) (*RetireGrantOutput, error) { if params == nil { params = &RetireGrantInput{} diff --git a/service/kms/api_op_RevokeGrant.go b/service/kms/api_op_RevokeGrant.go index bd7adf9f8b2..2bd374affd9 100644 --- a/service/kms/api_op_RevokeGrant.go +++ b/service/kms/api_op_RevokeGrant.go @@ -11,9 +11,21 @@ import ( ) // Revokes the specified grant for the specified customer master key (CMK). You can -// revoke a grant to actively deny operations that depend on it. To perform this -// operation on a CMK in a different AWS account, specify the key ARN in the value -// of the KeyId parameter. +// revoke a grant to actively deny operations that depend on it. Cross-account use: +// Yes. To perform this operation on a CMK in a different AWS account, specify the +// key ARN in the value of the KeyId parameter. Required permissions: +// kms:RevokeGrant +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: +// +// * CreateGrant +// +// * ListGrants +// +// * +// ListRetirableGrants +// +// * RetireGrant func (c *Client) RevokeGrant(ctx context.Context, params *RevokeGrantInput, optFns ...func(*Options)) (*RevokeGrantOutput, error) { if params == nil { params = &RevokeGrantInput{} diff --git a/service/kms/api_op_ScheduleKeyDeletion.go b/service/kms/api_op_ScheduleKeyDeletion.go index 57a37c5e1ba..2219aaf69c6 100644 --- a/service/kms/api_op_ScheduleKeyDeletion.go +++ b/service/kms/api_op_ScheduleKeyDeletion.go @@ -28,15 +28,22 @@ import ( // associated AWS CloudHSM cluster. However, you might need to manually delete the // orphaned key material // (https://docs.aws.amazon.com/kms/latest/developerguide/fix-keystore.html#fix-keystore-orphaned-key) -// from the cluster and its backups. You cannot perform this operation on a CMK in -// a different AWS account. For more information about scheduling a CMK for -// deletion, see Deleting Customer Master Keys +// from the cluster and its backups. For more information about scheduling a CMK +// for deletion, see Deleting Customer Master Keys // (https://docs.aws.amazon.com/kms/latest/developerguide/deleting-keys.html) in // the AWS Key Management Service Developer Guide. The CMK that you use for this // operation must be in a compatible key state. For details, see How Key State // Affects Use of a Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a CMK in a different AWS account. Required +// permissions: kms:ScheduleKeyDeletion +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations +// +// * CancelKeyDeletion +// +// * DisableKey func (c *Client) ScheduleKeyDeletion(ctx context.Context, params *ScheduleKeyDeletionInput, optFns ...func(*Options)) (*ScheduleKeyDeletionOutput, error) { if params == nil { params = &ScheduleKeyDeletionInput{} diff --git a/service/kms/api_op_Sign.go b/service/kms/api_op_Sign.go index 22083892e7d..f721783b14e 100644 --- a/service/kms/api_op_Sign.go +++ b/service/kms/api_op_Sign.go @@ -47,7 +47,11 @@ import ( // KMS. The CMK that you use for this operation must be in a compatible key state. // For details, see How Key State Affects Use of a Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: Yes. To perform +// this operation with a CMK in a different AWS account, specify the key ARN or +// alias ARN in the value of the KeyId parameter. Required permissions: kms:Sign +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: Verify func (c *Client) Sign(ctx context.Context, params *SignInput, optFns ...func(*Options)) (*SignOutput, error) { if params == nil { params = &SignInput{} diff --git a/service/kms/api_op_TagResource.go b/service/kms/api_op_TagResource.go index 6d5b908a747..c2a7bfce673 100644 --- a/service/kms/api_op_TagResource.go +++ b/service/kms/api_op_TagResource.go @@ -11,19 +11,35 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Adds or edits tags for a customer master key (CMK). You cannot perform this -// operation on a CMK in a different AWS account. 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 (null) strings. You can only use a tag key once for each CMK. If you -// use the tag key again, AWS KMS replaces the current tag value with the specified -// value. 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. The CMK that you use for this -// operation must be in a compatible key state. For details, see How Key State -// Affects Use of a Customer Master Key +// Adds or edits tags on a customer managed CMK +// (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk). +// Each tag consists of a tag key and a tag value, both of which are case-sensitive +// strings. The tag value can be an empty (null) string. To add a tag, specify a +// new tag key and a tag value. To edit a tag, specify an existing tag key and a +// new tag value. You can use this operation to tag a customer managed CMK +// (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk), +// but you cannot tag an AWS managed CMK +// (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk), +// an AWS owned CMK +// (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-owned-cmk), +// or an alias. For general information about tags, including the format and +// syntax, see Tagging AWS resources +// (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the Amazon +// Web Services General Reference. For information about using tags in AWS KMS, see +// Tagging keys +// (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html). The +// CMK that you use for this operation must be in a compatible key state. For +// details, see How Key State Affects Use of a Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a CMK in a different AWS account. Required +// permissions: kms:TagResource +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations +// +// * UntagResource +// +// * ListResourceTags func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { params = &TagResourceInput{} @@ -41,8 +57,8 @@ func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optF type TagResourceInput struct { - // A unique identifier for the CMK you are tagging. Specify the key ID or the - // Amazon Resource Name (ARN) of the CMK. For example: + // Identifies a customer managed CMK in the account and Region. Specify the key ID + // or the Amazon Resource Name (ARN) of the CMK. For example: // // * Key ID: // 1234abcd-12ab-34cd-56ef-1234567890ab @@ -56,7 +72,10 @@ type TagResourceInput struct { // This member is required. KeyId *string - // One or more tags. Each tag consists of a tag key and a tag value. + // One or more tags. Each tag consists of a tag key and a tag value. The tag value + // can be an empty (null) string. You cannot have more than one tag on a CMK with + // the same tag key. If you specify an existing tag key with a different tag value, + // AWS KMS replaces the current tag value with the specified one. // // This member is required. Tags []types.Tag diff --git a/service/kms/api_op_UntagResource.go b/service/kms/api_op_UntagResource.go index 6d1a14754a5..9f2b740d2ed 100644 --- a/service/kms/api_op_UntagResource.go +++ b/service/kms/api_op_UntagResource.go @@ -10,13 +10,29 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Removes the specified tags from the specified customer master key (CMK). You -// cannot perform this operation on a CMK in a different AWS account. To remove a -// tag, specify the tag key. To change the tag value of an existing tag key, use -// TagResource. The CMK that you use for this operation must be in a compatible key -// state. For details, see How Key State Affects Use of a Customer Master Key +// Deletes tags from a customer managed CMK +// (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk). +// To delete a tag, specify the tag key and the CMK. When it succeeds, the +// UntagResource operation doesn't return any output. Also, if the specified tag +// key isn't found on the CMK, it doesn't throw an exception or return a response. +// To confirm that the operation worked, use the ListResourceTags operation. For +// general information about tags, including the format and syntax, see Tagging AWS +// resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in +// the Amazon Web Services General Reference. For information about using tags in +// AWS KMS, see Tagging keys +// (https://docs.aws.amazon.com/kms/latest/developerguide/tagging-keys.html). The +// CMK that you use for this operation must be in a compatible key state. For +// details, see How Key State Affects Use of a Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a CMK in a different AWS account. Required +// permissions: kms:UntagResource +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations +// +// * TagResource +// +// * ListResourceTags func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { params = &UntagResourceInput{} @@ -34,8 +50,8 @@ func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, type UntagResourceInput struct { - // A unique identifier for the CMK from which you are removing tags. Specify the - // key ID or the Amazon Resource Name (ARN) of the CMK. For example: + // Identifies the CMK from which you are removing tags. Specify the key ID or the + // Amazon Resource Name (ARN) of the CMK. For example: // // * Key ID: // 1234abcd-12ab-34cd-56ef-1234567890ab diff --git a/service/kms/api_op_UpdateAlias.go b/service/kms/api_op_UpdateAlias.go index fb197bb5f41..5db04aa9125 100644 --- a/service/kms/api_op_UpdateAlias.go +++ b/service/kms/api_op_UpdateAlias.go @@ -13,8 +13,7 @@ import ( // Associates an existing AWS KMS alias with a different customer master key (CMK). // Each alias is associated with only one CMK at a time, although a CMK can have // multiple aliases. The alias and the CMK must be in the same AWS account and -// region. You cannot perform this operation on an alias in a different AWS -// account. The current and new CMK must be the same type (both symmetric or both +// region. The current and new CMK must be the same type (both symmetric or both // asymmetric), and they must have the same key usage (ENCRYPT_DECRYPT or // SIGN_VERIFY). This restriction prevents errors in code that uses aliases. If you // must assign an alias to a different type of CMK, use DeleteAlias to delete the @@ -28,7 +27,32 @@ import ( // compatible key state. For details, see How Key State Affects Use of a Customer // Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a CMK in a different AWS account. Required +// permissions +// +// * kms:UpdateAlias +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the alias (IAM policy). +// +// * kms:UpdateAlias +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the current CMK (key policy). +// +// * kms:UpdateAlias +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// on the new CMK (key policy). +// +// For details, see Controlling access to aliases +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-alias.html#alias-access) +// in the AWS Key Management Service Developer Guide. Related operations: +// +// * +// CreateAlias +// +// * DeleteAlias +// +// * ListAliases func (c *Client) UpdateAlias(ctx context.Context, params *UpdateAliasInput, optFns ...func(*Options)) (*UpdateAliasOutput, error) { if params == nil { params = &UpdateAliasInput{} @@ -53,14 +77,18 @@ type UpdateAliasInput struct { // This member is required. AliasName *string - // Identifies the CMK to associate with the alias. When the update operation - // completes, the alias will point to this CMK. The CMK must be in the same AWS - // account and Region as the alias. Also, the new target CMK must be the same type - // as the current target CMK (both symmetric or both asymmetric) and they must have - // the same key usage. Specify the key ID or the Amazon Resource Name (ARN) of the - // CMK. For example: + // Identifies the customer managed CMK + // (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#customer-cmk) + // to associate with the alias. You don't have permission to associate an alias + // with an AWS managed CMK + // (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#aws-managed-cmk). + // The CMK must be in the same AWS account and Region as the alias. Also, the new + // target CMK must be the same type as the current target CMK (both symmetric or + // both asymmetric) and they must have the same key usage. Specify the key ID or + // the Amazon Resource Name (ARN) of the CMK. For example: // - // * Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab + // * Key ID: + // 1234abcd-12ab-34cd-56ef-1234567890ab // // * Key ARN: // arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab diff --git a/service/kms/api_op_UpdateCustomKeyStore.go b/service/kms/api_op_UpdateCustomKeyStore.go index 80ba6ce8add..e6f6a5d5841 100644 --- a/service/kms/api_op_UpdateCustomKeyStore.go +++ b/service/kms/api_op_UpdateCustomKeyStore.go @@ -44,6 +44,22 @@ import ( // (https://docs.aws.amazon.com/kms/latest/developerguide/custom-key-store-overview.html) // feature in AWS KMS, which combines the convenience and extensive integration of // AWS KMS with the isolation and control of a single-tenant key store. +// Cross-account use: No. You cannot perform this operation on a custom key store +// in a different AWS account. Required permissions: kms:UpdateCustomKeyStore +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (IAM policy) Related operations: +// +// * ConnectCustomKeyStore +// +// * +// CreateCustomKeyStore +// +// * DeleteCustomKeyStore +// +// * DescribeCustomKeyStores +// +// * +// DisconnectCustomKeyStore func (c *Client) UpdateCustomKeyStore(ctx context.Context, params *UpdateCustomKeyStoreInput, optFns ...func(*Options)) (*UpdateCustomKeyStoreOutput, error) { if params == nil { params = &UpdateCustomKeyStoreInput{} diff --git a/service/kms/api_op_UpdateKeyDescription.go b/service/kms/api_op_UpdateKeyDescription.go index c99739cf738..c4349b199b3 100644 --- a/service/kms/api_op_UpdateKeyDescription.go +++ b/service/kms/api_op_UpdateKeyDescription.go @@ -11,12 +11,19 @@ import ( ) // Updates the description of a customer master key (CMK). To see the description -// of a CMK, use DescribeKey. You cannot perform this operation on a CMK in a -// different AWS account. The CMK that you use for this operation must be in a +// of a CMK, use DescribeKey. The CMK that you use for this operation must be in a // compatible key state. For details, see How Key State Affects Use of a Customer // Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: No. You cannot +// perform this operation on a CMK in a different AWS account. Required +// permissions: kms:UpdateKeyDescription +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations +// +// * CreateKey +// +// * DescribeKey func (c *Client) UpdateKeyDescription(ctx context.Context, params *UpdateKeyDescriptionInput, optFns ...func(*Options)) (*UpdateKeyDescriptionOutput, error) { if params == nil { params = &UpdateKeyDescriptionInput{} diff --git a/service/kms/api_op_Verify.go b/service/kms/api_op_Verify.go index d9fdb683978..8e9726809eb 100644 --- a/service/kms/api_op_Verify.go +++ b/service/kms/api_op_Verify.go @@ -34,7 +34,11 @@ import ( // signatures. The CMK that you use for this operation must be in a compatible key // state. For details, see How Key State Affects Use of a Customer Master Key // (https://docs.aws.amazon.com/kms/latest/developerguide/key-state.html) in the -// AWS Key Management Service Developer Guide. +// AWS Key Management Service Developer Guide. Cross-account use: Yes. To perform +// this operation with a CMK in a different AWS account, specify the key ARN or +// alias ARN in the value of the KeyId parameter. Required permissions: kms:Verify +// (https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html) +// (key policy) Related operations: Sign func (c *Client) Verify(ctx context.Context, params *VerifyInput, optFns ...func(*Options)) (*VerifyOutput, error) { if params == nil { params = &VerifyInput{} diff --git a/service/kms/deserializers.go b/service/kms/deserializers.go index 065f29661e1..996f5761329 100644 --- a/service/kms/deserializers.go +++ b/service/kms/deserializers.go @@ -7096,6 +7096,32 @@ func awsAwsjson11_deserializeDocumentAliasListEntry(v **types.AliasListEntry, va sv.AliasName = ptr.String(jtv) } + case "CreationDate": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DateType to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "LastUpdatedDate": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DateType to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + case "TargetKeyId": if value != nil { jtv, ok := value.(string) diff --git a/service/kms/types/types.go b/service/kms/types/types.go index 20433da8a8f..5a1c47a1efe 100644 --- a/service/kms/types/types.go +++ b/service/kms/types/types.go @@ -15,7 +15,15 @@ type AliasListEntry struct { // String that contains the alias. This value begins with alias/. AliasName *string - // String that contains the key identifier referred to by the alias. + // Date and time that the alias was most recently created in the account and + // Region. Formatted as Unix time. + CreationDate *time.Time + + // Date and time that the alias was most recently associated with a CMK in the + // account and Region. Formatted as Unix time. + LastUpdatedDate *time.Time + + // String that contains the key identifier of the CMK associated with the alias. TargetKeyId *string } @@ -130,16 +138,15 @@ type CustomKeyStoresListEntry struct { // (https://docs.aws.amazon.com/kms/latest/developerguide/symm-asymm-concepts.html#symmetric-cmks). // Grant constraints are not applied to operations that do not support an // encryption context, such as cryptographic operations with asymmetric CMKs and -// management operations, such as DescribeKey or ScheduleKeyDeletion. In a -// cryptographic operation, the encryption context in the decryption operation must -// be an exact, case-sensitive match for the keys and values in the encryption -// context of the encryption operation. Only the order of the pairs can vary. -// However, in a grant constraint, the key in each key-value pair is not case -// sensitive, but the value is case sensitive. To avoid confusion, do not use -// multiple encryption context pairs that differ only by case. To require a fully -// case-sensitive encryption context, use the kms:EncryptionContext: and -// kms:EncryptionContextKeys conditions in an IAM or key policy. For details, see -// kms:EncryptionContext: +// management operations, such as DescribeKey or RetireGrant. In a cryptographic +// operation, the encryption context in the decryption operation must be an exact, +// case-sensitive match for the keys and values in the encryption context of the +// encryption operation. Only the order of the pairs can vary. However, in a grant +// constraint, the key in each key-value pair is not case sensitive, but the value +// is case sensitive. To avoid confusion, do not use multiple encryption context +// pairs that differ only by case. To require a fully case-sensitive encryption +// context, use the kms:EncryptionContext: and kms:EncryptionContextKeys conditions +// in an IAM or key policy. For details, see kms:EncryptionContext: // (https://docs.aws.amazon.com/kms/latest/developerguide/policy-conditions.html#conditions-kms-encryption-context) // in the AWS Key Management Service Developer Guide . type GrantConstraints struct { diff --git a/service/lambda/api_op_CreateEventSourceMapping.go b/service/lambda/api_op_CreateEventSourceMapping.go index 96e12ad6498..88778a5238f 100644 --- a/service/lambda/api_op_CreateEventSourceMapping.go +++ b/service/lambda/api_op_CreateEventSourceMapping.go @@ -34,6 +34,10 @@ import ( // Using AWS Lambda with Amazon MSK // (https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html) // +// * Using AWS Lambda +// with Self-Managed Apache Kafka +// (https://docs.aws.amazon.com/lambda/latest/dg/kafka-smaa.html) +// // The following // error handling options are only available for stream sources (DynamoDB and // Kinesis): @@ -72,22 +76,6 @@ func (c *Client) CreateEventSourceMapping(ctx context.Context, params *CreateEve type CreateEventSourceMappingInput struct { - // The Amazon Resource Name (ARN) of the event source. - // - // * Amazon Kinesis - The ARN - // of the data stream or a stream consumer. - // - // * Amazon DynamoDB Streams - The ARN of - // the stream. - // - // * Amazon Simple Queue Service - The ARN of the queue. - // - // * Amazon - // Managed Streaming for Apache Kafka - The ARN of the cluster. - // - // This member is required. - EventSourceArn *string - // The name of the Lambda function. Name formats // // * Function name - MyFunction. @@ -117,10 +105,13 @@ type CreateEventSourceMappingInput struct { // * Amazon DynamoDB Streams - Default 100. Max 1,000. // // * - // Amazon Simple Queue Service - Default 10. Max 10. + // Amazon Simple Queue Service - Default 10. For standard queues the max is 10,000. + // For FIFO queues the max is 10. // - // * Amazon Managed Streaming - // for Apache Kafka - Default 100. Max 10,000. + // * Amazon Managed Streaming for Apache Kafka - + // Default 100. Max 10,000. + // + // * Self-Managed Apache Kafka - Default 100. Max 10,000. BatchSize *int32 // (Streams) If the function returns an error, split the batch in two and retry. @@ -134,8 +125,26 @@ type CreateEventSourceMappingInput struct { // invocation. Enabled *bool - // (Streams) The maximum amount of time to gather records before invoking the - // function, in seconds. + // The Amazon Resource Name (ARN) of the event source. + // + // * Amazon Kinesis - The ARN + // of the data stream or a stream consumer. + // + // * Amazon DynamoDB Streams - The ARN of + // the stream. + // + // * Amazon Simple Queue Service - The ARN of the queue. + // + // * Amazon + // Managed Streaming for Apache Kafka - The ARN of the cluster. + EventSourceArn *string + + // (Streams) A list of current response type enums applied to the event source + // mapping. + FunctionResponseTypes []types.FunctionResponseType + + // (Streams and SQS standard queues) The maximum amount of time to gather records + // before invoking the function, in seconds. MaximumBatchingWindowInSeconds *int32 // (Streams) Discard records older than the specified age. The default value is @@ -153,15 +162,11 @@ type CreateEventSourceMappingInput struct { // (MQ) The name of the Amazon MQ broker destination queue to consume. Queues []string - // (MQ) The Secrets Manager secret that stores your broker credentials. To store - // your secret, use the following format: { "username": "your username", - // "password": "your password" } To reference the secret, use the following format: - // [ { "Type": "BASIC_AUTH", "URI": "secretARN" } ] - // - // The value of Type is always - // BASIC_AUTH. To encrypt the secret, you can use customer or service managed keys. - // When using a customer managed KMS key, the Lambda execution role requires - // kms:Decrypt permissions. + // The Self-Managed Apache Kafka cluster to send records. + SelfManagedEventSource *types.SelfManagedEventSource + + // An array of the authentication protocol, or the VPC components to secure your + // event source. SourceAccessConfigurations []types.SourceAccessConfiguration // The position in a stream from which to start reading. Required for Amazon @@ -172,8 +177,12 @@ type CreateEventSourceMappingInput struct { // With StartingPosition set to AT_TIMESTAMP, the time from which to start reading. StartingPositionTimestamp *time.Time - // (MSK) The name of the Kafka topic. + // The name of the Kafka topic. Topics []string + + // (Streams) The duration of a processing window in seconds. The range is between 1 + // second up to 15 minutes. + TumblingWindowInSeconds *int32 } // A mapping between an AWS resource and an AWS Lambda function. See @@ -197,14 +206,18 @@ type CreateEventSourceMappingOutput struct { // The ARN of the Lambda function. FunctionArn *string + // (Streams) A list of current response type enums applied to the event source + // mapping. + FunctionResponseTypes []types.FunctionResponseType + // The date that the event source mapping was last updated, or its state changed. LastModified *time.Time // The result of the last AWS Lambda invocation of your Lambda function. LastProcessingResult *string - // (Streams) The maximum amount of time to gather records before invoking the - // function, in seconds. The default value is zero. + // (Streams and SQS standard queues) The maximum amount of time to gather records + // before invoking the function, in seconds. The default value is zero. MaximumBatchingWindowInSeconds *int32 // (Streams) Discard records older than the specified age. The default value is @@ -224,15 +237,11 @@ type CreateEventSourceMappingOutput struct { // (MQ) The name of the Amazon MQ broker destination queue to consume. Queues []string - // (MQ) The Secrets Manager secret that stores your broker credentials. To store - // your secret, use the following format: { "username": "your username", - // "password": "your password" } To reference the secret, use the following format: - // [ { "Type": "BASIC_AUTH", "URI": "secretARN" } ] - // - // The value of Type is always - // BASIC_AUTH. To encrypt the secret, you can use customer or service managed keys. - // When using a customer managed KMS key, the Lambda execution role requires - // kms:Decrypt permissions. + // The Self-Managed Apache Kafka cluster for your event source. + SelfManagedEventSource *types.SelfManagedEventSource + + // An array of the authentication protocol, or the VPC components to secure your + // event source. SourceAccessConfigurations []types.SourceAccessConfiguration // The position in a stream from which to start reading. Required for Amazon @@ -251,9 +260,13 @@ type CreateEventSourceMappingOutput struct { // user, or by the Lambda service. StateTransitionReason *string - // (MSK) The name of the Kafka topic to consume. + // The name of the Kafka topic. Topics []string + // (Streams) The duration of a processing window in seconds. The range is between 1 + // second up to 15 minutes. + TumblingWindowInSeconds *int32 + // The identifier of the event source mapping. UUID *string diff --git a/service/lambda/api_op_DeleteEventSourceMapping.go b/service/lambda/api_op_DeleteEventSourceMapping.go index 8017cb5fe01..daca8222382 100644 --- a/service/lambda/api_op_DeleteEventSourceMapping.go +++ b/service/lambda/api_op_DeleteEventSourceMapping.go @@ -61,14 +61,18 @@ type DeleteEventSourceMappingOutput struct { // The ARN of the Lambda function. FunctionArn *string + // (Streams) A list of current response type enums applied to the event source + // mapping. + FunctionResponseTypes []types.FunctionResponseType + // The date that the event source mapping was last updated, or its state changed. LastModified *time.Time // The result of the last AWS Lambda invocation of your Lambda function. LastProcessingResult *string - // (Streams) The maximum amount of time to gather records before invoking the - // function, in seconds. The default value is zero. + // (Streams and SQS standard queues) The maximum amount of time to gather records + // before invoking the function, in seconds. The default value is zero. MaximumBatchingWindowInSeconds *int32 // (Streams) Discard records older than the specified age. The default value is @@ -88,15 +92,11 @@ type DeleteEventSourceMappingOutput struct { // (MQ) The name of the Amazon MQ broker destination queue to consume. Queues []string - // (MQ) The Secrets Manager secret that stores your broker credentials. To store - // your secret, use the following format: { "username": "your username", - // "password": "your password" } To reference the secret, use the following format: - // [ { "Type": "BASIC_AUTH", "URI": "secretARN" } ] - // - // The value of Type is always - // BASIC_AUTH. To encrypt the secret, you can use customer or service managed keys. - // When using a customer managed KMS key, the Lambda execution role requires - // kms:Decrypt permissions. + // The Self-Managed Apache Kafka cluster for your event source. + SelfManagedEventSource *types.SelfManagedEventSource + + // An array of the authentication protocol, or the VPC components to secure your + // event source. SourceAccessConfigurations []types.SourceAccessConfiguration // The position in a stream from which to start reading. Required for Amazon @@ -115,9 +115,13 @@ type DeleteEventSourceMappingOutput struct { // user, or by the Lambda service. StateTransitionReason *string - // (MSK) The name of the Kafka topic to consume. + // The name of the Kafka topic. Topics []string + // (Streams) The duration of a processing window in seconds. The range is between 1 + // second up to 15 minutes. + TumblingWindowInSeconds *int32 + // The identifier of the event source mapping. UUID *string diff --git a/service/lambda/api_op_GetEventSourceMapping.go b/service/lambda/api_op_GetEventSourceMapping.go index 50bc11068cc..8359b8f582b 100644 --- a/service/lambda/api_op_GetEventSourceMapping.go +++ b/service/lambda/api_op_GetEventSourceMapping.go @@ -58,14 +58,18 @@ type GetEventSourceMappingOutput struct { // The ARN of the Lambda function. FunctionArn *string + // (Streams) A list of current response type enums applied to the event source + // mapping. + FunctionResponseTypes []types.FunctionResponseType + // The date that the event source mapping was last updated, or its state changed. LastModified *time.Time // The result of the last AWS Lambda invocation of your Lambda function. LastProcessingResult *string - // (Streams) The maximum amount of time to gather records before invoking the - // function, in seconds. The default value is zero. + // (Streams and SQS standard queues) The maximum amount of time to gather records + // before invoking the function, in seconds. The default value is zero. MaximumBatchingWindowInSeconds *int32 // (Streams) Discard records older than the specified age. The default value is @@ -85,15 +89,11 @@ type GetEventSourceMappingOutput struct { // (MQ) The name of the Amazon MQ broker destination queue to consume. Queues []string - // (MQ) The Secrets Manager secret that stores your broker credentials. To store - // your secret, use the following format: { "username": "your username", - // "password": "your password" } To reference the secret, use the following format: - // [ { "Type": "BASIC_AUTH", "URI": "secretARN" } ] - // - // The value of Type is always - // BASIC_AUTH. To encrypt the secret, you can use customer or service managed keys. - // When using a customer managed KMS key, the Lambda execution role requires - // kms:Decrypt permissions. + // The Self-Managed Apache Kafka cluster for your event source. + SelfManagedEventSource *types.SelfManagedEventSource + + // An array of the authentication protocol, or the VPC components to secure your + // event source. SourceAccessConfigurations []types.SourceAccessConfiguration // The position in a stream from which to start reading. Required for Amazon @@ -112,9 +112,13 @@ type GetEventSourceMappingOutput struct { // user, or by the Lambda service. StateTransitionReason *string - // (MSK) The name of the Kafka topic to consume. + // The name of the Kafka topic. Topics []string + // (Streams) The duration of a processing window in seconds. The range is between 1 + // second up to 15 minutes. + TumblingWindowInSeconds *int32 + // The identifier of the event source mapping. UUID *string diff --git a/service/lambda/api_op_UpdateEventSourceMapping.go b/service/lambda/api_op_UpdateEventSourceMapping.go index 0e36316b012..1867a37c47a 100644 --- a/service/lambda/api_op_UpdateEventSourceMapping.go +++ b/service/lambda/api_op_UpdateEventSourceMapping.go @@ -64,10 +64,13 @@ type UpdateEventSourceMappingInput struct { // * Amazon DynamoDB Streams - Default 100. Max 1,000. // // * - // Amazon Simple Queue Service - Default 10. Max 10. + // Amazon Simple Queue Service - Default 10. For standard queues the max is 10,000. + // For FIFO queues the max is 10. // - // * Amazon Managed Streaming - // for Apache Kafka - Default 100. Max 10,000. + // * Amazon Managed Streaming for Apache Kafka - + // Default 100. Max 10,000. + // + // * Self-Managed Apache Kafka - Default 100. Max 10,000. BatchSize *int32 // (Streams) If the function returns an error, split the batch in two and retry. @@ -100,8 +103,12 @@ type UpdateEventSourceMappingInput struct { // in length. FunctionName *string - // (Streams) The maximum amount of time to gather records before invoking the - // function, in seconds. + // (Streams) A list of current response type enums applied to the event source + // mapping. + FunctionResponseTypes []types.FunctionResponseType + + // (Streams and SQS standard queues) The maximum amount of time to gather records + // before invoking the function, in seconds. MaximumBatchingWindowInSeconds *int32 // (Streams) Discard records older than the specified age. The default value is @@ -116,16 +123,13 @@ type UpdateEventSourceMappingInput struct { // (Streams) The number of batches to process from each shard concurrently. ParallelizationFactor *int32 - // (MQ) The Secrets Manager secret that stores your broker credentials. To store - // your secret, use the following format: { "username": "your username", - // "password": "your password" } To reference the secret, use the following format: - // [ { "Type": "BASIC_AUTH", "URI": "secretARN" } ] - // - // The value of Type is always - // BASIC_AUTH. To encrypt the secret, you can use customer or service managed keys. - // When using a customer managed KMS key, the Lambda execution role requires - // kms:Decrypt permissions. + // An array of the authentication protocol, or the VPC components to secure your + // event source. SourceAccessConfigurations []types.SourceAccessConfiguration + + // (Streams) The duration of a processing window in seconds. The range is between 1 + // second up to 15 minutes. + TumblingWindowInSeconds *int32 } // A mapping between an AWS resource and an AWS Lambda function. See @@ -149,14 +153,18 @@ type UpdateEventSourceMappingOutput struct { // The ARN of the Lambda function. FunctionArn *string + // (Streams) A list of current response type enums applied to the event source + // mapping. + FunctionResponseTypes []types.FunctionResponseType + // The date that the event source mapping was last updated, or its state changed. LastModified *time.Time // The result of the last AWS Lambda invocation of your Lambda function. LastProcessingResult *string - // (Streams) The maximum amount of time to gather records before invoking the - // function, in seconds. The default value is zero. + // (Streams and SQS standard queues) The maximum amount of time to gather records + // before invoking the function, in seconds. The default value is zero. MaximumBatchingWindowInSeconds *int32 // (Streams) Discard records older than the specified age. The default value is @@ -176,15 +184,11 @@ type UpdateEventSourceMappingOutput struct { // (MQ) The name of the Amazon MQ broker destination queue to consume. Queues []string - // (MQ) The Secrets Manager secret that stores your broker credentials. To store - // your secret, use the following format: { "username": "your username", - // "password": "your password" } To reference the secret, use the following format: - // [ { "Type": "BASIC_AUTH", "URI": "secretARN" } ] - // - // The value of Type is always - // BASIC_AUTH. To encrypt the secret, you can use customer or service managed keys. - // When using a customer managed KMS key, the Lambda execution role requires - // kms:Decrypt permissions. + // The Self-Managed Apache Kafka cluster for your event source. + SelfManagedEventSource *types.SelfManagedEventSource + + // An array of the authentication protocol, or the VPC components to secure your + // event source. SourceAccessConfigurations []types.SourceAccessConfiguration // The position in a stream from which to start reading. Required for Amazon @@ -203,9 +207,13 @@ type UpdateEventSourceMappingOutput struct { // user, or by the Lambda service. StateTransitionReason *string - // (MSK) The name of the Kafka topic to consume. + // The name of the Kafka topic. Topics []string + // (Streams) The duration of a processing window in seconds. The range is between 1 + // second up to 15 minutes. + TumblingWindowInSeconds *int32 + // The identifier of the event source mapping. UUID *string diff --git a/service/lambda/deserializers.go b/service/lambda/deserializers.go index 4b5d3f497c3..7d53852931a 100644 --- a/service/lambda/deserializers.go +++ b/service/lambda/deserializers.go @@ -911,6 +911,11 @@ func awsRestjson1_deserializeOpDocumentCreateEventSourceMappingOutput(v **Create sv.FunctionArn = ptr.String(jtv) } + case "FunctionResponseTypes": + if err := awsRestjson1_deserializeDocumentFunctionResponseTypeList(&sv.FunctionResponseTypes, value); err != nil { + return err + } + case "LastModified": if value != nil { jtv, ok := value.(json.Number) @@ -990,6 +995,11 @@ func awsRestjson1_deserializeOpDocumentCreateEventSourceMappingOutput(v **Create return err } + case "SelfManagedEventSource": + if err := awsRestjson1_deserializeDocumentSelfManagedEventSource(&sv.SelfManagedEventSource, value); err != nil { + return err + } + case "SourceAccessConfigurations": if err := awsRestjson1_deserializeDocumentSourceAccessConfigurations(&sv.SourceAccessConfigurations, value); err != nil { return err @@ -1040,6 +1050,19 @@ func awsRestjson1_deserializeOpDocumentCreateEventSourceMappingOutput(v **Create return err } + case "TumblingWindowInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected TumblingWindowInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TumblingWindowInSeconds = ptr.Int32(int32(i64)) + } + case "UUID": if value != nil { jtv, ok := value.(string) @@ -1861,6 +1884,11 @@ func awsRestjson1_deserializeOpDocumentDeleteEventSourceMappingOutput(v **Delete sv.FunctionArn = ptr.String(jtv) } + case "FunctionResponseTypes": + if err := awsRestjson1_deserializeDocumentFunctionResponseTypeList(&sv.FunctionResponseTypes, value); err != nil { + return err + } + case "LastModified": if value != nil { jtv, ok := value.(json.Number) @@ -1940,6 +1968,11 @@ func awsRestjson1_deserializeOpDocumentDeleteEventSourceMappingOutput(v **Delete return err } + case "SelfManagedEventSource": + if err := awsRestjson1_deserializeDocumentSelfManagedEventSource(&sv.SelfManagedEventSource, value); err != nil { + return err + } + case "SourceAccessConfigurations": if err := awsRestjson1_deserializeDocumentSourceAccessConfigurations(&sv.SourceAccessConfigurations, value); err != nil { return err @@ -1990,6 +2023,19 @@ func awsRestjson1_deserializeOpDocumentDeleteEventSourceMappingOutput(v **Delete return err } + case "TumblingWindowInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected TumblingWindowInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TumblingWindowInSeconds = ptr.Int32(int32(i64)) + } + case "UUID": if value != nil { jtv, ok := value.(string) @@ -3265,6 +3311,11 @@ func awsRestjson1_deserializeOpDocumentGetEventSourceMappingOutput(v **GetEventS sv.FunctionArn = ptr.String(jtv) } + case "FunctionResponseTypes": + if err := awsRestjson1_deserializeDocumentFunctionResponseTypeList(&sv.FunctionResponseTypes, value); err != nil { + return err + } + case "LastModified": if value != nil { jtv, ok := value.(json.Number) @@ -3344,6 +3395,11 @@ func awsRestjson1_deserializeOpDocumentGetEventSourceMappingOutput(v **GetEventS return err } + case "SelfManagedEventSource": + if err := awsRestjson1_deserializeDocumentSelfManagedEventSource(&sv.SelfManagedEventSource, value); err != nil { + return err + } + case "SourceAccessConfigurations": if err := awsRestjson1_deserializeDocumentSourceAccessConfigurations(&sv.SourceAccessConfigurations, value); err != nil { return err @@ -3394,6 +3450,19 @@ func awsRestjson1_deserializeOpDocumentGetEventSourceMappingOutput(v **GetEventS return err } + case "TumblingWindowInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected TumblingWindowInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TumblingWindowInSeconds = ptr.Int32(int32(i64)) + } + case "UUID": if value != nil { jtv, ok := value.(string) @@ -9982,6 +10051,11 @@ func awsRestjson1_deserializeOpDocumentUpdateEventSourceMappingOutput(v **Update sv.FunctionArn = ptr.String(jtv) } + case "FunctionResponseTypes": + if err := awsRestjson1_deserializeDocumentFunctionResponseTypeList(&sv.FunctionResponseTypes, value); err != nil { + return err + } + case "LastModified": if value != nil { jtv, ok := value.(json.Number) @@ -10061,6 +10135,11 @@ func awsRestjson1_deserializeOpDocumentUpdateEventSourceMappingOutput(v **Update return err } + case "SelfManagedEventSource": + if err := awsRestjson1_deserializeDocumentSelfManagedEventSource(&sv.SelfManagedEventSource, value); err != nil { + return err + } + case "SourceAccessConfigurations": if err := awsRestjson1_deserializeDocumentSourceAccessConfigurations(&sv.SourceAccessConfigurations, value); err != nil { return err @@ -10111,6 +10190,19 @@ func awsRestjson1_deserializeOpDocumentUpdateEventSourceMappingOutput(v **Update return err } + case "TumblingWindowInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected TumblingWindowInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TumblingWindowInSeconds = ptr.Int32(int32(i64)) + } + case "UUID": if value != nil { jtv, ok := value.(string) @@ -13625,6 +13717,76 @@ func awsRestjson1_deserializeDocumentEFSMountTimeoutException(v **types.EFSMount return nil } +func awsRestjson1_deserializeDocumentEndpointLists(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 Endpoint to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentEndpoints(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 + mapVar := parsedVal + if err := awsRestjson1_deserializeDocumentEndpointLists(&mapVar, value); err != nil { + return err + } + parsedVal = mapVar + mv[key] = parsedVal + + } + *v = mv + return nil +} + func awsRestjson1_deserializeDocumentENILimitReachedException(v **types.ENILimitReachedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13867,6 +14029,11 @@ func awsRestjson1_deserializeDocumentEventSourceMappingConfiguration(v **types.E sv.FunctionArn = ptr.String(jtv) } + case "FunctionResponseTypes": + if err := awsRestjson1_deserializeDocumentFunctionResponseTypeList(&sv.FunctionResponseTypes, value); err != nil { + return err + } + case "LastModified": if value != nil { jtv, ok := value.(json.Number) @@ -13946,6 +14113,11 @@ func awsRestjson1_deserializeDocumentEventSourceMappingConfiguration(v **types.E return err } + case "SelfManagedEventSource": + if err := awsRestjson1_deserializeDocumentSelfManagedEventSource(&sv.SelfManagedEventSource, value); err != nil { + return err + } + case "SourceAccessConfigurations": if err := awsRestjson1_deserializeDocumentSourceAccessConfigurations(&sv.SourceAccessConfigurations, value); err != nil { return err @@ -13996,6 +14168,19 @@ func awsRestjson1_deserializeDocumentEventSourceMappingConfiguration(v **types.E return err } + case "TumblingWindowInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected TumblingWindowInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TumblingWindowInSeconds = ptr.Int32(int32(i64)) + } + case "UUID": if value != nil { jtv, ok := value.(string) @@ -14680,6 +14865,42 @@ func awsRestjson1_deserializeDocumentFunctionList(v *[]types.FunctionConfigurati return nil } +func awsRestjson1_deserializeDocumentFunctionResponseTypeList(v *[]types.FunctionResponseType, 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.FunctionResponseType + if *v == nil { + cv = []types.FunctionResponseType{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FunctionResponseType + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FunctionResponseType to be of type string, got %T instead", value) + } + col = types.FunctionResponseType(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentImageConfig(v **types.ImageConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16435,6 +16656,42 @@ func awsRestjson1_deserializeDocumentSecurityGroupIds(v *[]string, value interfa return nil } +func awsRestjson1_deserializeDocumentSelfManagedEventSource(v **types.SelfManagedEventSource, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.SelfManagedEventSource + if *v == nil { + sv = &types.SelfManagedEventSource{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Endpoints": + if err := awsRestjson1_deserializeDocumentEndpoints(&sv.Endpoints, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentServiceException(v **types.ServiceException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16555,7 +16812,7 @@ func awsRestjson1_deserializeDocumentSourceAccessConfiguration(v **types.SourceA if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + return fmt.Errorf("expected URI to be of type string, got %T instead", value) } sv.URI = ptr.String(jtv) } diff --git a/service/lambda/serializers.go b/service/lambda/serializers.go index bcb52f637a3..4cb5877bc61 100644 --- a/service/lambda/serializers.go +++ b/service/lambda/serializers.go @@ -536,6 +536,13 @@ func awsRestjson1_serializeOpDocumentCreateEventSourceMappingInput(v *CreateEven ok.String(*v.FunctionName) } + if v.FunctionResponseTypes != nil { + ok := object.Key("FunctionResponseTypes") + if err := awsRestjson1_serializeDocumentFunctionResponseTypeList(v.FunctionResponseTypes, ok); err != nil { + return err + } + } + if v.MaximumBatchingWindowInSeconds != nil { ok := object.Key("MaximumBatchingWindowInSeconds") ok.Integer(*v.MaximumBatchingWindowInSeconds) @@ -563,6 +570,13 @@ func awsRestjson1_serializeOpDocumentCreateEventSourceMappingInput(v *CreateEven } } + if v.SelfManagedEventSource != nil { + ok := object.Key("SelfManagedEventSource") + if err := awsRestjson1_serializeDocumentSelfManagedEventSource(v.SelfManagedEventSource, ok); err != nil { + return err + } + } + if v.SourceAccessConfigurations != nil { ok := object.Key("SourceAccessConfigurations") if err := awsRestjson1_serializeDocumentSourceAccessConfigurations(v.SourceAccessConfigurations, ok); err != nil { @@ -587,6 +601,11 @@ func awsRestjson1_serializeOpDocumentCreateEventSourceMappingInput(v *CreateEven } } + if v.TumblingWindowInSeconds != nil { + ok := object.Key("TumblingWindowInSeconds") + ok.Integer(*v.TumblingWindowInSeconds) + } + return nil } @@ -4420,6 +4439,13 @@ func awsRestjson1_serializeOpDocumentUpdateEventSourceMappingInput(v *UpdateEven ok.String(*v.FunctionName) } + if v.FunctionResponseTypes != nil { + ok := object.Key("FunctionResponseTypes") + if err := awsRestjson1_serializeDocumentFunctionResponseTypeList(v.FunctionResponseTypes, ok); err != nil { + return err + } + } + if v.MaximumBatchingWindowInSeconds != nil { ok := object.Key("MaximumBatchingWindowInSeconds") ok.Integer(*v.MaximumBatchingWindowInSeconds) @@ -4447,6 +4473,11 @@ func awsRestjson1_serializeOpDocumentUpdateEventSourceMappingInput(v *UpdateEven } } + if v.TumblingWindowInSeconds != nil { + ok := object.Key("TumblingWindowInSeconds") + ok.Integer(*v.TumblingWindowInSeconds) + } + return nil } @@ -4938,6 +4969,33 @@ func awsRestjson1_serializeDocumentDestinationConfig(v *types.DestinationConfig, return nil } +func awsRestjson1_serializeDocumentEndpointLists(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_serializeDocumentEndpoints(v map[string][]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + if vv := v[key]; vv == nil { + continue + } + if err := awsRestjson1_serializeDocumentEndpointLists(v[key], om); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentEnvironment(v *types.Environment, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5025,6 +5083,17 @@ func awsRestjson1_serializeDocumentFunctionCode(v *types.FunctionCode, value smi return nil } +func awsRestjson1_serializeDocumentFunctionResponseTypeList(v []types.FunctionResponseType, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + func awsRestjson1_serializeDocumentImageConfig(v *types.ImageConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5135,6 +5204,20 @@ func awsRestjson1_serializeDocumentSecurityGroupIds(v []string, value smithyjson return nil } +func awsRestjson1_serializeDocumentSelfManagedEventSource(v *types.SelfManagedEventSource, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Endpoints != nil { + ok := object.Key("Endpoints") + if err := awsRestjson1_serializeDocumentEndpoints(v.Endpoints, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentSigningProfileVersionArns(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() diff --git a/service/lambda/types/enums.go b/service/lambda/types/enums.go index 15ecddc2283..6c9b3adacf3 100644 --- a/service/lambda/types/enums.go +++ b/service/lambda/types/enums.go @@ -20,6 +20,22 @@ func (CodeSigningPolicy) Values() []CodeSigningPolicy { } } +type EndPointType string + +// Enum values for EndPointType +const ( + EndPointTypeKafkaBootstrapServers EndPointType = "KAFKA_BOOTSTRAP_SERVERS" +) + +// Values returns all known values for EndPointType. Note that this can be expanded +// in the future, and so it is only as up to date as the client. The ordering of +// this slice is not guaranteed to be stable across updates. +func (EndPointType) Values() []EndPointType { + return []EndPointType{ + "KAFKA_BOOTSTRAP_SERVERS", + } +} + type EventSourcePosition string // Enum values for EventSourcePosition @@ -40,6 +56,22 @@ func (EventSourcePosition) Values() []EventSourcePosition { } } +type FunctionResponseType string + +// Enum values for FunctionResponseType +const ( + FunctionResponseTypeReportbatchitemfailures FunctionResponseType = "ReportBatchItemFailures" +) + +// Values returns all known values for FunctionResponseType. 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 (FunctionResponseType) Values() []FunctionResponseType { + return []FunctionResponseType{ + "ReportBatchItemFailures", + } +} + type FunctionVersion string // Enum values for FunctionVersion @@ -251,7 +283,11 @@ type SourceAccessType string // Enum values for SourceAccessType const ( - SourceAccessTypeBasicAuth SourceAccessType = "BASIC_AUTH" + SourceAccessTypeBasicAuth SourceAccessType = "BASIC_AUTH" + SourceAccessTypeVpcSubnet SourceAccessType = "VPC_SUBNET" + SourceAccessTypeVpcSecurityGroup SourceAccessType = "VPC_SECURITY_GROUP" + SourceAccessTypeSaslScram512Auth SourceAccessType = "SASL_SCRAM_512_AUTH" + SourceAccessTypeSaslScram256Auth SourceAccessType = "SASL_SCRAM_256_AUTH" ) // Values returns all known values for SourceAccessType. Note that this can be @@ -260,6 +296,10 @@ const ( func (SourceAccessType) Values() []SourceAccessType { return []SourceAccessType{ "BASIC_AUTH", + "VPC_SUBNET", + "VPC_SECURITY_GROUP", + "SASL_SCRAM_512_AUTH", + "SASL_SCRAM_256_AUTH", } } diff --git a/service/lambda/types/types.go b/service/lambda/types/types.go index 3a68deb0b16..96798c28e41 100644 --- a/service/lambda/types/types.go +++ b/service/lambda/types/types.go @@ -208,14 +208,18 @@ type EventSourceMappingConfiguration struct { // The ARN of the Lambda function. FunctionArn *string + // (Streams) A list of current response type enums applied to the event source + // mapping. + FunctionResponseTypes []FunctionResponseType + // The date that the event source mapping was last updated, or its state changed. LastModified *time.Time // The result of the last AWS Lambda invocation of your Lambda function. LastProcessingResult *string - // (Streams) The maximum amount of time to gather records before invoking the - // function, in seconds. The default value is zero. + // (Streams and SQS standard queues) The maximum amount of time to gather records + // before invoking the function, in seconds. The default value is zero. MaximumBatchingWindowInSeconds *int32 // (Streams) Discard records older than the specified age. The default value is @@ -235,15 +239,11 @@ type EventSourceMappingConfiguration struct { // (MQ) The name of the Amazon MQ broker destination queue to consume. Queues []string - // (MQ) The Secrets Manager secret that stores your broker credentials. To store - // your secret, use the following format: { "username": "your username", - // "password": "your password" } To reference the secret, use the following format: - // [ { "Type": "BASIC_AUTH", "URI": "secretARN" } ] - // - // The value of Type is always - // BASIC_AUTH. To encrypt the secret, you can use customer or service managed keys. - // When using a customer managed KMS key, the Lambda execution role requires - // kms:Decrypt permissions. + // The Self-Managed Apache Kafka cluster for your event source. + SelfManagedEventSource *SelfManagedEventSource + + // An array of the authentication protocol, or the VPC components to secure your + // event source. SourceAccessConfigurations []SourceAccessConfiguration // The position in a stream from which to start reading. Required for Amazon @@ -262,9 +262,13 @@ type EventSourceMappingConfiguration struct { // user, or by the Lambda service. StateTransitionReason *string - // (MSK) The name of the Kafka topic to consume. + // The name of the Kafka topic. Topics []string + // (Streams) The duration of a processing window in seconds. The range is between 1 + // second up to 15 minutes. + TumblingWindowInSeconds *int32 + // The identifier of the event source mapping. UUID *string } @@ -458,9 +462,9 @@ type FunctionEventInvokeConfig struct { MaximumRetryAttempts *int32 } -// Configuration values that override the container image Dockerfile. See Override +// Configuration values that override the container image Dockerfile settings. See // Container settings -// (https://docs.aws.amazon.com/lambda/latest/dg/configuration-images-settings.html). +// (https://docs.aws.amazon.com/lambda/latest/dg/images-parms.html). type ImageConfig struct { // Specifies parameters that you want to pass in with ENTRYPOINT. @@ -630,21 +634,41 @@ type ProvisionedConcurrencyConfigListItem struct { StatusReason *string } -// (MQ) The Secrets Manager secret that stores your broker credentials. To store -// your secret, use the following format: { "username": "your username", -// "password": "your password" } +// The Self-Managed Apache Kafka cluster for your event source. +type SelfManagedEventSource struct { + + // The list of bootstrap servers for your Kafka brokers in the following format: + // "KAFKA_BOOTSTRAP_SERVERS": ["abc.xyz.com:xxxx","abc2.xyz.com:xxxx"]. + Endpoints map[string][]string +} + +// You can specify the authentication protocol, or the VPC components to secure +// access to your event source. type SourceAccessConfiguration struct { - // To reference the secret, use the following format: [ { "Type": "BASIC_AUTH", - // "URI": "secretARN" } ] The value of Type is always BASIC_AUTH. To encrypt the - // secret, you can use customer or service managed keys. When using a customer - // managed KMS key, the Lambda execution role requires kms:Decrypt permissions. + // The type of authentication protocol or the VPC components for your event source. + // For example: "Type":"SASL_SCRAM_512_AUTH". + // + // * BASIC_AUTH - (MQ) The Secrets + // Manager secret that stores your broker credentials. + // + // * VPC_SUBNET - The subnets + // associated with your VPC. Lambda connects to these subnets to fetch data from + // your Kafka cluster. + // + // * VPC_SECURITY_GROUP - The VPC security group used to + // manage access to your Kafka brokers. + // + // * SASL_SCRAM_256_AUTH - The ARN of your + // secret key used for SASL SCRAM-256 authentication of your Kafka brokers. + // + // * + // SASL_SCRAM_512_AUTH - The ARN of your secret key used for SASL SCRAM-512 + // authentication of your Kafka brokers. Type SourceAccessType - // To reference the secret, use the following format: [ { "Type": "BASIC_AUTH", - // "URI": "secretARN" } ] The value of Type is always BASIC_AUTH. To encrypt the - // secret, you can use customer or service managed keys. When using a customer - // managed KMS key, the Lambda execution role requires kms:Decrypt permissions. + // The value for your chosen configuration in Type. For example: "URI": + // "arn:aws:secretsmanager:us-east-1:01234567890:secret:MyBrokerSecretName". URI *string } diff --git a/service/lambda/validators.go b/service/lambda/validators.go index e0eb28d130b..3a170f5999c 100644 --- a/service/lambda/validators.go +++ b/service/lambda/validators.go @@ -1425,9 +1425,6 @@ func validateOpCreateEventSourceMappingInput(v *CreateEventSourceMappingInput) e return nil } invalidParams := smithy.InvalidParamsError{Context: "CreateEventSourceMappingInput"} - if v.EventSourceArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("EventSourceArn")) - } if v.FunctionName == nil { invalidParams.Add(smithy.NewErrParamRequired("FunctionName")) } diff --git a/service/managedblockchain/api_op_CreateMember.go b/service/managedblockchain/api_op_CreateMember.go index e9d9b7b42fa..2991840038f 100644 --- a/service/managedblockchain/api_op_CreateMember.go +++ b/service/managedblockchain/api_op_CreateMember.go @@ -12,7 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a member within a Managed Blockchain network. +// Creates a member within a Managed Blockchain network. Applies only to +// Hyperledger Fabric. func (c *Client) CreateMember(ctx context.Context, params *CreateMemberInput, optFns ...func(*Options)) (*CreateMemberOutput, error) { if params == nil { params = &CreateMemberInput{} diff --git a/service/managedblockchain/api_op_CreateNetwork.go b/service/managedblockchain/api_op_CreateNetwork.go index e503844aeb8..7e44b247fce 100644 --- a/service/managedblockchain/api_op_CreateNetwork.go +++ b/service/managedblockchain/api_op_CreateNetwork.go @@ -12,7 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a new blockchain network using Amazon Managed Blockchain. +// Creates a new blockchain network using Amazon Managed Blockchain. Applies only +// to Hyperledger Fabric. func (c *Client) CreateNetwork(ctx context.Context, params *CreateNetworkInput, optFns ...func(*Options)) (*CreateNetworkOutput, error) { if params == nil { params = &CreateNetworkInput{} diff --git a/service/managedblockchain/api_op_CreateNode.go b/service/managedblockchain/api_op_CreateNode.go index 865806519aa..70abbc544a8 100644 --- a/service/managedblockchain/api_op_CreateNode.go +++ b/service/managedblockchain/api_op_CreateNode.go @@ -12,7 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a peer node in a member. +// Creates a node on the specified blockchain network. Applies to Hyperledger +// Fabric and Ethereum. func (c *Client) CreateNode(ctx context.Context, params *CreateNodeInput, optFns ...func(*Options)) (*CreateNodeOutput, error) { if params == nil { params = &CreateNodeInput{} @@ -38,12 +39,15 @@ type CreateNodeInput struct { // This member is required. ClientRequestToken *string - // The unique identifier of the member that owns this node. + // The unique identifier of the network for the node. Ethereum public networks have + // the following NetworkIds: // - // This member is required. - MemberId *string - - // The unique identifier of the network in which this node runs. + // * n-ethereum-mainnet + // + // * n-ethereum-rinkeby + // + // * + // n-ethereum-ropsten // // This member is required. NetworkId *string @@ -52,6 +56,10 @@ type CreateNodeInput struct { // // This member is required. NodeConfiguration *types.NodeConfiguration + + // The unique identifier of the member that owns this node. Applies only to + // Hyperledger Fabric. + MemberId *string } type CreateNodeOutput struct { diff --git a/service/managedblockchain/api_op_CreateProposal.go b/service/managedblockchain/api_op_CreateProposal.go index aed71d7b230..6e2ae5239e7 100644 --- a/service/managedblockchain/api_op_CreateProposal.go +++ b/service/managedblockchain/api_op_CreateProposal.go @@ -14,7 +14,7 @@ import ( // Creates a proposal for a change to the network that other members of the network // can vote on, for example, a proposal to add a new member to the network. Any -// member can create a proposal. +// member can create a proposal. Applies only to Hyperledger Fabric. func (c *Client) CreateProposal(ctx context.Context, params *CreateProposalInput, optFns ...func(*Options)) (*CreateProposalOutput, error) { if params == nil { params = &CreateProposalInput{} diff --git a/service/managedblockchain/api_op_DeleteMember.go b/service/managedblockchain/api_op_DeleteMember.go index 4662ae899c6..baf92c1b522 100644 --- a/service/managedblockchain/api_op_DeleteMember.go +++ b/service/managedblockchain/api_op_DeleteMember.go @@ -16,7 +16,7 @@ import ( // account that owns the member. In all other cases, the DeleteMember action is // carried out as the result of an approved proposal to remove a member. If // MemberId is the last member in a network specified by the last AWS account, the -// network is deleted also. +// network is deleted also. Applies only to Hyperledger Fabric. func (c *Client) DeleteMember(ctx context.Context, params *DeleteMemberInput, optFns ...func(*Options)) (*DeleteMemberOutput, error) { if params == nil { params = &DeleteMemberInput{} diff --git a/service/managedblockchain/api_op_DeleteNode.go b/service/managedblockchain/api_op_DeleteNode.go index 39ded1f4c6b..4814b8add19 100644 --- a/service/managedblockchain/api_op_DeleteNode.go +++ b/service/managedblockchain/api_op_DeleteNode.go @@ -10,8 +10,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes a peer node from a member that your AWS account owns. All data on the -// node is lost and cannot be recovered. +// Deletes a node that your AWS account owns. All data on the node is lost and +// cannot be recovered. Applies to Hyperledger Fabric and Ethereum. func (c *Client) DeleteNode(ctx context.Context, params *DeleteNodeInput, optFns ...func(*Options)) (*DeleteNodeOutput, error) { if params == nil { params = &DeleteNodeInput{} @@ -29,12 +29,15 @@ func (c *Client) DeleteNode(ctx context.Context, params *DeleteNodeInput, optFns type DeleteNodeInput struct { - // The unique identifier of the member that owns this node. + // The unique identifier of the network that the node is on. Ethereum public + // networks have the following NetworkIds: // - // This member is required. - MemberId *string - - // The unique identifier of the network that the node belongs to. + // * n-ethereum-mainnet + // + // * + // n-ethereum-rinkeby + // + // * n-ethereum-ropsten // // This member is required. NetworkId *string @@ -43,6 +46,10 @@ type DeleteNodeInput struct { // // This member is required. NodeId *string + + // The unique identifier of the member that owns this node. Applies only to + // Hyperledger Fabric and is required for Hyperledger Fabric. + MemberId *string } type DeleteNodeOutput struct { diff --git a/service/managedblockchain/api_op_GetMember.go b/service/managedblockchain/api_op_GetMember.go index 46abe733d1e..bff7742ed3c 100644 --- a/service/managedblockchain/api_op_GetMember.go +++ b/service/managedblockchain/api_op_GetMember.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns detailed information about a member. +// Returns detailed information about a member. Applies only to Hyperledger Fabric. func (c *Client) GetMember(ctx context.Context, params *GetMemberInput, optFns ...func(*Options)) (*GetMemberOutput, error) { if params == nil { params = &GetMemberInput{} diff --git a/service/managedblockchain/api_op_GetNetwork.go b/service/managedblockchain/api_op_GetNetwork.go index c373ae345c4..72e558d3363 100644 --- a/service/managedblockchain/api_op_GetNetwork.go +++ b/service/managedblockchain/api_op_GetNetwork.go @@ -11,7 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns detailed information about a network. +// Returns detailed information about a network. Applies to Hyperledger Fabric and +// Ethereum. func (c *Client) GetNetwork(ctx context.Context, params *GetNetworkInput, optFns ...func(*Options)) (*GetNetworkOutput, error) { if params == nil { params = &GetNetworkInput{} diff --git a/service/managedblockchain/api_op_GetNode.go b/service/managedblockchain/api_op_GetNode.go index e3a9d310890..5db53f2c351 100644 --- a/service/managedblockchain/api_op_GetNode.go +++ b/service/managedblockchain/api_op_GetNode.go @@ -11,7 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns detailed information about a peer node. +// Returns detailed information about a node. Applies to Hyperledger Fabric and +// Ethereum. func (c *Client) GetNode(ctx context.Context, params *GetNodeInput, optFns ...func(*Options)) (*GetNodeOutput, error) { if params == nil { params = &GetNodeInput{} @@ -29,12 +30,7 @@ func (c *Client) GetNode(ctx context.Context, params *GetNodeInput, optFns ...fu type GetNodeInput struct { - // The unique identifier of the member that owns the node. - // - // This member is required. - MemberId *string - - // The unique identifier of the network to which the node belongs. + // The unique identifier of the network that the node is on. // // This member is required. NetworkId *string @@ -43,6 +39,10 @@ type GetNodeInput struct { // // This member is required. NodeId *string + + // The unique identifier of the member that owns the node. Applies only to + // Hyperledger Fabric and is required for Hyperledger Fabric. + MemberId *string } type GetNodeOutput struct { diff --git a/service/managedblockchain/api_op_GetProposal.go b/service/managedblockchain/api_op_GetProposal.go index a2fe1abc678..e4658083557 100644 --- a/service/managedblockchain/api_op_GetProposal.go +++ b/service/managedblockchain/api_op_GetProposal.go @@ -11,7 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns detailed information about a proposal. +// Returns detailed information about a proposal. Applies only to Hyperledger +// Fabric. func (c *Client) GetProposal(ctx context.Context, params *GetProposalInput, optFns ...func(*Options)) (*GetProposalOutput, error) { if params == nil { params = &GetProposalInput{} diff --git a/service/managedblockchain/api_op_ListInvitations.go b/service/managedblockchain/api_op_ListInvitations.go index cd4d03c931b..67830be424e 100644 --- a/service/managedblockchain/api_op_ListInvitations.go +++ b/service/managedblockchain/api_op_ListInvitations.go @@ -12,7 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a listing of all invitations for the current AWS account. +// Returns a list of all invitations for the current AWS account. Applies only to +// Hyperledger Fabric. func (c *Client) ListInvitations(ctx context.Context, params *ListInvitationsInput, optFns ...func(*Options)) (*ListInvitationsOutput, error) { if params == nil { params = &ListInvitationsInput{} diff --git a/service/managedblockchain/api_op_ListMembers.go b/service/managedblockchain/api_op_ListMembers.go index 48c2c350611..6c7ce89f397 100644 --- a/service/managedblockchain/api_op_ListMembers.go +++ b/service/managedblockchain/api_op_ListMembers.go @@ -12,8 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a listing of the members in a network and properties of their -// configurations. +// Returns a list of the members in a network and properties of their +// configurations. Applies only to Hyperledger Fabric. func (c *Client) ListMembers(ctx context.Context, params *ListMembersInput, optFns ...func(*Options)) (*ListMembersOutput, error) { if params == nil { params = &ListMembersInput{} diff --git a/service/managedblockchain/api_op_ListNetworks.go b/service/managedblockchain/api_op_ListNetworks.go index e681818dd05..c708f5fb02e 100644 --- a/service/managedblockchain/api_op_ListNetworks.go +++ b/service/managedblockchain/api_op_ListNetworks.go @@ -12,8 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns information about the networks in which the current AWS account has -// members. +// Returns information about the networks in which the current AWS account +// participates. Applies to Hyperledger Fabric and Ethereum. func (c *Client) ListNetworks(ctx context.Context, params *ListNetworksInput, optFns ...func(*Options)) (*ListNetworksOutput, error) { if params == nil { params = &ListNetworksInput{} @@ -45,7 +45,7 @@ type ListNetworksInput struct { NextToken *string // An optional status specifier. If provided, only networks currently in this - // status are listed. + // status are listed. Applies only to Hyperledger Fabric. Status types.NetworkStatus } diff --git a/service/managedblockchain/api_op_ListNodes.go b/service/managedblockchain/api_op_ListNodes.go index 2bc5f2e22d9..a3fb4b5d87d 100644 --- a/service/managedblockchain/api_op_ListNodes.go +++ b/service/managedblockchain/api_op_ListNodes.go @@ -12,7 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns information about the nodes within a network. +// Returns information about the nodes within a network. Applies to Hyperledger +// Fabric and Ethereum. func (c *Client) ListNodes(ctx context.Context, params *ListNodesInput, optFns ...func(*Options)) (*ListNodesOutput, error) { if params == nil { params = &ListNodesInput{} @@ -30,11 +31,6 @@ func (c *Client) ListNodes(ctx context.Context, params *ListNodesInput, optFns . type ListNodesInput struct { - // The unique identifier of the member who owns the nodes to list. - // - // This member is required. - MemberId *string - // The unique identifier of the network for which to list nodes. // // This member is required. @@ -43,6 +39,10 @@ type ListNodesInput struct { // The maximum number of nodes to list. MaxResults *int32 + // The unique identifier of the member who owns the nodes to list. Applies only to + // Hyperledger Fabric and is required for Hyperledger Fabric. + MemberId *string + // The pagination token that indicates the next set of results to retrieve. NextToken *string diff --git a/service/managedblockchain/api_op_ListProposalVotes.go b/service/managedblockchain/api_op_ListProposalVotes.go index 087b86aba48..1725cf2fe2d 100644 --- a/service/managedblockchain/api_op_ListProposalVotes.go +++ b/service/managedblockchain/api_op_ListProposalVotes.go @@ -12,8 +12,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns the listing of votes for a specified proposal, including the value of -// each vote and the unique identifier of the member that cast the vote. +// Returns the list of votes for a specified proposal, including the value of each +// vote and the unique identifier of the member that cast the vote. Applies only to +// Hyperledger Fabric. func (c *Client) ListProposalVotes(ctx context.Context, params *ListProposalVotesInput, optFns ...func(*Options)) (*ListProposalVotesOutput, error) { if params == nil { params = &ListProposalVotesInput{} @@ -53,7 +54,7 @@ type ListProposalVotesOutput struct { // The pagination token that indicates the next set of results to retrieve. NextToken *string - // The listing of votes. + // The list of votes. ProposalVotes []types.VoteSummary // Metadata pertaining to the operation's result. diff --git a/service/managedblockchain/api_op_ListProposals.go b/service/managedblockchain/api_op_ListProposals.go index 514933b449a..cf915f93a5a 100644 --- a/service/managedblockchain/api_op_ListProposals.go +++ b/service/managedblockchain/api_op_ListProposals.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a listing of proposals for the network. +// Returns a list of proposals for the network. Applies only to Hyperledger Fabric. func (c *Client) ListProposals(ctx context.Context, params *ListProposalsInput, optFns ...func(*Options)) (*ListProposalsOutput, error) { if params == nil { params = &ListProposalsInput{} diff --git a/service/managedblockchain/api_op_RejectInvitation.go b/service/managedblockchain/api_op_RejectInvitation.go index b5ecdb69f7e..4966b37de35 100644 --- a/service/managedblockchain/api_op_RejectInvitation.go +++ b/service/managedblockchain/api_op_RejectInvitation.go @@ -12,7 +12,7 @@ import ( // Rejects an invitation to join a network. This action can be called by a // principal in an AWS account that has received an invitation to create a member -// and join a network. +// and join a network. Applies only to Hyperledger Fabric. func (c *Client) RejectInvitation(ctx context.Context, params *RejectInvitationInput, optFns ...func(*Options)) (*RejectInvitationOutput, error) { if params == nil { params = &RejectInvitationInput{} diff --git a/service/managedblockchain/api_op_UpdateMember.go b/service/managedblockchain/api_op_UpdateMember.go index 4c81d59ec2d..84468b3ba18 100644 --- a/service/managedblockchain/api_op_UpdateMember.go +++ b/service/managedblockchain/api_op_UpdateMember.go @@ -11,7 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Updates a member configuration with new parameters. +// Updates a member configuration with new parameters. Applies only to Hyperledger +// Fabric. func (c *Client) UpdateMember(ctx context.Context, params *UpdateMemberInput, optFns ...func(*Options)) (*UpdateMemberOutput, error) { if params == nil { params = &UpdateMemberInput{} @@ -29,12 +30,13 @@ func (c *Client) UpdateMember(ctx context.Context, params *UpdateMemberInput, op type UpdateMemberInput struct { - // The unique ID of the member. + // The unique identifier of the member. // // This member is required. MemberId *string - // The unique ID of the Managed Blockchain network to which the member belongs. + // The unique identifier of the Managed Blockchain network to which the member + // belongs. // // This member is required. NetworkId *string diff --git a/service/managedblockchain/api_op_UpdateNode.go b/service/managedblockchain/api_op_UpdateNode.go index eca8c561df5..34279880e9e 100644 --- a/service/managedblockchain/api_op_UpdateNode.go +++ b/service/managedblockchain/api_op_UpdateNode.go @@ -11,7 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Updates a node configuration with new parameters. +// Updates a node configuration with new parameters. Applies only to Hyperledger +// Fabric. func (c *Client) UpdateNode(ctx context.Context, params *UpdateNodeInput, optFns ...func(*Options)) (*UpdateNodeOutput, error) { if params == nil { params = &UpdateNodeInput{} @@ -29,23 +30,22 @@ func (c *Client) UpdateNode(ctx context.Context, params *UpdateNodeInput, optFns type UpdateNodeInput struct { - // The unique ID of the member that owns the node. - // - // This member is required. - MemberId *string - - // The unique ID of the Managed Blockchain network to which the node belongs. + // The unique identifier of the network that the node is on. // // This member is required. NetworkId *string - // The unique ID of the node. + // The unique identifier of the node. // // This member is required. NodeId *string // Configuration properties for publishing to Amazon CloudWatch Logs. LogPublishingConfiguration *types.NodeLogPublishingConfiguration + + // The unique identifier of the member that owns the node. Applies only to + // Hyperledger Fabric. + MemberId *string } type UpdateNodeOutput struct { diff --git a/service/managedblockchain/api_op_VoteOnProposal.go b/service/managedblockchain/api_op_VoteOnProposal.go index 4f8e2930837..5d7b625fcc7 100644 --- a/service/managedblockchain/api_op_VoteOnProposal.go +++ b/service/managedblockchain/api_op_VoteOnProposal.go @@ -13,7 +13,7 @@ import ( // Casts a vote for a specified ProposalId on behalf of a member. The member to // vote as, specified by VoterMemberId, must be in the same AWS account as the -// principal that calls the action. +// principal that calls the action. Applies only to Hyperledger Fabric. func (c *Client) VoteOnProposal(ctx context.Context, params *VoteOnProposalInput, optFns ...func(*Options)) (*VoteOnProposalOutput, error) { if params == nil { params = &VoteOnProposalInput{} diff --git a/service/managedblockchain/deserializers.go b/service/managedblockchain/deserializers.go index 9236ef2b907..f1d14607774 100644 --- a/service/managedblockchain/deserializers.go +++ b/service/managedblockchain/deserializers.go @@ -2923,6 +2923,37 @@ func awsRestjson1_deserializeOpErrorVoteOnProposal(response *smithyhttp.Response 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 } @@ -3174,6 +3205,15 @@ func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDenie 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 @@ -4120,6 +4160,46 @@ func awsRestjson1_deserializeDocumentNetwork(v **types.Network, value interface{ return nil } +func awsRestjson1_deserializeDocumentNetworkEthereumAttributes(v **types.NetworkEthereumAttributes, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.NetworkEthereumAttributes + if *v == nil { + sv = &types.NetworkEthereumAttributes{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ChainId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ChainId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentNetworkFabricAttributes(v **types.NetworkFabricAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4191,6 +4271,11 @@ func awsRestjson1_deserializeDocumentNetworkFrameworkAttributes(v **types.Networ for key, value := range shape { switch key { + case "Ethereum": + if err := awsRestjson1_deserializeDocumentNetworkEthereumAttributes(&sv.Ethereum, value); err != nil { + return err + } + case "Fabric": if err := awsRestjson1_deserializeDocumentNetworkFabricAttributes(&sv.Fabric, value); err != nil { return err @@ -4454,6 +4539,55 @@ func awsRestjson1_deserializeDocumentNode(v **types.Node, value interface{}) err return nil } +func awsRestjson1_deserializeDocumentNodeEthereumAttributes(v **types.NodeEthereumAttributes, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.NodeEthereumAttributes + if *v == nil { + sv = &types.NodeEthereumAttributes{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "HttpEndpoint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.HttpEndpoint = ptr.String(jtv) + } + + case "WebSocketEndpoint": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.WebSocketEndpoint = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentNodeFabricAttributes(v **types.NodeFabricAttributes, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4566,6 +4700,11 @@ func awsRestjson1_deserializeDocumentNodeFrameworkAttributes(v **types.NodeFrame for key, value := range shape { switch key { + case "Ethereum": + if err := awsRestjson1_deserializeDocumentNodeEthereumAttributes(&sv.Ethereum, value); err != nil { + return err + } + case "Fabric": if err := awsRestjson1_deserializeDocumentNodeFabricAttributes(&sv.Fabric, value); err != nil { return err diff --git a/service/managedblockchain/doc.go b/service/managedblockchain/doc.go index 594fe3dfbfd..ad6a2d877eb 100644 --- a/service/managedblockchain/doc.go +++ b/service/managedblockchain/doc.go @@ -4,9 +4,15 @@ // types for Amazon Managed Blockchain. // // Amazon Managed Blockchain is a fully managed service for creating and managing -// blockchain networks using open source frameworks. Blockchain allows you to build +// blockchain networks using open-source frameworks. Blockchain allows you to build // applications where multiple parties can securely and transparently run // transactions and share data without the need for a trusted, central authority. -// Currently, Managed Blockchain supports the Hyperledger Fabric open source -// framework. +// Managed Blockchain supports the Hyperledger Fabric and Ethereum open-source +// frameworks. Because of fundamental differences between the frameworks, some API +// actions or data types may only apply in the context of one framework and not the +// other. For example, actions related to Hyperledger Fabric network members such +// as CreateMember and DeleteMember do not apply to Ethereum. The description for +// each action indicates the framework or frameworks to which it applies. Data +// types and properties that apply only in the context of a particular framework +// are similarly indicated. package managedblockchain diff --git a/service/managedblockchain/serializers.go b/service/managedblockchain/serializers.go index f7595da4f0a..7d5511f540e 100644 --- a/service/managedblockchain/serializers.go +++ b/service/managedblockchain/serializers.go @@ -247,7 +247,7 @@ func (m *awsRestjson1_serializeOpCreateNode) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/members/{MemberId}/nodes") + opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/nodes") request.URL.Path = opPath if len(request.URL.RawQuery) > 0 { request.URL.RawQuery = "&" + opQuery @@ -288,15 +288,6 @@ func awsRestjson1_serializeOpHttpBindingsCreateNodeInput(v *CreateNodeInput, enc return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.MemberId == nil || len(*v.MemberId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member MemberId must not be empty")} - } - if v.MemberId != nil { - if err := encoder.SetURI("MemberId").String(*v.MemberId); err != nil { - return err - } - } - if v.NetworkId == nil || len(*v.NetworkId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NetworkId must not be empty")} } @@ -318,6 +309,11 @@ func awsRestjson1_serializeOpDocumentCreateNodeInput(v *CreateNodeInput, value s ok.String(*v.ClientRequestToken) } + if v.MemberId != nil { + ok := object.Key("MemberId") + ok.String(*v.MemberId) + } + if v.NodeConfiguration != nil { ok := object.Key("NodeConfiguration") if err := awsRestjson1_serializeDocumentNodeConfiguration(v.NodeConfiguration, ok); err != nil { @@ -524,7 +520,7 @@ func (m *awsRestjson1_serializeOpDeleteNode) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/members/{MemberId}/nodes/{NodeId}") + opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/nodes/{NodeId}") request.URL.Path = opPath if len(request.URL.RawQuery) > 0 { request.URL.RawQuery = "&" + opQuery @@ -554,13 +550,8 @@ func awsRestjson1_serializeOpHttpBindingsDeleteNodeInput(v *DeleteNodeInput, enc return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.MemberId == nil || len(*v.MemberId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member MemberId must not be empty")} - } if v.MemberId != nil { - if err := encoder.SetURI("MemberId").String(*v.MemberId); err != nil { - return err - } + encoder.SetQuery("memberId").String(*v.MemberId) } if v.NetworkId == nil || len(*v.NetworkId) == 0 { @@ -740,7 +731,7 @@ func (m *awsRestjson1_serializeOpGetNode) HandleSerialize(ctx context.Context, i return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/members/{MemberId}/nodes/{NodeId}") + opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/nodes/{NodeId}") request.URL.Path = opPath if len(request.URL.RawQuery) > 0 { request.URL.RawQuery = "&" + opQuery @@ -770,13 +761,8 @@ func awsRestjson1_serializeOpHttpBindingsGetNodeInput(v *GetNodeInput, encoder * return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.MemberId == nil || len(*v.MemberId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member MemberId must not be empty")} - } if v.MemberId != nil { - if err := encoder.SetURI("MemberId").String(*v.MemberId); err != nil { - return err - } + encoder.SetQuery("memberId").String(*v.MemberId) } if v.NetworkId == nil || len(*v.NetworkId) == 0 { @@ -1112,7 +1098,7 @@ func (m *awsRestjson1_serializeOpListNodes) HandleSerialize(ctx context.Context, return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/members/{MemberId}/nodes") + opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/nodes") request.URL.Path = opPath if len(request.URL.RawQuery) > 0 { request.URL.RawQuery = "&" + opQuery @@ -1146,13 +1132,8 @@ func awsRestjson1_serializeOpHttpBindingsListNodesInput(v *ListNodesInput, encod encoder.SetQuery("maxResults").Integer(*v.MaxResults) } - if v.MemberId == nil || len(*v.MemberId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member MemberId must not be empty")} - } if v.MemberId != nil { - if err := encoder.SetURI("MemberId").String(*v.MemberId); err != nil { - return err - } + encoder.SetQuery("memberId").String(*v.MemberId) } if v.NetworkId == nil || len(*v.NetworkId) == 0 { @@ -1507,7 +1488,7 @@ func (m *awsRestjson1_serializeOpUpdateNode) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/members/{MemberId}/nodes/{NodeId}") + opPath, opQuery := httpbinding.SplitURI("/networks/{NetworkId}/nodes/{NodeId}") request.URL.Path = opPath if len(request.URL.RawQuery) > 0 { request.URL.RawQuery = "&" + opQuery @@ -1548,15 +1529,6 @@ func awsRestjson1_serializeOpHttpBindingsUpdateNodeInput(v *UpdateNodeInput, enc return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.MemberId == nil || len(*v.MemberId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member MemberId must not be empty")} - } - if v.MemberId != nil { - if err := encoder.SetURI("MemberId").String(*v.MemberId); err != nil { - return err - } - } - if v.NetworkId == nil || len(*v.NetworkId) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member NetworkId must not be empty")} } @@ -1589,6 +1561,11 @@ func awsRestjson1_serializeOpDocumentUpdateNodeInput(v *UpdateNodeInput, value s } } + if v.MemberId != nil { + ok := object.Key("MemberId") + ok.String(*v.MemberId) + } + return nil } diff --git a/service/managedblockchain/types/enums.go b/service/managedblockchain/types/enums.go index 6af1ad46f51..e292c39ef56 100644 --- a/service/managedblockchain/types/enums.go +++ b/service/managedblockchain/types/enums.go @@ -25,6 +25,7 @@ type Framework string // Enum values for Framework const ( FrameworkHyperledgerFabric Framework = "HYPERLEDGER_FABRIC" + FrameworkEthereum Framework = "ETHEREUM" ) // Values returns all known values for Framework. Note that this can be expanded in @@ -33,6 +34,7 @@ const ( func (Framework) Values() []Framework { return []Framework{ "HYPERLEDGER_FABRIC", + "ETHEREUM", } } @@ -116,6 +118,7 @@ type NodeStatus string const ( NodeStatusCreating NodeStatus = "CREATING" NodeStatusAvailable NodeStatus = "AVAILABLE" + NodeStatusUnhealthy NodeStatus = "UNHEALTHY" NodeStatusCreateFailed NodeStatus = "CREATE_FAILED" NodeStatusUpdating NodeStatus = "UPDATING" NodeStatusDeleting NodeStatus = "DELETING" @@ -130,6 +133,7 @@ func (NodeStatus) Values() []NodeStatus { return []NodeStatus{ "CREATING", "AVAILABLE", + "UNHEALTHY", "CREATE_FAILED", "UPDATING", "DELETING", diff --git a/service/managedblockchain/types/types.go b/service/managedblockchain/types/types.go index 1332551bfbc..16433119c01 100644 --- a/service/managedblockchain/types/types.go +++ b/service/managedblockchain/types/types.go @@ -9,7 +9,8 @@ import ( // A policy type that defines the voting rules for the network. The rules decide if // a proposal is approved. Approval may be based on criteria such as the percentage // of YES votes and the duration of the proposal. The policy applies to all -// proposals and is specified when the network is created. +// proposals and is specified when the network is created. Applies only to +// Hyperledger Fabric. type ApprovalThresholdPolicy struct { // The duration from the time that a proposal is created until it expires. If @@ -32,7 +33,8 @@ type ApprovalThresholdPolicy struct { ThresholdPercentage *int32 } -// An invitation to an AWS account to create a member and join the network. +// An invitation to an AWS account to create a member and join the network. Applies +// only to Hyperledger Fabric. type Invitation struct { // The date and time that the invitation was created. @@ -71,7 +73,8 @@ type Invitation struct { } // An action to invite a specific AWS account to create a member and join the -// network. The InviteAction is carried out when a Proposal is APPROVED. +// network. The InviteAction is carried out when a Proposal is APPROVED. Applies +// only to Hyperledger Fabric. type InviteAction struct { // The AWS account ID to invite. @@ -94,7 +97,7 @@ type LogConfigurations struct { Cloudwatch *LogConfiguration } -// Member configuration properties. +// Member configuration properties. Applies only to Hyperledger Fabric. type Member struct { // The date and time that the member was created. @@ -142,7 +145,7 @@ type Member struct { Status MemberStatus } -// Configuration properties of the member. +// Configuration properties of the member. Applies only to Hyperledger Fabric. type MemberConfiguration struct { // Configuration properties of the blockchain framework relevant to the member. @@ -181,8 +184,8 @@ type MemberFabricConfiguration struct { // The password for the member's initial administrative user. The AdminPassword // must be at least eight characters long and no more than 32 characters. It must // contain at least one uppercase letter, one lowercase letter, and one digit. It - // cannot have a single quote(‘), double quote(“), forward slash(/), backward - // slash(\), @, or a space. + // cannot have a single quotation mark (‘), a double quotation marks (“), a forward + // slash(/), a backward slash(\), @, or a space. // // This member is required. AdminPassword *string @@ -230,7 +233,8 @@ type MemberLogPublishingConfiguration struct { Fabric *MemberFabricLogPublishingConfiguration } -// A summary of configuration properties for a member. +// A summary of configuration properties for a member. Applies only to Hyperledger +// Fabric. type MemberSummary struct { // The date and time that the member was created. @@ -308,6 +312,20 @@ type Network struct { VpcEndpointServiceName *string } +// Attributes of Ethereum for a network. +type NetworkEthereumAttributes struct { + + // The Ethereum CHAIN_ID associated with the Ethereum network. Chain IDs are as + // follows: + // + // * mainnet = 1 + // + // * rinkeby = 4 + // + // * ropsten = 3 + ChainId *string +} + // Attributes of Hyperledger Fabric for a network. type NetworkFabricAttributes struct { @@ -335,6 +353,10 @@ type NetworkFabricConfiguration struct { // uses. type NetworkFrameworkAttributes struct { + // Attributes of an Ethereum network for Managed Blockchain resources participating + // in an Ethereum network. + Ethereum *NetworkEthereumAttributes + // Attributes of Hyperledger Fabric for a Managed Blockchain network that uses // Hyperledger Fabric. Fabric *NetworkFabricAttributes @@ -374,7 +396,7 @@ type NetworkSummary struct { Status NetworkStatus } -// Configuration properties of a peer node. +// Configuration properties of a node. type Node struct { // The Availability Zone in which the node exists. @@ -392,48 +414,66 @@ type Node struct { // The instance type of the node. InstanceType *string - // Configuration properties for logging events associated with a peer node owned by - // a member in a Managed Blockchain network. + // Configuration properties for logging events associated with a peer node on a + // Hyperledger Fabric network on Managed Blockchain. LogPublishingConfiguration *NodeLogPublishingConfiguration - // The unique identifier of the member to which the node belongs. + // The unique identifier of the member to which the node belongs. Applies only to + // Hyperledger Fabric. MemberId *string - // The unique identifier of the network that the node is in. + // The unique identifier of the network that the node is on. NetworkId *string - // The state database that the node uses. Values are LevelDB or CouchDB. + // The state database that the node uses. Values are LevelDB or CouchDB. Applies + // only to Hyperledger Fabric. StateDB StateDBType // The status of the node. Status NodeStatus } -// Configuration properties of a peer node. +// Configuration properties of a node. type NodeConfiguration struct { - // The Availability Zone in which the node exists. - // - // This member is required. - AvailabilityZone *string - // The Amazon Managed Blockchain instance type for the node. // // This member is required. InstanceType *string - // Configuration properties for logging events associated with a peer node owned by - // a member in a Managed Blockchain network. + // The Availability Zone in which the node exists. + AvailabilityZone *string + + // Configuration properties for logging events associated with a peer node on a + // Hyperledger Fabric network on Managed Blockchain. LogPublishingConfiguration *NodeLogPublishingConfiguration // The state database that the node uses. Values are LevelDB or CouchDB. When using // an Amazon Managed Blockchain network with Hyperledger Fabric version 1.4 or - // later, the default is CouchDB. + // later, the default is CouchDB. Applies only to Hyperledger Fabric. StateDB StateDBType } -// Attributes of Hyperledger Fabric for a peer node on a Managed Blockchain network -// that uses Hyperledger Fabric. +// Attributes of an Ethereum node. +type NodeEthereumAttributes struct { + + // The endpoint on which the Ethereum node listens to run Ethereum JSON-RPC methods + // over HTTP connections from a client. Use this endpoint in client code for smart + // contracts when using an HTTP connection. Connections to this endpoint are + // authenticated using Signature Version 4 + // (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). + HttpEndpoint *string + + // The endpoint on which the Ethereum node listens to run Ethereum JSON-RPC methods + // over WebSockets connections from a client. Use this endpoint in client code for + // smart contracts when using a WebSockets connection. Connections to this endpoint + // are authenticated using Signature Version 4 + // (https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html). + WebSocketEndpoint *string +} + +// Attributes of Hyperledger Fabric for a peer node on a Hyperledger Fabric network +// on Managed Blockchain. type NodeFabricAttributes struct { // The endpoint that identifies the peer node for all services except peer @@ -463,17 +503,21 @@ type NodeFabricLogPublishingConfiguration struct { PeerLogs *LogConfigurations } -// Attributes relevant to a peer node on a Managed Blockchain network for the -// blockchain framework that the network uses. +// Attributes relevant to a node on a Managed Blockchain network for the blockchain +// framework that the network uses. type NodeFrameworkAttributes struct { + // Attributes of Ethereum for a node on a Managed Blockchain network that uses + // Ethereum. + Ethereum *NodeEthereumAttributes + // Attributes of Hyperledger Fabric for a peer node on a Managed Blockchain network // that uses Hyperledger Fabric. Fabric *NodeFabricAttributes } -// Configuration properties for logging events associated with a peer node owned by -// a member in a Managed Blockchain network. +// Configuration properties for logging events associated with a peer node on a +// Hyperledger Fabric network on Managed Blockchain. type NodeLogPublishingConfiguration struct { // Configuration properties for logging events associated with a node that is owned @@ -482,7 +526,7 @@ type NodeLogPublishingConfiguration struct { Fabric *NodeFabricLogPublishingConfiguration } -// A summary of configuration properties for a peer node. +// A summary of configuration properties for a node. type NodeSummary struct { // The Availability Zone in which the node exists. @@ -501,7 +545,8 @@ type NodeSummary struct { Status NodeStatus } -// Properties of a proposal on a Managed Blockchain network. +// Properties of a proposal on a Managed Blockchain network. Applies only to +// Hyperledger Fabric. type Proposal struct { // The actions to perform on the network if the proposal is APPROVED. @@ -567,7 +612,8 @@ type Proposal struct { YesVoteCount *int32 } -// The actions to carry out if a proposal is APPROVED. +// The actions to carry out if a proposal is APPROVED. Applies only to Hyperledger +// Fabric. type ProposalActions struct { // The actions to perform for an APPROVED proposal to invite an AWS account to @@ -580,7 +626,7 @@ type ProposalActions struct { Removals []RemoveAction } -// Properties of a proposal. +// Properties of a proposal. Applies only to Hyperledger Fabric. type ProposalSummary struct { // The date and time that the proposal was created. @@ -631,7 +677,7 @@ type ProposalSummary struct { // An action to remove a member from a Managed Blockchain network as the result of // a removal proposal that is APPROVED. The member and all associated resources are -// deleted from the network. +// deleted from the network. Applies only to Hyperledger Fabric. type RemoveAction struct { // The unique identifier of the member to remove. @@ -640,7 +686,8 @@ type RemoveAction struct { MemberId *string } -// Properties of an individual vote that a member cast for a proposal. +// Properties of an individual vote that a member cast for a proposal. Applies only +// to Hyperledger Fabric. type VoteSummary struct { // The unique identifier of the member that cast the vote. @@ -653,7 +700,8 @@ type VoteSummary struct { Vote VoteValue } -// The voting rules for the network to decide if a proposal is accepted +// The voting rules for the network to decide if a proposal is accepted Applies +// only to Hyperledger Fabric. type VotingPolicy struct { // Defines the rules for the network for voting on proposals, such as the diff --git a/service/managedblockchain/validators.go b/service/managedblockchain/validators.go index a948caad570..3f6388b3ef1 100644 --- a/service/managedblockchain/validators.go +++ b/service/managedblockchain/validators.go @@ -571,9 +571,6 @@ func validateNodeConfiguration(v *types.NodeConfiguration) error { if v.InstanceType == nil { invalidParams.Add(smithy.NewErrParamRequired("InstanceType")) } - if v.AvailabilityZone == nil { - invalidParams.Add(smithy.NewErrParamRequired("AvailabilityZone")) - } if invalidParams.Len() > 0 { return invalidParams } else { @@ -713,9 +710,6 @@ func validateOpCreateNodeInput(v *CreateNodeInput) error { if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } - if v.MemberId == nil { - invalidParams.Add(smithy.NewErrParamRequired("MemberId")) - } if v.NodeConfiguration == nil { invalidParams.Add(smithy.NewErrParamRequired("NodeConfiguration")) } else if v.NodeConfiguration != nil { @@ -784,9 +778,6 @@ func validateOpDeleteNodeInput(v *DeleteNodeInput) error { if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } - if v.MemberId == nil { - invalidParams.Add(smithy.NewErrParamRequired("MemberId")) - } if v.NodeId == nil { invalidParams.Add(smithy.NewErrParamRequired("NodeId")) } @@ -838,9 +829,6 @@ func validateOpGetNodeInput(v *GetNodeInput) error { if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } - if v.MemberId == nil { - invalidParams.Add(smithy.NewErrParamRequired("MemberId")) - } if v.NodeId == nil { invalidParams.Add(smithy.NewErrParamRequired("NodeId")) } @@ -892,9 +880,6 @@ func validateOpListNodesInput(v *ListNodesInput) error { if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } - if v.MemberId == nil { - invalidParams.Add(smithy.NewErrParamRequired("MemberId")) - } if invalidParams.Len() > 0 { return invalidParams } else { @@ -976,9 +961,6 @@ func validateOpUpdateNodeInput(v *UpdateNodeInput) error { if v.NetworkId == nil { invalidParams.Add(smithy.NewErrParamRequired("NetworkId")) } - if v.MemberId == nil { - invalidParams.Add(smithy.NewErrParamRequired("MemberId")) - } if v.NodeId == nil { invalidParams.Add(smithy.NewErrParamRequired("NodeId")) } diff --git a/service/marketplacecommerceanalytics/types/enums.go b/service/marketplacecommerceanalytics/types/enums.go index baf4c064687..1ef88b09c15 100644 --- a/service/marketplacecommerceanalytics/types/enums.go +++ b/service/marketplacecommerceanalytics/types/enums.go @@ -68,6 +68,12 @@ func (DataSetType) Values() []DataSetType { type SupportDataSetType string +// Enum values for SupportDataSetType +const ( + SupportDataSetTypeCustomerSupportContactsData SupportDataSetType = "customer_support_contacts_data" + SupportDataSetTypeTestCustomerSupportContactsData SupportDataSetType = "test_customer_support_contacts_data" +) + // Values returns all known values for SupportDataSetType. 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. diff --git a/service/neptune/types/enums.go b/service/neptune/types/enums.go index 646c5ec14c9..91e91f9f84c 100644 --- a/service/neptune/types/enums.go +++ b/service/neptune/types/enums.go @@ -4,6 +4,12 @@ package types type ApplyMethod string +// Enum values for ApplyMethod +const ( + ApplyMethodImmediate ApplyMethod = "immediate" + ApplyMethodPendingReboot ApplyMethod = "pending-reboot" +) + // Values returns all known values for ApplyMethod. 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. @@ -16,6 +22,16 @@ func (ApplyMethod) Values() []ApplyMethod { type SourceType string +// Enum values for SourceType +const ( + SourceTypeDbInstance SourceType = "db-instance" + SourceTypeDbParameterGroup SourceType = "db-parameter-group" + SourceTypeDbSecurityGroup SourceType = "db-security-group" + SourceTypeDbSnapshot SourceType = "db-snapshot" + SourceTypeDbCluster SourceType = "db-cluster" + SourceTypeDbClusterSnapshot SourceType = "db-cluster-snapshot" +) + // Values returns all known values for SourceType. 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. diff --git a/service/opsworks/types/enums.go b/service/opsworks/types/enums.go index aaf9bf05962..c46c114b334 100644 --- a/service/opsworks/types/enums.go +++ b/service/opsworks/types/enums.go @@ -4,6 +4,14 @@ package types type AppAttributesKeys string +// Enum values for AppAttributesKeys +const ( + AppAttributesKeysDocumentroot AppAttributesKeys = "DocumentRoot" + AppAttributesKeysRailsenv AppAttributesKeys = "RailsEnv" + AppAttributesKeysAutobundleondeploy AppAttributesKeys = "AutoBundleOnDeploy" + AppAttributesKeysAwsflowrubysettings AppAttributesKeys = "AwsFlowRubySettings" +) + // Values returns all known values for AppAttributesKeys. 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. @@ -18,6 +26,17 @@ func (AppAttributesKeys) Values() []AppAttributesKeys { type AppType string +// Enum values for AppType +const ( + AppTypeAwsFlowRuby AppType = "aws-flow-ruby" + AppTypeJava AppType = "java" + AppTypeRails AppType = "rails" + AppTypePhp AppType = "php" + AppTypeNodejs AppType = "nodejs" + AppTypeStatic AppType = "static" + AppTypeOther AppType = "other" +) + // Values returns all known values for AppType. 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. @@ -35,6 +54,12 @@ func (AppType) Values() []AppType { type Architecture string +// Enum values for Architecture +const ( + ArchitectureX8664 Architecture = "x86_64" + ArchitectureI386 Architecture = "i386" +) + // 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. @@ -47,6 +72,12 @@ func (Architecture) Values() []Architecture { type AutoScalingType string +// Enum values for AutoScalingType +const ( + AutoScalingTypeLoad AutoScalingType = "load" + AutoScalingTypeTimer AutoScalingType = "timer" +) + // Values returns all known values for AutoScalingType. 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. @@ -59,6 +90,102 @@ func (AutoScalingType) Values() []AutoScalingType { type CloudWatchLogsEncoding string +// Enum values for CloudWatchLogsEncoding +const ( + CloudWatchLogsEncodingAscii CloudWatchLogsEncoding = "ascii" + CloudWatchLogsEncodingBig5 CloudWatchLogsEncoding = "big5" + CloudWatchLogsEncodingBig5hkscs CloudWatchLogsEncoding = "big5hkscs" + CloudWatchLogsEncodingCp037 CloudWatchLogsEncoding = "cp037" + CloudWatchLogsEncodingCp424 CloudWatchLogsEncoding = "cp424" + CloudWatchLogsEncodingCp437 CloudWatchLogsEncoding = "cp437" + CloudWatchLogsEncodingCp500 CloudWatchLogsEncoding = "cp500" + CloudWatchLogsEncodingCp720 CloudWatchLogsEncoding = "cp720" + CloudWatchLogsEncodingCp737 CloudWatchLogsEncoding = "cp737" + CloudWatchLogsEncodingCp775 CloudWatchLogsEncoding = "cp775" + CloudWatchLogsEncodingCp850 CloudWatchLogsEncoding = "cp850" + CloudWatchLogsEncodingCp852 CloudWatchLogsEncoding = "cp852" + CloudWatchLogsEncodingCp855 CloudWatchLogsEncoding = "cp855" + CloudWatchLogsEncodingCp856 CloudWatchLogsEncoding = "cp856" + CloudWatchLogsEncodingCp857 CloudWatchLogsEncoding = "cp857" + CloudWatchLogsEncodingCp858 CloudWatchLogsEncoding = "cp858" + CloudWatchLogsEncodingCp860 CloudWatchLogsEncoding = "cp860" + CloudWatchLogsEncodingCp861 CloudWatchLogsEncoding = "cp861" + CloudWatchLogsEncodingCp862 CloudWatchLogsEncoding = "cp862" + CloudWatchLogsEncodingCp863 CloudWatchLogsEncoding = "cp863" + CloudWatchLogsEncodingCp864 CloudWatchLogsEncoding = "cp864" + CloudWatchLogsEncodingCp865 CloudWatchLogsEncoding = "cp865" + CloudWatchLogsEncodingCp866 CloudWatchLogsEncoding = "cp866" + CloudWatchLogsEncodingCp869 CloudWatchLogsEncoding = "cp869" + CloudWatchLogsEncodingCp874 CloudWatchLogsEncoding = "cp874" + CloudWatchLogsEncodingCp875 CloudWatchLogsEncoding = "cp875" + CloudWatchLogsEncodingCp932 CloudWatchLogsEncoding = "cp932" + CloudWatchLogsEncodingCp949 CloudWatchLogsEncoding = "cp949" + CloudWatchLogsEncodingCp950 CloudWatchLogsEncoding = "cp950" + CloudWatchLogsEncodingCp1006 CloudWatchLogsEncoding = "cp1006" + CloudWatchLogsEncodingCp1026 CloudWatchLogsEncoding = "cp1026" + CloudWatchLogsEncodingCp1140 CloudWatchLogsEncoding = "cp1140" + CloudWatchLogsEncodingCp1250 CloudWatchLogsEncoding = "cp1250" + CloudWatchLogsEncodingCp1251 CloudWatchLogsEncoding = "cp1251" + CloudWatchLogsEncodingCp1252 CloudWatchLogsEncoding = "cp1252" + CloudWatchLogsEncodingCp1253 CloudWatchLogsEncoding = "cp1253" + CloudWatchLogsEncodingCp1254 CloudWatchLogsEncoding = "cp1254" + CloudWatchLogsEncodingCp1255 CloudWatchLogsEncoding = "cp1255" + CloudWatchLogsEncodingCp1256 CloudWatchLogsEncoding = "cp1256" + CloudWatchLogsEncodingCp1257 CloudWatchLogsEncoding = "cp1257" + CloudWatchLogsEncodingCp1258 CloudWatchLogsEncoding = "cp1258" + CloudWatchLogsEncodingEucJp CloudWatchLogsEncoding = "euc_jp" + CloudWatchLogsEncodingEucJis2004 CloudWatchLogsEncoding = "euc_jis_2004" + CloudWatchLogsEncodingEucJisx0213 CloudWatchLogsEncoding = "euc_jisx0213" + CloudWatchLogsEncodingEucKr CloudWatchLogsEncoding = "euc_kr" + CloudWatchLogsEncodingGb2312 CloudWatchLogsEncoding = "gb2312" + CloudWatchLogsEncodingGbk CloudWatchLogsEncoding = "gbk" + CloudWatchLogsEncodingGb18030 CloudWatchLogsEncoding = "gb18030" + CloudWatchLogsEncodingHz CloudWatchLogsEncoding = "hz" + CloudWatchLogsEncodingIso2022Jp CloudWatchLogsEncoding = "iso2022_jp" + CloudWatchLogsEncodingIso2022Jp1 CloudWatchLogsEncoding = "iso2022_jp_1" + CloudWatchLogsEncodingIso2022Jp2 CloudWatchLogsEncoding = "iso2022_jp_2" + CloudWatchLogsEncodingIso2022Jp2004 CloudWatchLogsEncoding = "iso2022_jp_2004" + CloudWatchLogsEncodingIso2022Jp3 CloudWatchLogsEncoding = "iso2022_jp_3" + CloudWatchLogsEncodingIso2022JpExt CloudWatchLogsEncoding = "iso2022_jp_ext" + CloudWatchLogsEncodingIso2022Kr CloudWatchLogsEncoding = "iso2022_kr" + CloudWatchLogsEncodingLatin1 CloudWatchLogsEncoding = "latin_1" + CloudWatchLogsEncodingIso88592 CloudWatchLogsEncoding = "iso8859_2" + CloudWatchLogsEncodingIso88593 CloudWatchLogsEncoding = "iso8859_3" + CloudWatchLogsEncodingIso88594 CloudWatchLogsEncoding = "iso8859_4" + CloudWatchLogsEncodingIso88595 CloudWatchLogsEncoding = "iso8859_5" + CloudWatchLogsEncodingIso88596 CloudWatchLogsEncoding = "iso8859_6" + CloudWatchLogsEncodingIso88597 CloudWatchLogsEncoding = "iso8859_7" + CloudWatchLogsEncodingIso88598 CloudWatchLogsEncoding = "iso8859_8" + CloudWatchLogsEncodingIso88599 CloudWatchLogsEncoding = "iso8859_9" + CloudWatchLogsEncodingIso885910 CloudWatchLogsEncoding = "iso8859_10" + CloudWatchLogsEncodingIso885913 CloudWatchLogsEncoding = "iso8859_13" + CloudWatchLogsEncodingIso885914 CloudWatchLogsEncoding = "iso8859_14" + CloudWatchLogsEncodingIso885915 CloudWatchLogsEncoding = "iso8859_15" + CloudWatchLogsEncodingIso885916 CloudWatchLogsEncoding = "iso8859_16" + CloudWatchLogsEncodingJohab CloudWatchLogsEncoding = "johab" + CloudWatchLogsEncodingKoi8R CloudWatchLogsEncoding = "koi8_r" + CloudWatchLogsEncodingKoi8U CloudWatchLogsEncoding = "koi8_u" + CloudWatchLogsEncodingMacCyrillic CloudWatchLogsEncoding = "mac_cyrillic" + CloudWatchLogsEncodingMacGreek CloudWatchLogsEncoding = "mac_greek" + CloudWatchLogsEncodingMacIceland CloudWatchLogsEncoding = "mac_iceland" + CloudWatchLogsEncodingMacLatin2 CloudWatchLogsEncoding = "mac_latin2" + CloudWatchLogsEncodingMacRoman CloudWatchLogsEncoding = "mac_roman" + CloudWatchLogsEncodingMacTurkish CloudWatchLogsEncoding = "mac_turkish" + CloudWatchLogsEncodingPtcp154 CloudWatchLogsEncoding = "ptcp154" + CloudWatchLogsEncodingShiftJis CloudWatchLogsEncoding = "shift_jis" + CloudWatchLogsEncodingShiftJis2004 CloudWatchLogsEncoding = "shift_jis_2004" + CloudWatchLogsEncodingShiftJisx0213 CloudWatchLogsEncoding = "shift_jisx0213" + CloudWatchLogsEncodingUtf32 CloudWatchLogsEncoding = "utf_32" + CloudWatchLogsEncodingUtf32Be CloudWatchLogsEncoding = "utf_32_be" + CloudWatchLogsEncodingUtf32Le CloudWatchLogsEncoding = "utf_32_le" + CloudWatchLogsEncodingUtf16 CloudWatchLogsEncoding = "utf_16" + CloudWatchLogsEncodingUtf16Be CloudWatchLogsEncoding = "utf_16_be" + CloudWatchLogsEncodingUtf16Le CloudWatchLogsEncoding = "utf_16_le" + CloudWatchLogsEncodingUtf7 CloudWatchLogsEncoding = "utf_7" + CloudWatchLogsEncodingUtf8 CloudWatchLogsEncoding = "utf_8" + CloudWatchLogsEncodingUtf8Sig CloudWatchLogsEncoding = "utf_8_sig" +) + // Values returns all known values for CloudWatchLogsEncoding. 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. @@ -161,6 +288,12 @@ func (CloudWatchLogsEncoding) Values() []CloudWatchLogsEncoding { type CloudWatchLogsInitialPosition string +// Enum values for CloudWatchLogsInitialPosition +const ( + CloudWatchLogsInitialPositionStartOfFile CloudWatchLogsInitialPosition = "start_of_file" + CloudWatchLogsInitialPositionEndOfFile CloudWatchLogsInitialPosition = "end_of_file" +) + // Values returns all known values for CloudWatchLogsInitialPosition. 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 @@ -174,6 +307,12 @@ func (CloudWatchLogsInitialPosition) Values() []CloudWatchLogsInitialPosition { type CloudWatchLogsTimeZone string +// Enum values for CloudWatchLogsTimeZone +const ( + CloudWatchLogsTimeZoneLocal CloudWatchLogsTimeZone = "LOCAL" + CloudWatchLogsTimeZoneUtc CloudWatchLogsTimeZone = "UTC" +) + // Values returns all known values for CloudWatchLogsTimeZone. 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. @@ -186,6 +325,22 @@ func (CloudWatchLogsTimeZone) Values() []CloudWatchLogsTimeZone { type DeploymentCommandName string +// Enum values for DeploymentCommandName +const ( + DeploymentCommandNameInstallDependencies DeploymentCommandName = "install_dependencies" + DeploymentCommandNameUpdateDependencies DeploymentCommandName = "update_dependencies" + DeploymentCommandNameUpdateCustomCookbooks DeploymentCommandName = "update_custom_cookbooks" + DeploymentCommandNameExecuteRecipes DeploymentCommandName = "execute_recipes" + DeploymentCommandNameConfigure DeploymentCommandName = "configure" + DeploymentCommandNameSetup DeploymentCommandName = "setup" + DeploymentCommandNameDeploy DeploymentCommandName = "deploy" + DeploymentCommandNameRollback DeploymentCommandName = "rollback" + DeploymentCommandNameStart DeploymentCommandName = "start" + DeploymentCommandNameStop DeploymentCommandName = "stop" + DeploymentCommandNameRestart DeploymentCommandName = "restart" + DeploymentCommandNameUndeploy DeploymentCommandName = "undeploy" +) + // Values returns all known values for DeploymentCommandName. 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. @@ -208,6 +363,35 @@ func (DeploymentCommandName) Values() []DeploymentCommandName { type LayerAttributesKeys string +// Enum values for LayerAttributesKeys +const ( + LayerAttributesKeysEcsclusterarn LayerAttributesKeys = "EcsClusterArn" + LayerAttributesKeysEnablehaproxystats LayerAttributesKeys = "EnableHaproxyStats" + LayerAttributesKeysHaproxystatsurl LayerAttributesKeys = "HaproxyStatsUrl" + LayerAttributesKeysHaproxystatsuser LayerAttributesKeys = "HaproxyStatsUser" + LayerAttributesKeysHaproxystatspassword LayerAttributesKeys = "HaproxyStatsPassword" + LayerAttributesKeysHaproxyhealthcheckurl LayerAttributesKeys = "HaproxyHealthCheckUrl" + LayerAttributesKeysHaproxyhealthcheckmethod LayerAttributesKeys = "HaproxyHealthCheckMethod" + LayerAttributesKeysMysqlrootpassword LayerAttributesKeys = "MysqlRootPassword" + LayerAttributesKeysMysqlrootpasswordubiquitous LayerAttributesKeys = "MysqlRootPasswordUbiquitous" + LayerAttributesKeysGangliaurl LayerAttributesKeys = "GangliaUrl" + LayerAttributesKeysGangliauser LayerAttributesKeys = "GangliaUser" + LayerAttributesKeysGangliapassword LayerAttributesKeys = "GangliaPassword" + LayerAttributesKeysMemcachedmemory LayerAttributesKeys = "MemcachedMemory" + LayerAttributesKeysNodejsversion LayerAttributesKeys = "NodejsVersion" + LayerAttributesKeysRubyversion LayerAttributesKeys = "RubyVersion" + LayerAttributesKeysRubygemsversion LayerAttributesKeys = "RubygemsVersion" + LayerAttributesKeysManagebundler LayerAttributesKeys = "ManageBundler" + LayerAttributesKeysBundlerversion LayerAttributesKeys = "BundlerVersion" + LayerAttributesKeysRailsstack LayerAttributesKeys = "RailsStack" + LayerAttributesKeysPassengerversion LayerAttributesKeys = "PassengerVersion" + LayerAttributesKeysJvm LayerAttributesKeys = "Jvm" + LayerAttributesKeysJvmversion LayerAttributesKeys = "JvmVersion" + LayerAttributesKeysJvmoptions LayerAttributesKeys = "JvmOptions" + LayerAttributesKeysJavaappserver LayerAttributesKeys = "JavaAppServer" + LayerAttributesKeysJavaappserverversion LayerAttributesKeys = "JavaAppServerVersion" +) + // Values returns all known values for LayerAttributesKeys. 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. @@ -243,6 +427,22 @@ func (LayerAttributesKeys) Values() []LayerAttributesKeys { type LayerType string +// Enum values for LayerType +const ( + LayerTypeAwsFlowRuby LayerType = "aws-flow-ruby" + LayerTypeEcsCluster LayerType = "ecs-cluster" + LayerTypeJavaApp LayerType = "java-app" + LayerTypeLb LayerType = "lb" + LayerTypeWeb LayerType = "web" + LayerTypePhpApp LayerType = "php-app" + LayerTypeRailsApp LayerType = "rails-app" + LayerTypeNodejsApp LayerType = "nodejs-app" + LayerTypeMemcached LayerType = "memcached" + LayerTypeDbMaster LayerType = "db-master" + LayerTypeMonitoringMaster LayerType = "monitoring-master" + LayerTypeCustom LayerType = "custom" +) + // Values returns all known values for LayerType. 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. @@ -265,6 +465,12 @@ func (LayerType) Values() []LayerType { type RootDeviceType string +// Enum values for RootDeviceType +const ( + RootDeviceTypeEbs RootDeviceType = "ebs" + RootDeviceTypeInstanceStore RootDeviceType = "instance-store" +) + // Values returns all known values for RootDeviceType. 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. @@ -277,6 +483,14 @@ func (RootDeviceType) Values() []RootDeviceType { type SourceType string +// Enum values for SourceType +const ( + SourceTypeGit SourceType = "git" + SourceTypeSvn SourceType = "svn" + SourceTypeArchive SourceType = "archive" + SourceTypeS3 SourceType = "s3" +) + // Values returns all known values for SourceType. 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. @@ -291,6 +505,11 @@ func (SourceType) Values() []SourceType { type StackAttributesKeys string +// Enum values for StackAttributesKeys +const ( + StackAttributesKeysColor StackAttributesKeys = "Color" +) + // Values returns all known values for StackAttributesKeys. 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. @@ -302,6 +521,12 @@ func (StackAttributesKeys) Values() []StackAttributesKeys { type VirtualizationType string +// Enum values for VirtualizationType +const ( + VirtualizationTypeParavirtual VirtualizationType = "paravirtual" + VirtualizationTypeHvm VirtualizationType = "hvm" +) + // Values returns all known values for VirtualizationType. 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. @@ -314,6 +539,13 @@ func (VirtualizationType) Values() []VirtualizationType { type VolumeType string +// Enum values for VolumeType +const ( + VolumeTypeGp2 VolumeType = "gp2" + VolumeTypeIo1 VolumeType = "io1" + VolumeTypeStandard VolumeType = "standard" +) + // Values returns all known values for VolumeType. 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. diff --git a/service/outposts/api_op_CreateOutpost.go b/service/outposts/api_op_CreateOutpost.go index abae24e21e4..f5a4f2e17c5 100644 --- a/service/outposts/api_op_CreateOutpost.go +++ b/service/outposts/api_op_CreateOutpost.go @@ -46,7 +46,7 @@ type CreateOutpostInput struct { // AvailabilityZoneId. AvailabilityZoneId *string - // The Outpost description. + // The description of the Outpost. Description *string // The tags to apply to the Outpost. diff --git a/service/outposts/api_op_ListTagsForResource.go b/service/outposts/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..87546cd6775 --- /dev/null +++ b/service/outposts/api_op_ListTagsForResource.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package outposts + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the tags for the specified 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, addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The Amazon Resource Name (ARN) of the resource. + // + // This member is required. + ResourceArn *string +} + +type ListTagsForResourceOutput struct { + + // The resource tags. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "outposts", + OperationName: "ListTagsForResource", + } +} diff --git a/service/outposts/api_op_TagResource.go b/service/outposts/api_op_TagResource.go new file mode 100644 index 00000000000..c9c7e146f73 --- /dev/null +++ b/service/outposts/api_op_TagResource.go @@ -0,0 +1,114 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package outposts + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds tags to the specified resource. +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The Amazon Resource Name (ARN) of the resource. + // + // This member is required. + ResourceArn *string + + // The tags to add to the resource. + // + // This member is required. + Tags map[string]string +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "outposts", + OperationName: "TagResource", + } +} diff --git a/service/outposts/api_op_UntagResource.go b/service/outposts/api_op_UntagResource.go new file mode 100644 index 00000000000..1e432bfd799 --- /dev/null +++ b/service/outposts/api_op_UntagResource.go @@ -0,0 +1,114 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package outposts + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Removes tags from the specified resource. +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The Amazon Resource Name (ARN) of the resource. + // + // This member is required. + ResourceArn *string + + // The tag keys. + // + // This member is required. + TagKeys []string +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "outposts", + OperationName: "UntagResource", + } +} diff --git a/service/outposts/deserializers.go b/service/outposts/deserializers.go index bf4f06f19b4..9773c454a3b 100644 --- a/service/outposts/deserializers.go +++ b/service/outposts/deserializers.go @@ -1024,6 +1024,337 @@ func awsRestjson1_deserializeOpDocumentListSitesOutput(v **ListSitesOutput, valu 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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(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_deserializeDocumentTagMap(&sv.Tags, 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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(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 + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.AccessDeniedException{} var buff [1024]byte diff --git a/service/outposts/doc.go b/service/outposts/doc.go index e4f4b70d359..df4fd17697a 100644 --- a/service/outposts/doc.go +++ b/service/outposts/doc.go @@ -3,8 +3,8 @@ // Package outposts provides the API client, operations, and parameter types for // AWS Outposts. // -// AWS Outposts is a fully-managed service that extends AWS infrastructure, APIs, -// and tools to customer premises. By providing local access to AWS-managed +// AWS Outposts is a fully managed service that extends AWS infrastructure, APIs, +// and tools to customer premises. By providing local access to AWS managed // infrastructure, AWS Outposts enables customers to build and run applications on // premises using the same programming interfaces as in AWS Regions, while using // local compute and storage resources for lower latency and local data processing diff --git a/service/outposts/serializers.go b/service/outposts/serializers.go index 5d004491d2d..a1424de73e1 100644 --- a/service/outposts/serializers.go +++ b/service/outposts/serializers.go @@ -497,6 +497,226 @@ func awsRestjson1_serializeOpHttpBindingsListSitesInput(v *ListSitesInput, encod 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 = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_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 = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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 = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + request.URL.RawQuery = opQuery + } + + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ResourceArn == nil || len(*v.ResourceArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ResourceArn must not be empty")} + } + if v.ResourceArn != nil { + if err := encoder.SetURI("ResourceArn").String(*v.ResourceArn); err != nil { + return err + } + } + + if v.TagKeys != nil { + for i := range v.TagKeys { + encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + } + } + + return nil +} + func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/outposts/types/types.go b/service/outposts/types/types.go index c3bffc46a46..67285e5b706 100644 --- a/service/outposts/types/types.go +++ b/service/outposts/types/types.go @@ -19,7 +19,7 @@ type Outpost struct { // AvailabilityZoneId. AvailabilityZoneId *string - // The Outpost description. + // The description of the Outpost. Description *string // The life cycle status. diff --git a/service/outposts/validators.go b/service/outposts/validators.go index e0ea1aa33c4..2ed8706d44e 100644 --- a/service/outposts/validators.go +++ b/service/outposts/validators.go @@ -109,6 +109,66 @@ func (m *validateOpGetOutpostInstanceTypes) HandleInitialize(ctx context.Context return next.HandleInitialize(ctx, in) } +type validateOpListTagsForResource struct { +} + +func (*validateOpListTagsForResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTagsForResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpTagResource struct { +} + +func (*validateOpTagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUntagResource struct { +} + +func (*validateOpUntagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUntagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + func addOpCreateOutpostValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateOutpost{}, middleware.After) } @@ -129,6 +189,18 @@ func addOpGetOutpostInstanceTypesValidationMiddleware(stack *middleware.Stack) e return stack.Initialize.Add(&validateOpGetOutpostInstanceTypes{}, middleware.After) } +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) +} + +func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) +} + func validateOpCreateOutpostInput(v *CreateOutpostInput) error { if v == nil { return nil @@ -206,3 +278,54 @@ func validateOpGetOutpostInstanceTypesInput(v *GetOutpostInstanceTypesInput) err return nil } } + +func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTagResourceInput(v *TagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourceInput(v *UntagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/polly/types/enums.go b/service/polly/types/enums.go index 2f08d8c474a..4740e90021a 100644 --- a/service/polly/types/enums.go +++ b/service/polly/types/enums.go @@ -22,6 +22,12 @@ func (Engine) Values() []Engine { type Gender string +// Enum values for Gender +const ( + GenderFemale Gender = "Female" + GenderMale Gender = "Male" +) + // Values returns all known values for Gender. 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. @@ -34,6 +40,39 @@ func (Gender) Values() []Gender { type LanguageCode string +// Enum values for LanguageCode +const ( + LanguageCodeArb LanguageCode = "arb" + LanguageCodeCmnCn LanguageCode = "cmn-CN" + LanguageCodeCyGb LanguageCode = "cy-GB" + LanguageCodeDaDk LanguageCode = "da-DK" + LanguageCodeDeDe LanguageCode = "de-DE" + LanguageCodeEnAu LanguageCode = "en-AU" + LanguageCodeEnGb LanguageCode = "en-GB" + LanguageCodeEnGbWls LanguageCode = "en-GB-WLS" + LanguageCodeEnIn LanguageCode = "en-IN" + LanguageCodeEnUs LanguageCode = "en-US" + LanguageCodeEsEs LanguageCode = "es-ES" + LanguageCodeEsMx LanguageCode = "es-MX" + LanguageCodeEsUs LanguageCode = "es-US" + LanguageCodeFrCa LanguageCode = "fr-CA" + LanguageCodeFrFr LanguageCode = "fr-FR" + LanguageCodeIsIs LanguageCode = "is-IS" + LanguageCodeItIt LanguageCode = "it-IT" + LanguageCodeJaJp LanguageCode = "ja-JP" + LanguageCodeHiIn LanguageCode = "hi-IN" + LanguageCodeKoKr LanguageCode = "ko-KR" + LanguageCodeNbNo LanguageCode = "nb-NO" + LanguageCodeNlNl LanguageCode = "nl-NL" + LanguageCodePlPl LanguageCode = "pl-PL" + LanguageCodePtBr LanguageCode = "pt-BR" + LanguageCodePtPt LanguageCode = "pt-PT" + LanguageCodeRoRo LanguageCode = "ro-RO" + LanguageCodeRuRu LanguageCode = "ru-RU" + LanguageCodeSvSe LanguageCode = "sv-SE" + LanguageCodeTrTr LanguageCode = "tr-TR" +) + // Values returns all known values for LanguageCode. 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. @@ -157,6 +196,72 @@ func (TextType) Values() []TextType { type VoiceId string +// Enum values for VoiceId +const ( + VoiceIdAditi VoiceId = "Aditi" + VoiceIdAmy VoiceId = "Amy" + VoiceIdAstrid VoiceId = "Astrid" + VoiceIdBianca VoiceId = "Bianca" + VoiceIdBrian VoiceId = "Brian" + VoiceIdCamila VoiceId = "Camila" + VoiceIdCarla VoiceId = "Carla" + VoiceIdCarmen VoiceId = "Carmen" + VoiceIdCeline VoiceId = "Celine" + VoiceIdChantal VoiceId = "Chantal" + VoiceIdConchita VoiceId = "Conchita" + VoiceIdCristiano VoiceId = "Cristiano" + VoiceIdDora VoiceId = "Dora" + VoiceIdEmma VoiceId = "Emma" + VoiceIdEnrique VoiceId = "Enrique" + VoiceIdEwa VoiceId = "Ewa" + VoiceIdFiliz VoiceId = "Filiz" + VoiceIdGeraint VoiceId = "Geraint" + VoiceIdGiorgio VoiceId = "Giorgio" + VoiceIdGwyneth VoiceId = "Gwyneth" + VoiceIdHans VoiceId = "Hans" + VoiceIdInes VoiceId = "Ines" + VoiceIdIvy VoiceId = "Ivy" + VoiceIdJacek VoiceId = "Jacek" + VoiceIdJan VoiceId = "Jan" + VoiceIdJoanna VoiceId = "Joanna" + VoiceIdJoey VoiceId = "Joey" + VoiceIdJustin VoiceId = "Justin" + VoiceIdKarl VoiceId = "Karl" + VoiceIdKendra VoiceId = "Kendra" + VoiceIdKevin VoiceId = "Kevin" + VoiceIdKimberly VoiceId = "Kimberly" + VoiceIdLea VoiceId = "Lea" + VoiceIdLiv VoiceId = "Liv" + VoiceIdLotte VoiceId = "Lotte" + VoiceIdLucia VoiceId = "Lucia" + VoiceIdLupe VoiceId = "Lupe" + VoiceIdMads VoiceId = "Mads" + VoiceIdMaja VoiceId = "Maja" + VoiceIdMarlene VoiceId = "Marlene" + VoiceIdMathieu VoiceId = "Mathieu" + VoiceIdMatthew VoiceId = "Matthew" + VoiceIdMaxim VoiceId = "Maxim" + VoiceIdMia VoiceId = "Mia" + VoiceIdMiguel VoiceId = "Miguel" + VoiceIdMizuki VoiceId = "Mizuki" + VoiceIdNaja VoiceId = "Naja" + VoiceIdNicole VoiceId = "Nicole" + VoiceIdOlivia VoiceId = "Olivia" + VoiceIdPenelope VoiceId = "Penelope" + VoiceIdRaveena VoiceId = "Raveena" + VoiceIdRicardo VoiceId = "Ricardo" + VoiceIdRuben VoiceId = "Ruben" + VoiceIdRussell VoiceId = "Russell" + VoiceIdSalli VoiceId = "Salli" + VoiceIdSeoyeon VoiceId = "Seoyeon" + VoiceIdTakumi VoiceId = "Takumi" + VoiceIdTatyana VoiceId = "Tatyana" + VoiceIdVicki VoiceId = "Vicki" + VoiceIdVitoria VoiceId = "Vitoria" + VoiceIdZeina VoiceId = "Zeina" + VoiceIdZhiyu VoiceId = "Zhiyu" +) + // Values returns all known values for VoiceId. 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. diff --git a/service/qldbsession/api_op_SendCommand.go b/service/qldbsession/api_op_SendCommand.go index 0b61c9cea22..07a988eac4f 100644 --- a/service/qldbsession/api_op_SendCommand.go +++ b/service/qldbsession/api_op_SendCommand.go @@ -12,21 +12,21 @@ import ( ) // Sends a command to an Amazon QLDB ledger. Instead of interacting directly with -// this API, we recommend that you use the Amazon QLDB Driver or the QLDB Shell to -// execute data transactions on a ledger. +// this API, we recommend using the QLDB driver or the QLDB shell to execute data +// transactions on a ledger. // -// * If you are working with an AWS SDK, -// use the QLDB Driver. The driver provides a high-level abstraction layer above -// this qldbsession data plane and manages SendCommand API calls for you. For -// information and a list of supported programming languages, see Getting started -// with the driver +// * If you are working with an AWS SDK, use the QLDB +// driver. The driver provides a high-level abstraction layer above this QLDB +// Session data plane and manages SendCommand API calls for you. For information +// and a list of supported programming languages, see Getting started with the +// driver // (https://docs.aws.amazon.com/qldb/latest/developerguide/getting-started-driver.html) // in the Amazon QLDB Developer Guide. // // * If you are working with the AWS Command -// Line Interface (AWS CLI), use the QLDB Shell. The shell is a command line -// interface that uses the QLDB Driver to interact with a ledger. For information, -// see Accessing Amazon QLDB using the QLDB Shell +// Line Interface (AWS CLI), use the QLDB shell. The shell is a command line +// interface that uses the QLDB driver to interact with a ledger. For information, +// see Accessing Amazon QLDB using the QLDB shell // (https://docs.aws.amazon.com/qldb/latest/developerguide/data-shell.html). func (c *Client) SendCommand(ctx context.Context, params *SendCommandInput, optFns ...func(*Options)) (*SendCommandOutput, error) { if params == nil { diff --git a/service/qldbsession/deserializers.go b/service/qldbsession/deserializers.go index 293722d3848..61a1c36db8d 100644 --- a/service/qldbsession/deserializers.go +++ b/service/qldbsession/deserializers.go @@ -339,6 +339,11 @@ func awsAwsjson10_deserializeDocumentAbortTransactionResult(v **types.AbortTrans for key, value := range shape { switch key { + case "TimingInformation": + if err := awsAwsjson10_deserializeDocumentTimingInformation(&sv.TimingInformation, value); err != nil { + return err + } + default: _, _ = key, value @@ -432,6 +437,16 @@ func awsAwsjson10_deserializeDocumentCommitTransactionResult(v **types.CommitTra sv.CommitDigest = dv } + case "ConsumedIOs": + if err := awsAwsjson10_deserializeDocumentIOUsage(&sv.ConsumedIOs, value); err != nil { + return err + } + + case "TimingInformation": + if err := awsAwsjson10_deserializeDocumentTimingInformation(&sv.TimingInformation, value); err != nil { + return err + } + case "TransactionId": if value != nil { jtv, ok := value.(string) @@ -472,6 +487,11 @@ func awsAwsjson10_deserializeDocumentEndSessionResult(v **types.EndSessionResult for key, value := range shape { switch key { + case "TimingInformation": + if err := awsAwsjson10_deserializeDocumentTimingInformation(&sv.TimingInformation, value); err != nil { + return err + } + default: _, _ = key, value @@ -503,11 +523,21 @@ func awsAwsjson10_deserializeDocumentExecuteStatementResult(v **types.ExecuteSta for key, value := range shape { switch key { + case "ConsumedIOs": + if err := awsAwsjson10_deserializeDocumentIOUsage(&sv.ConsumedIOs, value); err != nil { + return err + } + case "FirstPage": if err := awsAwsjson10_deserializeDocumentPage(&sv.FirstPage, value); err != nil { return err } + case "TimingInformation": + if err := awsAwsjson10_deserializeDocumentTimingInformation(&sv.TimingInformation, value); err != nil { + return err + } + default: _, _ = key, value @@ -539,11 +569,21 @@ func awsAwsjson10_deserializeDocumentFetchPageResult(v **types.FetchPageResult, for key, value := range shape { switch key { + case "ConsumedIOs": + if err := awsAwsjson10_deserializeDocumentIOUsage(&sv.ConsumedIOs, value); err != nil { + return err + } + case "Page": if err := awsAwsjson10_deserializeDocumentPage(&sv.Page, value); err != nil { return err } + case "TimingInformation": + if err := awsAwsjson10_deserializeDocumentTimingInformation(&sv.TimingInformation, value); err != nil { + return err + } + default: _, _ = key, value @@ -602,6 +642,63 @@ func awsAwsjson10_deserializeDocumentInvalidSessionException(v **types.InvalidSe return nil } +func awsAwsjson10_deserializeDocumentIOUsage(v **types.IOUsage, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.IOUsage + if *v == nil { + sv = &types.IOUsage{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ReadIOs": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ReadIOs to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ReadIOs = i64 + } + + case "WriteIOs": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected WriteIOs to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.WriteIOs = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -798,6 +895,11 @@ func awsAwsjson10_deserializeDocumentStartSessionResult(v **types.StartSessionRe sv.SessionToken = ptr.String(jtv) } + case "TimingInformation": + if err := awsAwsjson10_deserializeDocumentTimingInformation(&sv.TimingInformation, value); err != nil { + return err + } + default: _, _ = key, value @@ -829,6 +931,11 @@ func awsAwsjson10_deserializeDocumentStartTransactionResult(v **types.StartTrans for key, value := range shape { switch key { + case "TimingInformation": + if err := awsAwsjson10_deserializeDocumentTimingInformation(&sv.TimingInformation, value); err != nil { + return err + } + case "TransactionId": if value != nil { jtv, ok := value.(string) @@ -847,6 +954,50 @@ func awsAwsjson10_deserializeDocumentStartTransactionResult(v **types.StartTrans return nil } +func awsAwsjson10_deserializeDocumentTimingInformation(v **types.TimingInformation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TimingInformation + if *v == nil { + sv = &types.TimingInformation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ProcessingTimeMilliseconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ProcessingTimeMilliseconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ProcessingTimeMilliseconds = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentValueHolder(v **types.ValueHolder, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/qldbsession/doc.go b/service/qldbsession/doc.go index 8c1a9b6de37..f9bd5b879b1 100644 --- a/service/qldbsession/doc.go +++ b/service/qldbsession/doc.go @@ -4,20 +4,20 @@ // Amazon QLDB Session. // // The transactional data APIs for Amazon QLDB Instead of interacting directly with -// this API, we recommend that you use the Amazon QLDB Driver or the QLDB Shell to -// execute data transactions on a ledger. +// this API, we recommend using the QLDB driver or the QLDB shell to execute data +// transactions on a ledger. // -// * If you are working with an AWS SDK, -// use the QLDB Driver. The driver provides a high-level abstraction layer above -// this qldbsession data plane and manages SendCommand API calls for you. For -// information and a list of supported programming languages, see Getting started -// with the driver +// * If you are working with an AWS SDK, use the QLDB +// driver. The driver provides a high-level abstraction layer above this QLDB +// Session data plane and manages SendCommand API calls for you. For information +// and a list of supported programming languages, see Getting started with the +// driver // (https://docs.aws.amazon.com/qldb/latest/developerguide/getting-started-driver.html) // in the Amazon QLDB Developer Guide. // // * If you are working with the AWS Command -// Line Interface (AWS CLI), use the QLDB Shell. The shell is a command line -// interface that uses the QLDB Driver to interact with a ledger. For information, -// see Accessing Amazon QLDB using the QLDB Shell +// Line Interface (AWS CLI), use the QLDB shell. The shell is a command line +// interface that uses the QLDB driver to interact with a ledger. For information, +// see Accessing Amazon QLDB using the QLDB shell // (https://docs.aws.amazon.com/qldb/latest/developerguide/data-shell.html). package qldbsession diff --git a/service/qldbsession/types/types.go b/service/qldbsession/types/types.go index ff6d2e87368..dd7bc5a8616 100644 --- a/service/qldbsession/types/types.go +++ b/service/qldbsession/types/types.go @@ -8,6 +8,9 @@ type AbortTransactionRequest struct { // Contains the details of the aborted transaction. type AbortTransactionResult struct { + + // Contains server-side performance information for the command. + TimingInformation *TimingInformation } // Contains the details of the transaction to commit. @@ -16,7 +19,10 @@ type CommitTransactionRequest struct { // Specifies the commit digest for the transaction to commit. For every active // transaction, the commit digest must be passed. QLDB validates CommitDigest and // rejects the commit with an error if the digest computed on the client does not - // match the digest computed by QLDB. + // match the digest computed by QLDB. The purpose of the CommitDigest parameter is + // to ensure that QLDB commits a transaction if and only if the server has + // processed the exact set of statements sent by the client, in the same order that + // client sent them, and with no duplicates. // // This member is required. CommitDigest []byte @@ -33,6 +39,12 @@ type CommitTransactionResult struct { // The commit digest of the committed transaction. CommitDigest []byte + // Contains metrics about the number of I/O requests that were consumed. + ConsumedIOs *IOUsage + + // Contains server-side performance information for the command. + TimingInformation *TimingInformation + // The transaction ID of the committed transaction. TransactionId *string } @@ -43,6 +55,9 @@ type EndSessionRequest struct { // Contains the details of the ended session. type EndSessionResult struct { + + // Contains server-side performance information for the command. + TimingInformation *TimingInformation } // Specifies a request to execute a statement. @@ -65,8 +80,14 @@ type ExecuteStatementRequest struct { // Contains the details of the executed statement. type ExecuteStatementResult struct { + // Contains metrics about the number of I/O requests that were consumed. + ConsumedIOs *IOUsage + // Contains the details of the first fetched page. FirstPage *Page + + // Contains server-side performance information for the command. + TimingInformation *TimingInformation } // Specifies the details of the page to be fetched. @@ -86,8 +107,24 @@ type FetchPageRequest struct { // Contains the page that was fetched. type FetchPageResult struct { + // Contains metrics about the number of I/O requests that were consumed. + ConsumedIOs *IOUsage + // Contains details of the fetched page. Page *Page + + // Contains server-side performance information for the command. + TimingInformation *TimingInformation +} + +// Contains I/O usage metrics for a command that was invoked. +type IOUsage struct { + + // The number of read I/O requests that the command performed. + ReadIOs int64 + + // The number of write I/O requests that the command performed. + WriteIOs int64 } // Contains details of the fetched page. @@ -115,6 +152,9 @@ type StartSessionResult struct { // Session token of the started session. This SessionToken is required for every // subsequent command that is issued during the current session. SessionToken *string + + // Contains server-side performance information for the command. + TimingInformation *TimingInformation } // Specifies a request to start a transaction. @@ -124,11 +164,24 @@ type StartTransactionRequest struct { // Contains the details of the started transaction. type StartTransactionResult struct { + // Contains server-side performance information for the command. + TimingInformation *TimingInformation + // The transaction ID of the started transaction. TransactionId *string } -// A structure that can contain an Amazon Ion value in multiple encoding formats. +// Contains server-side performance information for a command. Amazon QLDB captures +// timing information between the times when it receives the request and when it +// sends the corresponding response. +type TimingInformation struct { + + // The amount of time that was taken for the command to finish processing, measured + // in milliseconds. + ProcessingTimeMilliseconds int64 +} + +// A structure that can contain a value in multiple encoding formats. type ValueHolder struct { // An Amazon Ion binary value contained in a ValueHolder structure. diff --git a/service/quicksight/api_op_CreateIngestion.go b/service/quicksight/api_op_CreateIngestion.go index 68ec65d7106..2c8091a8631 100644 --- a/service/quicksight/api_op_CreateIngestion.go +++ b/service/quicksight/api_op_CreateIngestion.go @@ -15,7 +15,7 @@ import ( // on tagged datasets inherit the same tags automatically for use in access // control. For an example, see How do I create an IAM policy to control access to // Amazon EC2 resources using tags? -// (https://aws.amazon.com/premiumsupport/knowledge-center/iam-ec2-resource-tags/) +// (http://aws.amazon.com/premiumsupport/knowledge-center/iam-ec2-resource-tags/) // in the AWS Knowledge Center. Tags are visible on the tagged dataset, but not on // the ingestion resource. func (c *Client) CreateIngestion(ctx context.Context, params *CreateIngestionInput, optFns ...func(*Options)) (*CreateIngestionOutput, error) { diff --git a/service/quicksight/api_op_GetDashboardEmbedUrl.go b/service/quicksight/api_op_GetDashboardEmbedUrl.go index 52970b34f7f..327f00b0729 100644 --- a/service/quicksight/api_op_GetDashboardEmbedUrl.go +++ b/service/quicksight/api_op_GetDashboardEmbedUrl.go @@ -29,9 +29,9 @@ import ( // resulting user session is valid for 10 hours. // // For more information, see -// Embedding Amazon QuickSight -// (https://docs.aws.amazon.com/quicksight/latest/user/embedding-dashboards.html) -// in the Amazon QuickSight User Guide . +// Embedded Analytics +// (https://docs.aws.amazon.com/quicksight/latest/user/embedded-analytics.html) in +// the Amazon QuickSight User Guide. func (c *Client) GetDashboardEmbedUrl(ctx context.Context, params *GetDashboardEmbedUrlInput, optFns ...func(*Options)) (*GetDashboardEmbedUrlOutput, error) { if params == nil { params = &GetDashboardEmbedUrlInput{} @@ -47,7 +47,6 @@ func (c *Client) GetDashboardEmbedUrl(ctx context.Context, params *GetDashboardE return out, nil } -// Parameter input for the GetDashboardEmbedUrl operation. type GetDashboardEmbedUrlInput struct { // The ID for the AWS account that contains the dashboard that you're embedding. @@ -55,7 +54,8 @@ type GetDashboardEmbedUrlInput struct { // This member is required. AwsAccountId *string - // The ID for the dashboard, also added to the IAM policy. + // The ID for the dashboard, also added to the AWS Identity and Access Management + // (IAM) policy. // // This member is required. DashboardId *string @@ -65,11 +65,11 @@ type GetDashboardEmbedUrlInput struct { // This member is required. IdentityType types.EmbeddingIdentityType - // A list of one or more dashboard ids that you want to add to a session that - // includes anonymous authorizations. IdentityType must be set to ANONYMOUS for - // this to work, because other identity types authenticate as QuickSight users. For - // example, if you set "--dashboard-id dash_id1 --dashboard-id dash_id2 dash_id3 - // identity-type ANONYMOUS", the session can access all three dashboards. + // A list of one or more dashboard IDs that you want to add to a session that + // includes anonymous users. The IdentityType parameter must be set to ANONYMOUS + // for this to work, because other identity types authenticate as QuickSight or IAM + // users. For example, if you set "--dashboard-id dash_id1 --dashboard-id dash_id2 + // dash_id3 identity-type ANONYMOUS", the session can access all three dashboards. AdditionalDashboardIds []string // The QuickSight namespace that contains the dashboard IDs in this request. If @@ -87,7 +87,7 @@ type GetDashboardEmbedUrlInput struct { // Adds persistence of state for the user session in an embedded dashboard. // Persistence applies to the sheet and the parameter settings. These are control // settings that the dashboard subscriber (QuickSight reader) chooses while viewing - // the dashboard. If this is set to TRUE, the settings are the same when the the + // the dashboard. If this is set to TRUE, the settings are the same when the // subscriber reopens the same dashboard URL. The state is stored in QuickSight, // not in a browser cookie. If this is set to FALSE, the state of the user session // is not persisted. The default is FALSE. diff --git a/service/quicksight/api_op_GetSessionEmbedUrl.go b/service/quicksight/api_op_GetSessionEmbedUrl.go index fbd9a667cc2..a0fcb77269b 100644 --- a/service/quicksight/api_op_GetSessionEmbedUrl.go +++ b/service/quicksight/api_op_GetSessionEmbedUrl.go @@ -83,12 +83,12 @@ type GetSessionEmbedUrlInput struct { // * Invited // nonfederated users // - // * IAM users and IAM role-based sessions authenticated - // through Federated Single Sign-On using SAML, OpenID Connect, or IAM - // federation + // * AWS Identity and Access Management (IAM) users and IAM + // role-based sessions authenticated through Federated Single Sign-On using SAML, + // OpenID Connect, or IAM federation // - // Omit this parameter for users in the third group – IAM users and IAM - // role-based sessions. + // Omit this parameter for users in the third + // group, IAM users and IAM role-based sessions. UserArn *string } diff --git a/service/quicksight/api_op_RegisterUser.go b/service/quicksight/api_op_RegisterUser.go index bd4610cb887..8e2ab69f3a8 100644 --- a/service/quicksight/api_op_RegisterUser.go +++ b/service/quicksight/api_op_RegisterUser.go @@ -113,8 +113,8 @@ type RegisterUserInput struct { // QuickSight user. You can register multiple users using the same IAM role if each // user has a different session name. For more information on assuming IAM roles, // see assume-role - // (https://awscli.amazonaws.com/v2/documentation/api/latest/reference/sts/assume-role.html) - // in the AWS CLI Reference. + // (https://docs.aws.amazon.com/cli/latest/reference/sts/assume-role.html) in the + // AWS CLI Reference. SessionName *string // The Amazon QuickSight user name that you want to create for the user you are diff --git a/service/quicksight/deserializers.go b/service/quicksight/deserializers.go index 57b2baaeb43..418ba505a1d 100644 --- a/service/quicksight/deserializers.go +++ b/service/quicksight/deserializers.go @@ -26201,6 +26201,15 @@ func awsRestjson1_deserializeDocumentRelationalTable(v **types.RelationalTable, for key, value := range shape { switch key { + case "Catalog": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RelationalTableCatalog to be of type string, got %T instead", value) + } + sv.Catalog = ptr.String(jtv) + } + case "DataSourceArn": if value != nil { jtv, ok := value.(string) diff --git a/service/quicksight/serializers.go b/service/quicksight/serializers.go index a9c63b47c6b..d0f81872690 100644 --- a/service/quicksight/serializers.go +++ b/service/quicksight/serializers.go @@ -10326,6 +10326,11 @@ func awsRestjson1_serializeDocumentRelationalTable(v *types.RelationalTable, val object := value.Object() defer object.Close() + if v.Catalog != nil { + ok := object.Key("Catalog") + ok.String(*v.Catalog) + } + if v.DataSourceArn != nil { ok := object.Key("DataSourceArn") ok.String(*v.DataSourceArn) diff --git a/service/quicksight/types/errors.go b/service/quicksight/types/errors.go index 448248edcc0..b0b305d5509 100644 --- a/service/quicksight/types/errors.go +++ b/service/quicksight/types/errors.go @@ -335,10 +335,10 @@ func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.Fau // This error indicates that you are calling an embedding operation in Amazon // QuickSight without the required pricing plan on your AWS account. Before you can -// use anonymous embedding, a QuickSight administrator needs to add capacity -// pricing to QuickSight. You can do this on the Manage QuickSight page. After -// capacity pricing is added, you can enable anonymous embedding by using the -// GetDashboardEmbedUrl API operation with the --identity-type ANONYMOUS option. +// use embedding for anonymous users, a QuickSight administrator needs to add +// capacity pricing to QuickSight. You can do this on the Manage QuickSight page. +// After capacity pricing is added, you can use the GetDashboardEmbedUrl API +// operation with the --identity-type ANONYMOUS option. type UnsupportedPricingPlanException struct { Message *string diff --git a/service/quicksight/types/types.go b/service/quicksight/types/types.go index e51117da4b0..5b29a988f50 100644 --- a/service/quicksight/types/types.go +++ b/service/quicksight/types/types.go @@ -603,7 +603,7 @@ type DataSet struct { // The ID of the dataset. DataSetId *string - // Indicates whether you want to import the data into SPICE. + // A value that indicates whether you want to import the data into SPICE. ImportMode DataSetImportMode // The last time that this dataset was updated. @@ -667,7 +667,7 @@ type DataSetSummary struct { // The Amazon Resource Name (ARN) of the dataset. Arn *string - // Indicates if the dataset has column level permission configured. + // A value that indicates if the dataset has column level permission configured. ColumnLevelPermissionRulesApplied bool // The time that this dataset was created. @@ -676,7 +676,7 @@ type DataSetSummary struct { // The ID of the dataset. DataSetId *string - // Indicates whether you want to import the data into SPICE. + // A value that indicates whether you want to import the data into SPICE. ImportMode DataSetImportMode // The last time that this dataset was updated. @@ -1192,8 +1192,8 @@ type JoinInstruction struct { // Properties associated with the columns participating in a join. type JoinKeyProperties struct { - // Indicates that a row in a table is uniquely identified by the columns in a join - // key. This is used by QuickSight to optimize query performance. + // A value that indicates that a row in a table is uniquely identified by the + // columns in a join key. This is used by QuickSight to optimize query performance. UniqueKey bool } @@ -1516,6 +1516,9 @@ type RelationalTable struct { // This member is required. Name *string + // The catalog associated with a table. + Catalog *string + // The schema name. This name applies to certain relational database engines. Schema *string } diff --git a/service/ram/types/enums.go b/service/ram/types/enums.go index 5889886641b..edec75d3f80 100644 --- a/service/ram/types/enums.go +++ b/service/ram/types/enums.go @@ -22,6 +22,15 @@ func (ResourceOwner) Values() []ResourceOwner { type ResourceShareAssociationStatus string +// Enum values for ResourceShareAssociationStatus +const ( + ResourceShareAssociationStatusAssociating ResourceShareAssociationStatus = "ASSOCIATING" + ResourceShareAssociationStatusAssociated ResourceShareAssociationStatus = "ASSOCIATED" + ResourceShareAssociationStatusFailed ResourceShareAssociationStatus = "FAILED" + ResourceShareAssociationStatusDisassociating ResourceShareAssociationStatus = "DISASSOCIATING" + ResourceShareAssociationStatusDisassociated ResourceShareAssociationStatus = "DISASSOCIATED" +) + // Values returns all known values for ResourceShareAssociationStatus. 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 @@ -38,6 +47,12 @@ func (ResourceShareAssociationStatus) Values() []ResourceShareAssociationStatus type ResourceShareAssociationType string +// Enum values for ResourceShareAssociationType +const ( + ResourceShareAssociationTypePrincipal ResourceShareAssociationType = "PRINCIPAL" + ResourceShareAssociationTypeResource ResourceShareAssociationType = "RESOURCE" +) + // Values returns all known values for ResourceShareAssociationType. 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. @@ -50,6 +65,13 @@ func (ResourceShareAssociationType) Values() []ResourceShareAssociationType { type ResourceShareFeatureSet string +// Enum values for ResourceShareFeatureSet +const ( + ResourceShareFeatureSetCreatedFromPolicy ResourceShareFeatureSet = "CREATED_FROM_POLICY" + ResourceShareFeatureSetPromotingToStandard ResourceShareFeatureSet = "PROMOTING_TO_STANDARD" + ResourceShareFeatureSetStandard ResourceShareFeatureSet = "STANDARD" +) + // Values returns all known values for ResourceShareFeatureSet. 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. @@ -63,6 +85,14 @@ func (ResourceShareFeatureSet) Values() []ResourceShareFeatureSet { type ResourceShareInvitationStatus string +// Enum values for ResourceShareInvitationStatus +const ( + ResourceShareInvitationStatusPending ResourceShareInvitationStatus = "PENDING" + ResourceShareInvitationStatusAccepted ResourceShareInvitationStatus = "ACCEPTED" + ResourceShareInvitationStatusRejected ResourceShareInvitationStatus = "REJECTED" + ResourceShareInvitationStatusExpired ResourceShareInvitationStatus = "EXPIRED" +) + // Values returns all known values for ResourceShareInvitationStatus. 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 @@ -78,6 +108,15 @@ func (ResourceShareInvitationStatus) Values() []ResourceShareInvitationStatus { type ResourceShareStatus string +// Enum values for ResourceShareStatus +const ( + ResourceShareStatusPending ResourceShareStatus = "PENDING" + ResourceShareStatusActive ResourceShareStatus = "ACTIVE" + ResourceShareStatusFailed ResourceShareStatus = "FAILED" + ResourceShareStatusDeleting ResourceShareStatus = "DELETING" + ResourceShareStatusDeleted ResourceShareStatus = "DELETED" +) + // Values returns all known values for ResourceShareStatus. 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. @@ -93,6 +132,15 @@ func (ResourceShareStatus) Values() []ResourceShareStatus { type ResourceStatus string +// Enum values for ResourceStatus +const ( + ResourceStatusAvailable ResourceStatus = "AVAILABLE" + ResourceStatusZonalResourceInaccessible ResourceStatus = "ZONAL_RESOURCE_INACCESSIBLE" + ResourceStatusLimitExceeded ResourceStatus = "LIMIT_EXCEEDED" + ResourceStatusUnavailable ResourceStatus = "UNAVAILABLE" + ResourceStatusPending ResourceStatus = "PENDING" +) + // Values returns all known values for ResourceStatus. 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. diff --git a/service/rds/api_op_CopyDBSnapshot.go b/service/rds/api_op_CopyDBSnapshot.go index 3bf5799ee7c..3850ae7b632 100644 --- a/service/rds/api_op_CopyDBSnapshot.go +++ b/service/rds/api_op_CopyDBSnapshot.go @@ -101,7 +101,7 @@ type CopyDBSnapshotInput struct { // your DB instance uses a nondefault option group. If your source DB instance uses // Transparent Data Encryption for Oracle or Microsoft SQL Server, you must specify // this option when copying across AWS Regions. For more information, see Option - // Group Considerations + // group considerations // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_CopySnapshot.html#USER_CopySnapshot.Options) // in the Amazon RDS User Guide. OptionGroupName *string diff --git a/service/rds/api_op_CreateDBInstance.go b/service/rds/api_op_CreateDBInstance.go index c5924cca049..5252ef0e0c9 100644 --- a/service/rds/api_op_CreateDBInstance.go +++ b/service/rds/api_op_CreateDBInstance.go @@ -245,35 +245,35 @@ type CreateDBInstanceInput struct { // reserved by the specified database engine // // PostgreSQL The name of the database - // to create when the DB instance is created. If this parameter isn't specified, - // the default "postgres" database is created in the DB instance. Constraints: + // to create when the DB instance is created. If this parameter isn't specified, no + // database is created in the DB instance. Constraints: // - // * - // Must contain 1 to 63 letters, numbers, or underscores. + // * Must contain 1 to 63 + // letters, numbers, or underscores. // - // * Must begin with a - // letter. Subsequent characters can be letters, underscores, or digits (0-9). + // * Must begin with a letter. Subsequent + // characters can be letters, underscores, or digits (0-9). // - // * - // Can't be a word reserved by the specified database engine + // * Can't be a word + // reserved by the specified database engine // - // Oracle The Oracle - // System ID (SID) of the created DB instance. If you specify null, the default - // value ORCL is used. You can't specify the string NULL, or any other reserved - // word, for DBName. Default: ORCL Constraints: + // Oracle The Oracle System ID (SID) of + // the created DB instance. If you specify null, the default value ORCL is used. + // You can't specify the string NULL, or any other reserved word, for DBName. + // Default: ORCL Constraints: // - // * Can't be longer than 8 - // characters + // * Can't be longer than 8 characters // - // SQL Server Not applicable. Must be null. Amazon Aurora The name of - // the database to create when the primary instance of the DB cluster is created. - // If this parameter isn't specified, no database is created in the DB instance. - // Constraints: + // SQL Server Not + // applicable. Must be null. Amazon Aurora The name of the database to create when + // the primary instance of the DB cluster is created. If this parameter isn't + // specified, no database is created in the DB instance. Constraints: // - // * Must contain 1 to 64 letters or numbers. + // * Must + // contain 1 to 64 letters or numbers. // - // * Can't be a word - // reserved by the specified database engine + // * Can't be a word reserved by the specified + // database engine DBName *string // The name of the DB parameter group to associate with this DB instance. If you do @@ -332,6 +332,19 @@ type CreateDBInstanceInput struct { // trace. PostgreSQL Possible values are postgresql and upgrade. EnableCloudwatchLogsExports []string + // A value that indicates whether to enable a customer-owned IP address (CoIP) for + // an RDS on Outposts DB instance. A CoIP provides local or external connectivity + // to resources in your Outpost subnets through your on-premises network. For some + // use cases, a CoIP can provide lower latency for connections to the DB instance + // from outside of its virtual private cloud (VPC) on your local network. For more + // information about RDS on Outposts, see Working with Amazon RDS on AWS Outposts + // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-on-outposts.html) in + // the Amazon RDS User Guide. For more information about CoIPs, see Customer-owned + // IP addresses + // (https://docs.aws.amazon.com/outposts/latest/userguide/outposts-networking-components.html#ip-addressing) + // in the AWS Outposts User Guide. + EnableCustomerOwnedIp *bool + // A value that indicates whether to enable mapping of AWS Identity and Access // Management (IAM) accounts to database accounts. By default, mapping is disabled. // This setting doesn't apply to Amazon Aurora. Mapping AWS IAM accounts to diff --git a/service/rds/api_op_CreateDBInstanceReadReplica.go b/service/rds/api_op_CreateDBInstanceReadReplica.go index 8a264c30d69..13d194bc620 100644 --- a/service/rds/api_op_CreateDBInstanceReadReplica.go +++ b/service/rds/api_op_CreateDBInstanceReadReplica.go @@ -201,13 +201,13 @@ type CreateDBInstanceReadReplicaInput struct { // The AWS KMS key identifier for an encrypted read replica. The AWS KMS key // identifier is the key ARN, key ID, alias ARN, or alias name for the AWS KMS CMK. // If you create an encrypted read replica in the same AWS Region as the source DB - // instance, then you do not have to specify a value for this parameter. The read - // replica is encrypted with the same AWS KMS CMK as the source DB instance. If you - // create an encrypted read replica in a different AWS Region, then you must - // specify a AWS KMS key identifier for the destination AWS Region. AWS KMS CMKs - // are specific to the AWS Region that they are created in, and you can't use CMKs - // from one AWS Region in another AWS Region. You can't create an encrypted read - // replica from an unencrypted DB instance. + // instance, then do not specify a value for this parameter. A read replica in the + // same Region is always encrypted with the same AWS KMS CMK as the source DB + // instance. If you create an encrypted read replica in a different AWS Region, + // then you must specify a AWS KMS key identifier for the destination AWS Region. + // AWS KMS CMKs are specific to the AWS Region that they are created in, and you + // can't use CMKs from one AWS Region in another AWS Region. You can't create an + // encrypted read replica from an unencrypted DB instance. KmsKeyId *string // The upper limit to which Amazon RDS can automatically scale the storage of the diff --git a/service/rds/api_op_DescribeDBInstanceAutomatedBackups.go b/service/rds/api_op_DescribeDBInstanceAutomatedBackups.go index e7f84716b48..f8c6a5c265f 100644 --- a/service/rds/api_op_DescribeDBInstanceAutomatedBackups.go +++ b/service/rds/api_op_DescribeDBInstanceAutomatedBackups.go @@ -57,24 +57,23 @@ type DescribeDBInstanceAutomatedBackupsInput struct { // * active - automated backups for current // instances // - // * retained - automated backups for deleted instances + // * retained - automated backups for deleted instances and after backup + // replication is stopped // - // * creating - - // automated backups that are waiting for the first automated snapshot to be - // available + // * creating - automated backups that are waiting for the + // first automated snapshot to be available // - // * db-instance-id - Accepts DB instance identifiers and Amazon - // Resource Names (ARNs) for DB instances. The results list includes only - // information about the DB instance automated backupss identified by these - // ARNs. + // * db-instance-id - Accepts DB instance + // identifiers and Amazon Resource Names (ARNs). The results list includes only + // information about the DB instance automated backups identified by these ARNs. // - // * dbi-resource-id - Accepts DB instance resource identifiers and DB - // Amazon Resource Names (ARNs) for DB instances. The results list includes only - // information about the DB instance resources identified by these ARNs. + // * + // dbi-resource-id - Accepts DB resource identifiers and Amazon Resource Names + // (ARNs). The results list includes only information about the DB instance + // resources identified by these ARNs. // - // Returns - // all resources by default. The status for each resource is specified in the - // response. + // Returns all resources by default. The + // status for each resource is specified in the response. Filters []types.Filter // The pagination token provided in the previous request. If this parameter is diff --git a/service/rds/api_op_DescribeSourceRegions.go b/service/rds/api_op_DescribeSourceRegions.go index d36e3f2a37f..bbc6031b3ab 100644 --- a/service/rds/api_op_DescribeSourceRegions.go +++ b/service/rds/api_op_DescribeSourceRegions.go @@ -13,7 +13,8 @@ import ( ) // Returns a list of the source AWS Regions where the current AWS Region can create -// a read replica or copy a DB snapshot from. This API action supports pagination. +// a read replica, copy a DB snapshot from, or replicate automated backups from. +// This API action supports pagination. func (c *Client) DescribeSourceRegions(ctx context.Context, params *DescribeSourceRegionsInput, optFns ...func(*Options)) (*DescribeSourceRegionsOutput, error) { if params == nil { params = &DescribeSourceRegionsInput{} diff --git a/service/rds/api_op_ModifyDBInstance.go b/service/rds/api_op_ModifyDBInstance.go index c11cdb5f697..4ae75e815bf 100644 --- a/service/rds/api_op_ModifyDBInstance.go +++ b/service/rds/api_op_ModifyDBInstance.go @@ -180,8 +180,8 @@ type ModifyDBInstanceInput struct { // The new DB subnet group for the DB instance. You can use this parameter to move // your DB instance to a different VPC. If your DB instance isn't in a VPC, you can // also use this parameter to move your DB instance into a VPC. For more - // information, see Updating the VPC for a DB Instance - // (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html#USER_VPC.Non-VPC2VPC) + // information, see Working with a DB instance in a VPC + // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html#USER_VPC.Non-VPC2VPC) // in the Amazon RDS User Guide. Changing the subnet group causes an outage during // the change. The change is applied during the next maintenance window, unless you // enable ApplyImmediately. Constraints: If supplied, must match the name of an @@ -207,6 +207,19 @@ type ModifyDBInstanceInput struct { // The name of the IAM role to use when making API calls to the Directory Service. DomainIAMRoleName *string + // A value that indicates whether to enable a customer-owned IP address (CoIP) for + // an RDS on Outposts DB instance. A CoIP provides local or external connectivity + // to resources in your Outpost subnets through your on-premises network. For some + // use cases, a CoIP can provide lower latency for connections to the DB instance + // from outside of its virtual private cloud (VPC) on your local network. For more + // information about RDS on Outposts, see Working with Amazon RDS on AWS Outposts + // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-on-outposts.html) in + // the Amazon RDS User Guide. For more information about CoIPs, see Customer-owned + // IP addresses + // (https://docs.aws.amazon.com/outposts/latest/userguide/outposts-networking-components.html#ip-addressing) + // in the AWS Outposts User Guide. + EnableCustomerOwnedIp *bool + // A value that indicates whether to enable mapping of AWS Identity and Access // Management (IAM) accounts to database accounts. By default, mapping is disabled. // This setting doesn't apply to Amazon Aurora. Mapping AWS IAM accounts to diff --git a/service/rds/api_op_ModifyDBSnapshot.go b/service/rds/api_op_ModifyDBSnapshot.go index 86129a9a0cb..3bbcb012e18 100644 --- a/service/rds/api_op_ModifyDBSnapshot.go +++ b/service/rds/api_op_ModifyDBSnapshot.go @@ -61,8 +61,8 @@ type ModifyDBSnapshotInput struct { // The option group to identify with the upgraded DB snapshot. You can specify this // parameter when you upgrade an Oracle DB snapshot. The same option group // considerations apply when upgrading a DB snapshot as when upgrading a DB - // instance. For more information, see Option Group Considerations - // (http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Oracle.html#USER_UpgradeDBInstance.Oracle.OGPG.OG) + // instance. For more information, see Option group considerations + // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_UpgradeDBInstance.Oracle.html#USER_UpgradeDBInstance.Oracle.OGPG.OG) // in the Amazon RDS User Guide. OptionGroupName *string } diff --git a/service/rds/api_op_RestoreDBInstanceFromDBSnapshot.go b/service/rds/api_op_RestoreDBInstanceFromDBSnapshot.go index 61a2f83c724..2174e065cde 100644 --- a/service/rds/api_op_RestoreDBInstanceFromDBSnapshot.go +++ b/service/rds/api_op_RestoreDBInstanceFromDBSnapshot.go @@ -147,6 +147,19 @@ type RestoreDBInstanceFromDBSnapshotInput struct { // in the Amazon RDS User Guide. EnableCloudwatchLogsExports []string + // A value that indicates whether to enable a customer-owned IP address (CoIP) for + // an RDS on Outposts DB instance. A CoIP provides local or external connectivity + // to resources in your Outpost subnets through your on-premises network. For some + // use cases, a CoIP can provide lower latency for connections to the DB instance + // from outside of its virtual private cloud (VPC) on your local network. For more + // information about RDS on Outposts, see Working with Amazon RDS on AWS Outposts + // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-on-outposts.html) in + // the Amazon RDS User Guide. For more information about CoIPs, see Customer-owned + // IP addresses + // (https://docs.aws.amazon.com/outposts/latest/userguide/outposts-networking-components.html#ip-addressing) + // in the AWS Outposts User Guide. + EnableCustomerOwnedIp *bool + // A value that indicates whether to enable mapping of AWS Identity and Access // Management (IAM) accounts to database accounts. By default, mapping is disabled. // For more information about IAM database authentication, see IAM Database diff --git a/service/rds/api_op_RestoreDBInstanceToPointInTime.go b/service/rds/api_op_RestoreDBInstanceToPointInTime.go index 455600deb6e..511c1a0a651 100644 --- a/service/rds/api_op_RestoreDBInstanceToPointInTime.go +++ b/service/rds/api_op_RestoreDBInstanceToPointInTime.go @@ -127,6 +127,19 @@ type RestoreDBInstanceToPointInTimeInput struct { // in the Amazon RDS User Guide. EnableCloudwatchLogsExports []string + // A value that indicates whether to enable a customer-owned IP address (CoIP) for + // an RDS on Outposts DB instance. A CoIP provides local or external connectivity + // to resources in your Outpost subnets through your on-premises network. For some + // use cases, a CoIP can provide lower latency for connections to the DB instance + // from outside of its virtual private cloud (VPC) on your local network. For more + // information about RDS on Outposts, see Working with Amazon RDS on AWS Outposts + // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-on-outposts.html) in + // the Amazon RDS User Guide. For more information about CoIPs, see Customer-owned + // IP addresses + // (https://docs.aws.amazon.com/outposts/latest/userguide/outposts-networking-components.html#ip-addressing) + // in the AWS Outposts User Guide. + EnableCustomerOwnedIp *bool + // A value that indicates whether to enable mapping of AWS Identity and Access // Management (IAM) accounts to database accounts. By default, mapping is disabled. // For more information about IAM database authentication, see IAM Database diff --git a/service/rds/deserializers.go b/service/rds/deserializers.go index 446c9024e30..9dab96aefc1 100644 --- a/service/rds/deserializers.go +++ b/service/rds/deserializers.go @@ -21491,6 +21491,103 @@ func awsAwsquery_deserializeDocumentCharacterSet(v **types.CharacterSet, decoder return nil } +func awsAwsquery_deserializeDocumentClusterPendingModifiedValues(v **types.ClusterPendingModifiedValues, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ClusterPendingModifiedValues + if *v == nil { + sv = &types.ClusterPendingModifiedValues{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DBClusterIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DBClusterIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("EngineVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.EngineVersion = ptr.String(xtv) + } + + case strings.EqualFold("IAMDatabaseAuthenticationEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.IAMDatabaseAuthenticationEnabled = ptr.Bool(xtv) + } + + case strings.EqualFold("MasterUserPassword", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MasterUserPassword = ptr.String(xtv) + } + + case strings.EqualFold("PendingCloudwatchLogsExports", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentPendingCloudwatchLogsExports(&sv.PendingCloudwatchLogsExports, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsAwsquery_deserializeDocumentConnectionPoolConfigurationInfo(v **types.ConnectionPoolConfigurationInfo, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -22482,6 +22579,12 @@ func awsAwsquery_deserializeDocumentDBCluster(v **types.DBCluster, decoder smith sv.MultiAZ = ptr.Bool(xtv) } + case strings.EqualFold("PendingModifiedValues", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsAwsquery_deserializeDocumentClusterPendingModifiedValues(&sv.PendingModifiedValues, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("PercentProgress", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -25336,6 +25439,22 @@ func awsAwsquery_deserializeDocumentDBInstance(v **types.DBInstance, decoder smi sv.CopyTagsToSnapshot = xtv } + case strings.EqualFold("CustomerOwnedIpEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.CustomerOwnedIpEnabled = ptr.Bool(xtv) + } + case strings.EqualFold("DBClusterIdentifier", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -38100,6 +38219,22 @@ func awsAwsquery_deserializeDocumentPendingModifiedValues(v **types.PendingModif sv.EngineVersion = ptr.String(xtv) } + case strings.EqualFold("IAMDatabaseAuthenticationEnabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected BooleanOptional to be of type *bool, got %T instead", val) + } + sv.IAMDatabaseAuthenticationEnabled = ptr.Bool(xtv) + } + case strings.EqualFold("Iops", t.Name.Local): val, err := decoder.Value() if err != nil { diff --git a/service/rds/serializers.go b/service/rds/serializers.go index e259f271667..4c70cd69fa8 100644 --- a/service/rds/serializers.go +++ b/service/rds/serializers.go @@ -8638,6 +8638,11 @@ func awsAwsquery_serializeOpDocumentCreateDBInstanceInput(v *CreateDBInstanceInp } } + if v.EnableCustomerOwnedIp != nil { + objectKey := object.Key("EnableCustomerOwnedIp") + objectKey.Boolean(*v.EnableCustomerOwnedIp) + } + if v.EnableIAMDatabaseAuthentication != nil { objectKey := object.Key("EnableIAMDatabaseAuthentication") objectKey.Boolean(*v.EnableIAMDatabaseAuthentication) @@ -11293,6 +11298,11 @@ func awsAwsquery_serializeOpDocumentModifyDBInstanceInput(v *ModifyDBInstanceInp objectKey.String(*v.DomainIAMRoleName) } + if v.EnableCustomerOwnedIp != nil { + objectKey := object.Key("EnableCustomerOwnedIp") + objectKey.Boolean(*v.EnableCustomerOwnedIp) + } + if v.EnableIAMDatabaseAuthentication != nil { objectKey := object.Key("EnableIAMDatabaseAuthentication") objectKey.Boolean(*v.EnableIAMDatabaseAuthentication) @@ -12420,6 +12430,11 @@ func awsAwsquery_serializeOpDocumentRestoreDBInstanceFromDBSnapshotInput(v *Rest } } + if v.EnableCustomerOwnedIp != nil { + objectKey := object.Key("EnableCustomerOwnedIp") + objectKey.Boolean(*v.EnableCustomerOwnedIp) + } + if v.EnableIAMDatabaseAuthentication != nil { objectKey := object.Key("EnableIAMDatabaseAuthentication") objectKey.Boolean(*v.EnableIAMDatabaseAuthentication) @@ -12802,6 +12817,11 @@ func awsAwsquery_serializeOpDocumentRestoreDBInstanceToPointInTimeInput(v *Resto } } + if v.EnableCustomerOwnedIp != nil { + objectKey := object.Key("EnableCustomerOwnedIp") + objectKey.Boolean(*v.EnableCustomerOwnedIp) + } + if v.EnableIAMDatabaseAuthentication != nil { objectKey := object.Key("EnableIAMDatabaseAuthentication") objectKey.Boolean(*v.EnableIAMDatabaseAuthentication) diff --git a/service/rds/types/enums.go b/service/rds/types/enums.go index 91b3ad7a6eb..838254c594b 100644 --- a/service/rds/types/enums.go +++ b/service/rds/types/enums.go @@ -4,6 +4,12 @@ package types type ActivityStreamMode string +// Enum values for ActivityStreamMode +const ( + ActivityStreamModeSync ActivityStreamMode = "sync" + ActivityStreamModeAsync ActivityStreamMode = "async" +) + // Values returns all known values for ActivityStreamMode. 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. @@ -16,6 +22,14 @@ func (ActivityStreamMode) Values() []ActivityStreamMode { type ActivityStreamStatus string +// Enum values for ActivityStreamStatus +const ( + ActivityStreamStatusStopped ActivityStreamStatus = "stopped" + ActivityStreamStatusStarting ActivityStreamStatus = "starting" + ActivityStreamStatusStarted ActivityStreamStatus = "started" + ActivityStreamStatusStopping ActivityStreamStatus = "stopping" +) + // Values returns all known values for ActivityStreamStatus. 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. @@ -30,6 +44,12 @@ func (ActivityStreamStatus) Values() []ActivityStreamStatus { type ApplyMethod string +// Enum values for ApplyMethod +const ( + ApplyMethodImmediate ApplyMethod = "immediate" + ApplyMethodPendingReboot ApplyMethod = "pending-reboot" +) + // Values returns all known values for ApplyMethod. 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. @@ -144,6 +164,16 @@ func (ReplicaMode) Values() []ReplicaMode { type SourceType string +// Enum values for SourceType +const ( + SourceTypeDbInstance SourceType = "db-instance" + SourceTypeDbParameterGroup SourceType = "db-parameter-group" + SourceTypeDbSecurityGroup SourceType = "db-security-group" + SourceTypeDbSnapshot SourceType = "db-snapshot" + SourceTypeDbCluster SourceType = "db-cluster" + SourceTypeDbClusterSnapshot SourceType = "db-cluster-snapshot" +) + // Values returns all known values for SourceType. 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. diff --git a/service/rds/types/errors.go b/service/rds/types/errors.go index 982706dca9a..42b3c0c7df2 100644 --- a/service/rds/types/errors.go +++ b/service/rds/types/errors.go @@ -1053,7 +1053,8 @@ func (e *ExportTaskNotFoundFault) ErrorMessage() string { func (e *ExportTaskNotFoundFault) ErrorCode() string { return "ExportTaskNotFoundFault" } func (e *ExportTaskNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// +// The GlobalClusterIdentifier already exists. Choose a new global database +// identifier (unique name) to create a new global database cluster. type GlobalClusterAlreadyExistsFault struct { Message *string } @@ -1072,7 +1073,8 @@ func (e *GlobalClusterAlreadyExistsFault) ErrorCode() string { } func (e *GlobalClusterAlreadyExistsFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// +// The GlobalClusterIdentifier doesn't refer to an existing global database +// cluster. type GlobalClusterNotFoundFault struct { Message *string } @@ -1089,7 +1091,8 @@ func (e *GlobalClusterNotFoundFault) ErrorMessage() string { func (e *GlobalClusterNotFoundFault) ErrorCode() string { return "GlobalClusterNotFoundFault" } func (e *GlobalClusterNotFoundFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// +// The number of global database clusters for this account is already at the +// maximum allowed. type GlobalClusterQuotaExceededFault struct { Message *string } @@ -1604,7 +1607,8 @@ func (e *InvalidExportTaskStateFault) ErrorMessage() string { func (e *InvalidExportTaskStateFault) ErrorCode() string { return "InvalidExportTaskStateFault" } func (e *InvalidExportTaskStateFault) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// +// The global cluster is in an invalid state and can't perform the requested +// operation. type InvalidGlobalClusterStateFault struct { Message *string } diff --git a/service/rds/types/types.go b/service/rds/types/types.go index 53984601425..8cc68fcd4dd 100644 --- a/service/rds/types/types.go +++ b/service/rds/types/types.go @@ -194,6 +194,28 @@ type CloudwatchLogsExportConfiguration struct { EnableLogTypes []string } +// This data type is used as a response element in the ModifyDBCluster operation +// and contains changes that will be applied during the next maintenance window. +type ClusterPendingModifiedValues struct { + + // The DBClusterIdentifier for the DB cluster. + DBClusterIdentifier *string + + // The database engine version. + EngineVersion *string + + // Whether mapping of AWS Identity and Access Management (IAM) accounts to database + // accounts is enabled. + IAMDatabaseAuthenticationEnabled *bool + + // The master credentials for the DB cluster. + MasterUserPassword *string + + // A list of the log types whose configuration is still pending. In other words, + // these log types are in the process of being activated or deactivated. + PendingCloudwatchLogsExports *PendingCloudwatchLogsExports +} + // Specifies the settings that control the size and behavior of the connection pool // associated with a DBProxyTargetGroup. type ConnectionPoolConfiguration struct { @@ -477,6 +499,11 @@ type DBCluster struct { // Specifies whether the DB cluster has instances in multiple Availability Zones. MultiAZ *bool + // Specifies that changes to the DB cluster are pending. This element is only + // included when changes are pending. Specific changes are identified by + // subelements. + PendingModifiedValues *ClusterPendingModifiedValues + // Specifies the progress of the operation as a percentage. PercentProgress *string @@ -919,6 +946,19 @@ type DBInstance struct { // the DB cluster setting. For more information, see DBCluster. CopyTagsToSnapshot bool + // Specifies whether a customer-owned IP address (CoIP) is enabled for an RDS on + // Outposts DB instance. A CoIP provides local or external connectivity to + // resources in your Outpost subnets through your on-premises network. For some use + // cases, a CoIP can provide lower latency for connections to the DB instance from + // outside of its virtual private cloud (VPC) on your local network. For more + // information about RDS on Outposts, see Working with Amazon RDS on AWS Outposts + // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-on-outposts.html) in + // the Amazon RDS User Guide. For more information about CoIPs, see Customer-owned + // IP addresses + // (https://docs.aws.amazon.com/outposts/latest/userguide/outposts-networking-components.html#ip-addressing) + // in the AWS Outposts User Guide. + CustomerOwnedIpEnabled *bool + // If the DB instance is a member of a DB cluster, contains the name of the DB // cluster that the DB instance is a member of. DBClusterIdentifier *string @@ -2548,60 +2588,60 @@ type PendingMaintenanceAction struct { OptInStatus *string } -// This data type is used as a response element in the ModifyDBInstance action. +// This data type is used as a response element in the ModifyDBInstance action and +// contains changes that will be applied during the next maintenance window. type PendingModifiedValues struct { - // Contains the new AllocatedStorage size for the DB instance that will be applied - // or is currently being applied. + // The allocated storage size for the DB instance specified in gibibytes . AllocatedStorage *int32 - // Specifies the pending number of days for which automated backups are retained. + // The number of days for which automated backups are retained. BackupRetentionPeriod *int32 - // Specifies the identifier of the CA certificate for the DB instance. + // The identifier of the CA certificate for the DB instance. CACertificateIdentifier *string - // Contains the new DBInstanceClass for the DB instance that will be applied or is - // currently being applied. + // The name of the compute and memory capacity class for the DB instance. DBInstanceClass *string - // Contains the new DBInstanceIdentifier for the DB instance that will be applied - // or is currently being applied. + // The database identifier for the DB instance. DBInstanceIdentifier *string - // The new DB subnet group for the DB instance. + // The DB subnet group for the DB instance. DBSubnetGroupName *string - // Indicates the database engine version. + // The database engine version. EngineVersion *string - // Specifies the new Provisioned IOPS value for the DB instance that will be - // applied or is currently being applied. + // Whether mapping of AWS Identity and Access Management (IAM) accounts to database + // accounts is enabled. + IAMDatabaseAuthenticationEnabled *bool + + // The Provisioned IOPS value for the DB instance. Iops *int32 // The license model for the DB instance. Valid values: license-included | // bring-your-own-license | general-public-license LicenseModel *string - // Contains the pending or currently-in-progress change of the master credentials - // for the DB instance. + // The master credentials for the DB instance. MasterUserPassword *string - // Indicates that the Single-AZ DB instance is to change to a Multi-AZ deployment. + // Indicates that the Single-AZ DB instance will change to a Multi-AZ deployment. MultiAZ *bool // A list of the log types whose configuration is still pending. In other words, // these log types are in the process of being activated or deactivated. PendingCloudwatchLogsExports *PendingCloudwatchLogsExports - // Specifies the pending port for the DB instance. + // The port for the DB instance. Port *int32 // The number of CPU cores and the number of threads per core for the DB instance // class of the DB instance. ProcessorFeatures []ProcessorFeature - // Specifies the storage type to be associated with the DB instance. + // The storage type of the DB instance. StorageType *string } diff --git a/service/redshift/types/enums.go b/service/redshift/types/enums.go index df2f142988f..be782f764bb 100644 --- a/service/redshift/types/enums.go +++ b/service/redshift/types/enums.go @@ -93,6 +93,12 @@ func (OperatorType) Values() []OperatorType { type ParameterApplyType string +// Enum values for ParameterApplyType +const ( + ParameterApplyTypeStatic ParameterApplyType = "static" + ParameterApplyTypeDynamic ParameterApplyType = "dynamic" +) + // Values returns all known values for ParameterApplyType. 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. @@ -105,6 +111,12 @@ func (ParameterApplyType) Values() []ParameterApplyType { type ReservedNodeOfferingType string +// Enum values for ReservedNodeOfferingType +const ( + ReservedNodeOfferingTypeRegular ReservedNodeOfferingType = "Regular" + ReservedNodeOfferingTypeUpgradable ReservedNodeOfferingType = "Upgradable" +) + // Values returns all known values for ReservedNodeOfferingType. 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. @@ -173,6 +185,13 @@ func (ScheduledActionTypeValues) Values() []ScheduledActionTypeValues { type ScheduleState string +// Enum values for ScheduleState +const ( + ScheduleStateModifying ScheduleState = "MODIFYING" + ScheduleStateActive ScheduleState = "ACTIVE" + ScheduleStateFailed ScheduleState = "FAILED" +) + // Values returns all known values for ScheduleState. 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. @@ -224,6 +243,15 @@ func (SortByOrder) Values() []SortByOrder { type SourceType string +// Enum values for SourceType +const ( + SourceTypeCluster SourceType = "cluster" + SourceTypeClusterParameterGroup SourceType = "cluster-parameter-group" + SourceTypeClusterSecurityGroup SourceType = "cluster-security-group" + SourceTypeClusterSnapshot SourceType = "cluster-snapshot" + SourceTypeScheduledAction SourceType = "scheduled-action" +) + // Values returns all known values for SourceType. 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. @@ -239,6 +267,15 @@ func (SourceType) Values() []SourceType { type TableRestoreStatusType string +// Enum values for TableRestoreStatusType +const ( + TableRestoreStatusTypePending TableRestoreStatusType = "PENDING" + TableRestoreStatusTypeInProgress TableRestoreStatusType = "IN_PROGRESS" + TableRestoreStatusTypeSucceeded TableRestoreStatusType = "SUCCEEDED" + TableRestoreStatusTypeFailed TableRestoreStatusType = "FAILED" + TableRestoreStatusTypeCanceled TableRestoreStatusType = "CANCELED" +) + // Values returns all known values for TableRestoreStatusType. 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. diff --git a/service/rekognition/types/enums.go b/service/rekognition/types/enums.go index 9760cf1ac58..f4f272433c9 100644 --- a/service/rekognition/types/enums.go +++ b/service/rekognition/types/enums.go @@ -98,6 +98,19 @@ func (ContentModerationSortBy) Values() []ContentModerationSortBy { type EmotionName string +// Enum values for EmotionName +const ( + EmotionNameHappy EmotionName = "HAPPY" + EmotionNameSad EmotionName = "SAD" + EmotionNameAngry EmotionName = "ANGRY" + EmotionNameConfused EmotionName = "CONFUSED" + EmotionNameDisgusted EmotionName = "DISGUSTED" + EmotionNameSurprised EmotionName = "SURPRISED" + EmotionNameCalm EmotionName = "CALM" + EmotionNameUnknown EmotionName = "UNKNOWN" + EmotionNameFear EmotionName = "FEAR" +) + // Values returns all known values for EmotionName. 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. diff --git a/service/route53/api_client.go b/service/route53/api_client.go index 1e0a129092b..37ff0d1e8a1 100644 --- a/service/route53/api_client.go +++ b/service/route53/api_client.go @@ -235,6 +235,13 @@ func addSanitizeURLMiddleware(stack *middleware.Stack) error { // another operation (e.g. it expects just '1234') func sanitizeHostedZoneIDInput(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, `/`) @@ -256,6 +263,13 @@ func sanitizeHostedZoneIDInput(input interface{}) error { 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, `/`) @@ -284,6 +298,13 @@ func sanitizeHostedZoneIDInput(input interface{}) error { 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, `/`) @@ -291,6 +312,13 @@ func sanitizeHostedZoneIDInput(input interface{}) error { 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, `/`) @@ -305,6 +333,13 @@ func sanitizeHostedZoneIDInput(input interface{}) error { 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, `/`) @@ -312,6 +347,13 @@ func sanitizeHostedZoneIDInput(input interface{}) error { 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, `/`) @@ -319,6 +361,13 @@ func sanitizeHostedZoneIDInput(input interface{}) error { 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, `/`) diff --git a/service/route53/api_op_ActivateKeySigningKey.go b/service/route53/api_op_ActivateKeySigningKey.go new file mode 100644 index 00000000000..51bcfa3c29c --- /dev/null +++ b/service/route53/api_op_ActivateKeySigningKey.go @@ -0,0 +1,126 @@ +// 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, 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 + + // An alphanumeric string used to identify a key signing key (KSK). + // + // This member is required. + Name *string +} + +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 +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = 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", + } +} diff --git a/service/route53/api_op_CreateKeySigningKey.go b/service/route53/api_op_CreateKeySigningKey.go new file mode 100644 index 00000000000..1afbcca0058 --- /dev/null +++ b/service/route53/api_op_CreateKeySigningKey.go @@ -0,0 +1,176 @@ +// 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, 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 (CMK) in AWS 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 CMK 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": + // "api-service.dnssec.route53.aws.internal" + // + // For more information about working + // with CMK in KMS, see AWS Key Management Service concepts + // (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html). + // + // This member is required. + KeyManagementServiceArn *string + + // An alphanumeric string used to identify a key signing key (KSK). 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 +} + +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 +} + +func 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.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = 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", + } +} diff --git a/service/route53/api_op_DeactivateKeySigningKey.go b/service/route53/api_op_DeactivateKeySigningKey.go new file mode 100644 index 00000000000..1c77765d042 --- /dev/null +++ b/service/route53/api_op_DeactivateKeySigningKey.go @@ -0,0 +1,126 @@ +// 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" +) + +// Deactivates a key signing key (KSK) so that it will not be used for signing by +// DNSSEC. This operation changes the KSK status to INACTIVE. +func (c *Client) DeactivateKeySigningKey(ctx context.Context, params *DeactivateKeySigningKeyInput, optFns ...func(*Options)) (*DeactivateKeySigningKeyOutput, error) { + if params == nil { + params = &DeactivateKeySigningKeyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeactivateKeySigningKey", params, optFns, addOperationDeactivateKeySigningKeyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeactivateKeySigningKeyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeactivateKeySigningKeyInput struct { + + // A unique string used to identify a hosted zone. + // + // This member is required. + HostedZoneId *string + + // An alphanumeric string used to identify a key signing key (KSK). + // + // This member is required. + Name *string +} + +type DeactivateKeySigningKeyOutput 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 +} + +func addOperationDeactivateKeySigningKeyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestxml_serializeOpDeactivateKeySigningKey{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpDeactivateKeySigningKey{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeactivateKeySigningKeyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeactivateKeySigningKey(options.Region), middleware.Before); 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_opDeactivateKeySigningKey(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "route53", + OperationName: "DeactivateKeySigningKey", + } +} diff --git a/service/route53/api_op_DeleteKeySigningKey.go b/service/route53/api_op_DeleteKeySigningKey.go new file mode 100644 index 00000000000..f85f08ba389 --- /dev/null +++ b/service/route53/api_op_DeleteKeySigningKey.go @@ -0,0 +1,127 @@ +// 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" +) + +// Deletes a key signing key (KSK). Before you can delete a KSK, you must +// deactivate it. The KSK must be deactived before you can delete it regardless of +// whether the hosted zone is enabled for DNSSEC signing. +func (c *Client) DeleteKeySigningKey(ctx context.Context, params *DeleteKeySigningKeyInput, optFns ...func(*Options)) (*DeleteKeySigningKeyOutput, error) { + if params == nil { + params = &DeleteKeySigningKeyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteKeySigningKey", params, optFns, addOperationDeleteKeySigningKeyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteKeySigningKeyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteKeySigningKeyInput struct { + + // A unique string used to identify a hosted zone. + // + // This member is required. + HostedZoneId *string + + // An alphanumeric string used to identify a key signing key (KSK). + // + // This member is required. + Name *string +} + +type DeleteKeySigningKeyOutput 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 +} + +func addOperationDeleteKeySigningKeyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteKeySigningKey{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpDeleteKeySigningKey{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteKeySigningKeyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteKeySigningKey(options.Region), middleware.Before); 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_opDeleteKeySigningKey(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "route53", + OperationName: "DeleteKeySigningKey", + } +} diff --git a/service/route53/api_op_DisableHostedZoneDNSSEC.go b/service/route53/api_op_DisableHostedZoneDNSSEC.go new file mode 100644 index 00000000000..c09d7c8ff16 --- /dev/null +++ b/service/route53/api_op_DisableHostedZoneDNSSEC.go @@ -0,0 +1,121 @@ +// 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" +) + +// Disables DNSSEC signing in a specific hosted zone. This action does not +// deactivate any key signing keys (KSKs) that are active in the hosted zone. +func (c *Client) DisableHostedZoneDNSSEC(ctx context.Context, params *DisableHostedZoneDNSSECInput, optFns ...func(*Options)) (*DisableHostedZoneDNSSECOutput, error) { + if params == nil { + params = &DisableHostedZoneDNSSECInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisableHostedZoneDNSSEC", params, optFns, addOperationDisableHostedZoneDNSSECMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisableHostedZoneDNSSECOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DisableHostedZoneDNSSECInput struct { + + // A unique string used to identify a hosted zone. + // + // This member is required. + HostedZoneId *string +} + +type DisableHostedZoneDNSSECOutput 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 +} + +func addOperationDisableHostedZoneDNSSECMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestxml_serializeOpDisableHostedZoneDNSSEC{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpDisableHostedZoneDNSSEC{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDisableHostedZoneDNSSECValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableHostedZoneDNSSEC(options.Region), middleware.Before); 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_opDisableHostedZoneDNSSEC(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "route53", + OperationName: "DisableHostedZoneDNSSEC", + } +} diff --git a/service/route53/api_op_EnableHostedZoneDNSSEC.go b/service/route53/api_op_EnableHostedZoneDNSSEC.go new file mode 100644 index 00000000000..523419880c7 --- /dev/null +++ b/service/route53/api_op_EnableHostedZoneDNSSEC.go @@ -0,0 +1,120 @@ +// 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" +) + +// Enables DNSSEC signing in a specific hosted zone. +func (c *Client) EnableHostedZoneDNSSEC(ctx context.Context, params *EnableHostedZoneDNSSECInput, optFns ...func(*Options)) (*EnableHostedZoneDNSSECOutput, error) { + if params == nil { + params = &EnableHostedZoneDNSSECInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "EnableHostedZoneDNSSEC", params, optFns, addOperationEnableHostedZoneDNSSECMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*EnableHostedZoneDNSSECOutput) + out.ResultMetadata = metadata + return out, nil +} + +type EnableHostedZoneDNSSECInput struct { + + // A unique string used to identify a hosted zone. + // + // This member is required. + HostedZoneId *string +} + +type EnableHostedZoneDNSSECOutput 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 +} + +func addOperationEnableHostedZoneDNSSECMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestxml_serializeOpEnableHostedZoneDNSSEC{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpEnableHostedZoneDNSSEC{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpEnableHostedZoneDNSSECValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableHostedZoneDNSSEC(options.Region), middleware.Before); 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_opEnableHostedZoneDNSSEC(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "route53", + OperationName: "EnableHostedZoneDNSSEC", + } +} diff --git a/service/route53/api_op_GetDNSSEC.go b/service/route53/api_op_GetDNSSEC.go new file mode 100644 index 00000000000..81fc0b95e5a --- /dev/null +++ b/service/route53/api_op_GetDNSSEC.go @@ -0,0 +1,125 @@ +// 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" +) + +// Returns information about DNSSEC for a specific hosted zone, including the key +// signing keys (KSKs) and zone signing keys (ZSKs) in the hosted zone. +func (c *Client) GetDNSSEC(ctx context.Context, params *GetDNSSECInput, optFns ...func(*Options)) (*GetDNSSECOutput, error) { + if params == nil { + params = &GetDNSSECInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDNSSEC", params, optFns, addOperationGetDNSSECMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDNSSECOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDNSSECInput struct { + + // A unique string used to identify a hosted zone. + // + // This member is required. + HostedZoneId *string +} + +type GetDNSSECOutput struct { + + // The key signing keys (KSKs) in your account. + // + // This member is required. + KeySigningKeys []types.KeySigningKey + + // A string repesenting the status of DNSSEC. + // + // This member is required. + Status *types.DNSSECStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetDNSSECMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestxml_serializeOpGetDNSSEC{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetDNSSEC{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetDNSSECValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDNSSEC(options.Region), middleware.Before); 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_opGetDNSSEC(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "route53", + OperationName: "GetDNSSEC", + } +} diff --git a/service/route53/deserializers.go b/service/route53/deserializers.go index c380e8664a9..af69ee1f793 100644 --- a/service/route53/deserializers.go +++ b/service/route53/deserializers.go @@ -22,6 +22,155 @@ import ( "strings" ) +type awsRestxml_deserializeOpActivateKeySigningKey struct { +} + +func (*awsRestxml_deserializeOpActivateKeySigningKey) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpActivateKeySigningKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestxml_deserializeOpErrorActivateKeySigningKey(response, &metadata) + } + output := &ActivateKeySigningKeyOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsRestxml_deserializeOpDocumentActivateKeySigningKeyOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorActivateKeySigningKey(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ConcurrentModification", errorCode): + return awsRestxml_deserializeErrorConcurrentModification(response, errorBody) + + case strings.EqualFold("InvalidKeySigningKeyStatus", errorCode): + return awsRestxml_deserializeErrorInvalidKeySigningKeyStatus(response, errorBody) + + case strings.EqualFold("InvalidKMSArn", errorCode): + return awsRestxml_deserializeErrorInvalidKMSArn(response, errorBody) + + case strings.EqualFold("InvalidSigningStatus", errorCode): + return awsRestxml_deserializeErrorInvalidSigningStatus(response, errorBody) + + case strings.EqualFold("NoSuchKeySigningKey", errorCode): + return awsRestxml_deserializeErrorNoSuchKeySigningKey(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpDocumentActivateKeySigningKeyOutput(v **ActivateKeySigningKeyOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *ActivateKeySigningKeyOutput + if *v == nil { + sv = &ActivateKeySigningKeyOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ChangeInfo", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentChangeInfo(&sv.ChangeInfo, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + type awsRestxml_deserializeOpAssociateVPCWithHostedZone struct { } @@ -764,14 +913,14 @@ func awsRestxml_deserializeOpDocumentCreateHostedZoneOutput(v **CreateHostedZone return nil } -type awsRestxml_deserializeOpCreateQueryLoggingConfig struct { +type awsRestxml_deserializeOpCreateKeySigningKey struct { } -func (*awsRestxml_deserializeOpCreateQueryLoggingConfig) ID() string { +func (*awsRestxml_deserializeOpCreateKeySigningKey) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpCreateQueryLoggingConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpCreateKeySigningKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -785,12 +934,12 @@ func (m *awsRestxml_deserializeOpCreateQueryLoggingConfig) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorCreateQueryLoggingConfig(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorCreateKeySigningKey(response, &metadata) } - output := &CreateQueryLoggingConfigOutput{} + output := &CreateKeySigningKeyOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsCreateQueryLoggingConfigOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsCreateKeySigningKeyOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -813,7 +962,7 @@ func (m *awsRestxml_deserializeOpCreateQueryLoggingConfig) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentCreateQueryLoggingConfigOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentCreateKeySigningKeyOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -826,7 +975,7 @@ func (m *awsRestxml_deserializeOpCreateQueryLoggingConfig) HandleDeserialize(ctx return out, metadata, err } -func awsRestxml_deserializeOpErrorCreateQueryLoggingConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorCreateKeySigningKey(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -854,20 +1003,32 @@ func awsRestxml_deserializeOpErrorCreateQueryLoggingConfig(response *smithyhttp. case strings.EqualFold("ConcurrentModification", errorCode): return awsRestxml_deserializeErrorConcurrentModification(response, errorBody) - case strings.EqualFold("InsufficientCloudWatchLogsResourcePolicy", errorCode): - return awsRestxml_deserializeErrorInsufficientCloudWatchLogsResourcePolicy(response, errorBody) + case strings.EqualFold("InvalidArgument", errorCode): + return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NoSuchCloudWatchLogsLogGroup", errorCode): - return awsRestxml_deserializeErrorNoSuchCloudWatchLogsLogGroup(response, errorBody) + case strings.EqualFold("InvalidKeySigningKeyName", errorCode): + return awsRestxml_deserializeErrorInvalidKeySigningKeyName(response, errorBody) + + case strings.EqualFold("InvalidKeySigningKeyStatus", errorCode): + return awsRestxml_deserializeErrorInvalidKeySigningKeyStatus(response, errorBody) + + case strings.EqualFold("InvalidKMSArn", errorCode): + return awsRestxml_deserializeErrorInvalidKMSArn(response, errorBody) + + case strings.EqualFold("InvalidSigningStatus", errorCode): + return awsRestxml_deserializeErrorInvalidSigningStatus(response, errorBody) + + case strings.EqualFold("KeySigningKeyAlreadyExists", errorCode): + return awsRestxml_deserializeErrorKeySigningKeyAlreadyExists(response, errorBody) case strings.EqualFold("NoSuchHostedZone", errorCode): return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) - case strings.EqualFold("QueryLoggingConfigAlreadyExists", errorCode): - return awsRestxml_deserializeErrorQueryLoggingConfigAlreadyExists(response, errorBody) + case strings.EqualFold("TooManyKeySigningKeys", errorCode): + return awsRestxml_deserializeErrorTooManyKeySigningKeys(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -879,7 +1040,7 @@ func awsRestxml_deserializeOpErrorCreateQueryLoggingConfig(response *smithyhttp. } } -func awsRestxml_deserializeOpHttpBindingsCreateQueryLoggingConfigOutput(v *CreateQueryLoggingConfigOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsCreateKeySigningKeyOutput(v *CreateKeySigningKeyOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -891,13 +1052,13 @@ func awsRestxml_deserializeOpHttpBindingsCreateQueryLoggingConfigOutput(v *Creat return nil } -func awsRestxml_deserializeOpDocumentCreateQueryLoggingConfigOutput(v **CreateQueryLoggingConfigOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentCreateKeySigningKeyOutput(v **CreateKeySigningKeyOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *CreateQueryLoggingConfigOutput + var sv *CreateKeySigningKeyOutput if *v == nil { - sv = &CreateQueryLoggingConfigOutput{} + sv = &CreateKeySigningKeyOutput{} } else { sv = *v } @@ -913,9 +1074,15 @@ func awsRestxml_deserializeOpDocumentCreateQueryLoggingConfigOutput(v **CreateQu originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("QueryLoggingConfig", t.Name.Local): + case strings.EqualFold("ChangeInfo", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentQueryLoggingConfig(&sv.QueryLoggingConfig, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentChangeInfo(&sv.ChangeInfo, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("KeySigningKey", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentKeySigningKey(&sv.KeySigningKey, nodeDecoder); err != nil { return err } @@ -933,14 +1100,14 @@ func awsRestxml_deserializeOpDocumentCreateQueryLoggingConfigOutput(v **CreateQu return nil } -type awsRestxml_deserializeOpCreateReusableDelegationSet struct { +type awsRestxml_deserializeOpCreateQueryLoggingConfig struct { } -func (*awsRestxml_deserializeOpCreateReusableDelegationSet) ID() string { +func (*awsRestxml_deserializeOpCreateQueryLoggingConfig) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpCreateReusableDelegationSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpCreateQueryLoggingConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -954,12 +1121,12 @@ func (m *awsRestxml_deserializeOpCreateReusableDelegationSet) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorCreateReusableDelegationSet(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorCreateQueryLoggingConfig(response, &metadata) } - output := &CreateReusableDelegationSetOutput{} + output := &CreateQueryLoggingConfigOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsCreateReusableDelegationSetOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsCreateQueryLoggingConfigOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -982,7 +1149,7 @@ func (m *awsRestxml_deserializeOpCreateReusableDelegationSet) HandleDeserialize( } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentCreateReusableDelegationSetOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentCreateQueryLoggingConfigOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -995,7 +1162,7 @@ func (m *awsRestxml_deserializeOpCreateReusableDelegationSet) HandleDeserialize( return out, metadata, err } -func awsRestxml_deserializeOpErrorCreateReusableDelegationSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorCreateQueryLoggingConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1020,26 +1187,23 @@ func awsRestxml_deserializeOpErrorCreateReusableDelegationSet(response *smithyht } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("DelegationSetAlreadyCreated", errorCode): - return awsRestxml_deserializeErrorDelegationSetAlreadyCreated(response, errorBody) - - case strings.EqualFold("DelegationSetAlreadyReusable", errorCode): - return awsRestxml_deserializeErrorDelegationSetAlreadyReusable(response, errorBody) - - case strings.EqualFold("DelegationSetNotAvailable", errorCode): - return awsRestxml_deserializeErrorDelegationSetNotAvailable(response, errorBody) - - case strings.EqualFold("HostedZoneNotFound", errorCode): - return awsRestxml_deserializeErrorHostedZoneNotFound(response, errorBody) + case strings.EqualFold("ConcurrentModification", errorCode): + return awsRestxml_deserializeErrorConcurrentModification(response, errorBody) - case strings.EqualFold("InvalidArgument", errorCode): - return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + case strings.EqualFold("InsufficientCloudWatchLogsResourcePolicy", errorCode): + return awsRestxml_deserializeErrorInsufficientCloudWatchLogsResourcePolicy(response, errorBody) case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("LimitsExceeded", errorCode): - return awsRestxml_deserializeErrorLimitsExceeded(response, errorBody) + case strings.EqualFold("NoSuchCloudWatchLogsLogGroup", errorCode): + return awsRestxml_deserializeErrorNoSuchCloudWatchLogsLogGroup(response, errorBody) + + case strings.EqualFold("NoSuchHostedZone", errorCode): + return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) + + case strings.EqualFold("QueryLoggingConfigAlreadyExists", errorCode): + return awsRestxml_deserializeErrorQueryLoggingConfigAlreadyExists(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -1051,7 +1215,7 @@ func awsRestxml_deserializeOpErrorCreateReusableDelegationSet(response *smithyht } } -func awsRestxml_deserializeOpHttpBindingsCreateReusableDelegationSetOutput(v *CreateReusableDelegationSetOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsCreateQueryLoggingConfigOutput(v *CreateQueryLoggingConfigOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -1063,13 +1227,13 @@ func awsRestxml_deserializeOpHttpBindingsCreateReusableDelegationSetOutput(v *Cr return nil } -func awsRestxml_deserializeOpDocumentCreateReusableDelegationSetOutput(v **CreateReusableDelegationSetOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentCreateQueryLoggingConfigOutput(v **CreateQueryLoggingConfigOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *CreateReusableDelegationSetOutput + var sv *CreateQueryLoggingConfigOutput if *v == nil { - sv = &CreateReusableDelegationSetOutput{} + sv = &CreateQueryLoggingConfigOutput{} } else { sv = *v } @@ -1085,9 +1249,9 @@ func awsRestxml_deserializeOpDocumentCreateReusableDelegationSetOutput(v **Creat originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("DelegationSet", t.Name.Local): + case strings.EqualFold("QueryLoggingConfig", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentDelegationSet(&sv.DelegationSet, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentQueryLoggingConfig(&sv.QueryLoggingConfig, nodeDecoder); err != nil { return err } @@ -1105,14 +1269,14 @@ func awsRestxml_deserializeOpDocumentCreateReusableDelegationSetOutput(v **Creat return nil } -type awsRestxml_deserializeOpCreateTrafficPolicy struct { +type awsRestxml_deserializeOpCreateReusableDelegationSet struct { } -func (*awsRestxml_deserializeOpCreateTrafficPolicy) ID() string { +func (*awsRestxml_deserializeOpCreateReusableDelegationSet) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpCreateTrafficPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpCreateReusableDelegationSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1126,12 +1290,12 @@ func (m *awsRestxml_deserializeOpCreateTrafficPolicy) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorCreateTrafficPolicy(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorCreateReusableDelegationSet(response, &metadata) } - output := &CreateTrafficPolicyOutput{} + output := &CreateReusableDelegationSetOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsCreateTrafficPolicyOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsCreateReusableDelegationSetOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -1154,7 +1318,7 @@ func (m *awsRestxml_deserializeOpCreateTrafficPolicy) HandleDeserialize(ctx cont } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentCreateTrafficPolicyOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentCreateReusableDelegationSetOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1167,7 +1331,7 @@ func (m *awsRestxml_deserializeOpCreateTrafficPolicy) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestxml_deserializeOpErrorCreateTrafficPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorCreateReusableDelegationSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1192,24 +1356,196 @@ func awsRestxml_deserializeOpErrorCreateTrafficPolicy(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("InvalidInput", errorCode): - return awsRestxml_deserializeErrorInvalidInput(response, errorBody) + case strings.EqualFold("DelegationSetAlreadyCreated", errorCode): + return awsRestxml_deserializeErrorDelegationSetAlreadyCreated(response, errorBody) - case strings.EqualFold("InvalidTrafficPolicyDocument", errorCode): - return awsRestxml_deserializeErrorInvalidTrafficPolicyDocument(response, errorBody) + case strings.EqualFold("DelegationSetAlreadyReusable", errorCode): + return awsRestxml_deserializeErrorDelegationSetAlreadyReusable(response, errorBody) - case strings.EqualFold("TooManyTrafficPolicies", errorCode): - return awsRestxml_deserializeErrorTooManyTrafficPolicies(response, errorBody) + case strings.EqualFold("DelegationSetNotAvailable", errorCode): + return awsRestxml_deserializeErrorDelegationSetNotAvailable(response, errorBody) - case strings.EqualFold("TrafficPolicyAlreadyExists", errorCode): - return awsRestxml_deserializeErrorTrafficPolicyAlreadyExists(response, errorBody) + case strings.EqualFold("HostedZoneNotFound", errorCode): + return awsRestxml_deserializeErrorHostedZoneNotFound(response, errorBody) - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError + case strings.EqualFold("InvalidArgument", errorCode): + return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + + case strings.EqualFold("InvalidInput", errorCode): + return awsRestxml_deserializeErrorInvalidInput(response, errorBody) + + case strings.EqualFold("LimitsExceeded", errorCode): + return awsRestxml_deserializeErrorLimitsExceeded(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpHttpBindingsCreateReusableDelegationSetOutput(v *CreateReusableDelegationSetOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Location"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.Location = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestxml_deserializeOpDocumentCreateReusableDelegationSetOutput(v **CreateReusableDelegationSetOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateReusableDelegationSetOutput + if *v == nil { + sv = &CreateReusableDelegationSetOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DelegationSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentDelegationSet(&sv.DelegationSet, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +type awsRestxml_deserializeOpCreateTrafficPolicy struct { +} + +func (*awsRestxml_deserializeOpCreateTrafficPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpCreateTrafficPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestxml_deserializeOpErrorCreateTrafficPolicy(response, &metadata) + } + output := &CreateTrafficPolicyOutput{} + out.Result = output + + err = awsRestxml_deserializeOpHttpBindingsCreateTrafficPolicyOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsRestxml_deserializeOpDocumentCreateTrafficPolicyOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorCreateTrafficPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidInput", errorCode): + return awsRestxml_deserializeErrorInvalidInput(response, errorBody) + + case strings.EqualFold("InvalidTrafficPolicyDocument", errorCode): + return awsRestxml_deserializeErrorInvalidTrafficPolicyDocument(response, errorBody) + + case strings.EqualFold("TooManyTrafficPolicies", errorCode): + return awsRestxml_deserializeErrorTooManyTrafficPolicies(response, errorBody) + + case strings.EqualFold("TrafficPolicyAlreadyExists", errorCode): + return awsRestxml_deserializeErrorTrafficPolicyAlreadyExists(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError } } @@ -1762,14 +2098,14 @@ func awsRestxml_deserializeOpDocumentCreateVPCAssociationAuthorizationOutput(v * return nil } -type awsRestxml_deserializeOpDeleteHealthCheck struct { +type awsRestxml_deserializeOpDeactivateKeySigningKey struct { } -func (*awsRestxml_deserializeOpDeleteHealthCheck) ID() string { +func (*awsRestxml_deserializeOpDeactivateKeySigningKey) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeleteHealthCheck) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeactivateKeySigningKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1783,15 +2119,43 @@ func (m *awsRestxml_deserializeOpDeleteHealthCheck) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDeleteHealthCheck(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeactivateKeySigningKey(response, &metadata) } - output := &DeleteHealthCheckOutput{} + output := &DeactivateKeySigningKeyOutput{} out.Result = output + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsRestxml_deserializeOpDocumentDeactivateKeySigningKeyOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + return out, metadata, err } -func awsRestxml_deserializeOpErrorDeleteHealthCheck(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeactivateKeySigningKey(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1816,14 +2180,23 @@ func awsRestxml_deserializeOpErrorDeleteHealthCheck(response *smithyhttp.Respons } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("HealthCheckInUse", errorCode): - return awsRestxml_deserializeErrorHealthCheckInUse(response, errorBody) + case strings.EqualFold("ConcurrentModification", errorCode): + return awsRestxml_deserializeErrorConcurrentModification(response, errorBody) - case strings.EqualFold("InvalidInput", errorCode): - return awsRestxml_deserializeErrorInvalidInput(response, errorBody) + case strings.EqualFold("InvalidKeySigningKeyStatus", errorCode): + return awsRestxml_deserializeErrorInvalidKeySigningKeyStatus(response, errorBody) - case strings.EqualFold("NoSuchHealthCheck", errorCode): - return awsRestxml_deserializeErrorNoSuchHealthCheck(response, errorBody) + case strings.EqualFold("InvalidSigningStatus", errorCode): + return awsRestxml_deserializeErrorInvalidSigningStatus(response, errorBody) + + case strings.EqualFold("KeySigningKeyInParentDSRecord", errorCode): + return awsRestxml_deserializeErrorKeySigningKeyInParentDSRecord(response, errorBody) + + case strings.EqualFold("KeySigningKeyInUse", errorCode): + return awsRestxml_deserializeErrorKeySigningKeyInUse(response, errorBody) + + case strings.EqualFold("NoSuchKeySigningKey", errorCode): + return awsRestxml_deserializeErrorNoSuchKeySigningKey(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -1835,38 +2208,153 @@ func awsRestxml_deserializeOpErrorDeleteHealthCheck(response *smithyhttp.Respons } } -type awsRestxml_deserializeOpDeleteHostedZone struct { -} - -func (*awsRestxml_deserializeOpDeleteHostedZone) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestxml_deserializeOpDeleteHostedZone) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} +func awsRestxml_deserializeOpDocumentDeactivateKeySigningKeyOutput(v **DeactivateKeySigningKeyOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDeleteHostedZone(response, &metadata) + var sv *DeactivateKeySigningKeyOutput + if *v == nil { + sv = &DeactivateKeySigningKeyOutput{} + } else { + sv = *v } - output := &DeleteHostedZoneOutput{} - out.Result = output - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ChangeInfo", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentChangeInfo(&sv.ChangeInfo, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +type awsRestxml_deserializeOpDeleteHealthCheck struct { +} + +func (*awsRestxml_deserializeOpDeleteHealthCheck) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpDeleteHealthCheck) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestxml_deserializeOpErrorDeleteHealthCheck(response, &metadata) + } + output := &DeleteHealthCheckOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorDeleteHealthCheck(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("HealthCheckInUse", errorCode): + return awsRestxml_deserializeErrorHealthCheckInUse(response, errorBody) + + case strings.EqualFold("InvalidInput", errorCode): + return awsRestxml_deserializeErrorInvalidInput(response, errorBody) + + case strings.EqualFold("NoSuchHealthCheck", errorCode): + return awsRestxml_deserializeErrorNoSuchHealthCheck(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestxml_deserializeOpDeleteHostedZone struct { +} + +func (*awsRestxml_deserializeOpDeleteHostedZone) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpDeleteHostedZone) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestxml_deserializeOpErrorDeleteHostedZone(response, &metadata) + } + output := &DeleteHostedZoneOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { return out, metadata, nil } if err != nil { @@ -1984,14 +2472,14 @@ func awsRestxml_deserializeOpDocumentDeleteHostedZoneOutput(v **DeleteHostedZone return nil } -type awsRestxml_deserializeOpDeleteQueryLoggingConfig struct { +type awsRestxml_deserializeOpDeleteKeySigningKey struct { } -func (*awsRestxml_deserializeOpDeleteQueryLoggingConfig) ID() string { +func (*awsRestxml_deserializeOpDeleteKeySigningKey) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeleteQueryLoggingConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeleteKeySigningKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2005,15 +2493,43 @@ func (m *awsRestxml_deserializeOpDeleteQueryLoggingConfig) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDeleteQueryLoggingConfig(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeleteKeySigningKey(response, &metadata) } - output := &DeleteQueryLoggingConfigOutput{} + output := &DeleteKeySigningKeyOutput{} out.Result = output + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsRestxml_deserializeOpDocumentDeleteKeySigningKeyOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + return out, metadata, err } -func awsRestxml_deserializeOpErrorDeleteQueryLoggingConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeleteKeySigningKey(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2041,11 +2557,17 @@ func awsRestxml_deserializeOpErrorDeleteQueryLoggingConfig(response *smithyhttp. case strings.EqualFold("ConcurrentModification", errorCode): return awsRestxml_deserializeErrorConcurrentModification(response, errorBody) - case strings.EqualFold("InvalidInput", errorCode): - return awsRestxml_deserializeErrorInvalidInput(response, errorBody) + case strings.EqualFold("InvalidKeySigningKeyStatus", errorCode): + return awsRestxml_deserializeErrorInvalidKeySigningKeyStatus(response, errorBody) - case strings.EqualFold("NoSuchQueryLoggingConfig", errorCode): - return awsRestxml_deserializeErrorNoSuchQueryLoggingConfig(response, errorBody) + case strings.EqualFold("InvalidKMSArn", errorCode): + return awsRestxml_deserializeErrorInvalidKMSArn(response, errorBody) + + case strings.EqualFold("InvalidSigningStatus", errorCode): + return awsRestxml_deserializeErrorInvalidSigningStatus(response, errorBody) + + case strings.EqualFold("NoSuchKeySigningKey", errorCode): + return awsRestxml_deserializeErrorNoSuchKeySigningKey(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -2057,14 +2579,56 @@ func awsRestxml_deserializeOpErrorDeleteQueryLoggingConfig(response *smithyhttp. } } -type awsRestxml_deserializeOpDeleteReusableDelegationSet struct { +func awsRestxml_deserializeOpDocumentDeleteKeySigningKeyOutput(v **DeleteKeySigningKeyOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DeleteKeySigningKeyOutput + if *v == nil { + sv = &DeleteKeySigningKeyOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ChangeInfo", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentChangeInfo(&sv.ChangeInfo, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil } -func (*awsRestxml_deserializeOpDeleteReusableDelegationSet) ID() string { +type awsRestxml_deserializeOpDeleteQueryLoggingConfig struct { +} + +func (*awsRestxml_deserializeOpDeleteQueryLoggingConfig) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeleteReusableDelegationSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeleteQueryLoggingConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2078,15 +2642,15 @@ func (m *awsRestxml_deserializeOpDeleteReusableDelegationSet) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDeleteReusableDelegationSet(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeleteQueryLoggingConfig(response, &metadata) } - output := &DeleteReusableDelegationSetOutput{} + output := &DeleteQueryLoggingConfigOutput{} out.Result = output return out, metadata, err } -func awsRestxml_deserializeOpErrorDeleteReusableDelegationSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeleteQueryLoggingConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2111,17 +2675,14 @@ func awsRestxml_deserializeOpErrorDeleteReusableDelegationSet(response *smithyht } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("DelegationSetInUse", errorCode): - return awsRestxml_deserializeErrorDelegationSetInUse(response, errorBody) - - case strings.EqualFold("DelegationSetNotReusable", errorCode): - return awsRestxml_deserializeErrorDelegationSetNotReusable(response, errorBody) + case strings.EqualFold("ConcurrentModification", errorCode): + return awsRestxml_deserializeErrorConcurrentModification(response, errorBody) case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NoSuchDelegationSet", errorCode): - return awsRestxml_deserializeErrorNoSuchDelegationSet(response, errorBody) + case strings.EqualFold("NoSuchQueryLoggingConfig", errorCode): + return awsRestxml_deserializeErrorNoSuchQueryLoggingConfig(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -2133,14 +2694,14 @@ func awsRestxml_deserializeOpErrorDeleteReusableDelegationSet(response *smithyht } } -type awsRestxml_deserializeOpDeleteTrafficPolicy struct { +type awsRestxml_deserializeOpDeleteReusableDelegationSet struct { } -func (*awsRestxml_deserializeOpDeleteTrafficPolicy) ID() string { +func (*awsRestxml_deserializeOpDeleteReusableDelegationSet) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDeleteTrafficPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDeleteReusableDelegationSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2154,15 +2715,15 @@ func (m *awsRestxml_deserializeOpDeleteTrafficPolicy) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDeleteTrafficPolicy(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDeleteReusableDelegationSet(response, &metadata) } - output := &DeleteTrafficPolicyOutput{} + output := &DeleteReusableDelegationSetOutput{} out.Result = output return out, metadata, err } -func awsRestxml_deserializeOpErrorDeleteTrafficPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDeleteReusableDelegationSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2187,8 +2748,84 @@ func awsRestxml_deserializeOpErrorDeleteTrafficPolicy(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("ConcurrentModification", errorCode): - return awsRestxml_deserializeErrorConcurrentModification(response, errorBody) + case strings.EqualFold("DelegationSetInUse", errorCode): + return awsRestxml_deserializeErrorDelegationSetInUse(response, errorBody) + + case strings.EqualFold("DelegationSetNotReusable", errorCode): + return awsRestxml_deserializeErrorDelegationSetNotReusable(response, errorBody) + + case strings.EqualFold("InvalidInput", errorCode): + return awsRestxml_deserializeErrorInvalidInput(response, errorBody) + + case strings.EqualFold("NoSuchDelegationSet", errorCode): + return awsRestxml_deserializeErrorNoSuchDelegationSet(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestxml_deserializeOpDeleteTrafficPolicy struct { +} + +func (*awsRestxml_deserializeOpDeleteTrafficPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpDeleteTrafficPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestxml_deserializeOpErrorDeleteTrafficPolicy(response, &metadata) + } + output := &DeleteTrafficPolicyOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorDeleteTrafficPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ConcurrentModification", errorCode): + return awsRestxml_deserializeErrorConcurrentModification(response, errorBody) case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) @@ -2361,14 +2998,14 @@ func awsRestxml_deserializeOpErrorDeleteVPCAssociationAuthorization(response *sm } } -type awsRestxml_deserializeOpDisassociateVPCFromHostedZone struct { +type awsRestxml_deserializeOpDisableHostedZoneDNSSEC struct { } -func (*awsRestxml_deserializeOpDisassociateVPCFromHostedZone) ID() string { +func (*awsRestxml_deserializeOpDisableHostedZoneDNSSEC) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpDisassociateVPCFromHostedZone) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDisableHostedZoneDNSSEC) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2382,9 +3019,9 @@ func (m *awsRestxml_deserializeOpDisassociateVPCFromHostedZone) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorDisassociateVPCFromHostedZone(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDisableHostedZoneDNSSEC(response, &metadata) } - output := &DisassociateVPCFromHostedZoneOutput{} + output := &DisableHostedZoneDNSSECOutput{} out.Result = output var buff [1024]byte @@ -2405,7 +3042,7 @@ func (m *awsRestxml_deserializeOpDisassociateVPCFromHostedZone) HandleDeserializ } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentDisassociateVPCFromHostedZoneOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentDisableHostedZoneDNSSECOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2418,7 +3055,7 @@ func (m *awsRestxml_deserializeOpDisassociateVPCFromHostedZone) HandleDeserializ return out, metadata, err } -func awsRestxml_deserializeOpErrorDisassociateVPCFromHostedZone(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDisableHostedZoneDNSSEC(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2443,21 +3080,27 @@ func awsRestxml_deserializeOpErrorDisassociateVPCFromHostedZone(response *smithy } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("InvalidInput", errorCode): - return awsRestxml_deserializeErrorInvalidInput(response, errorBody) + case strings.EqualFold("ConcurrentModification", errorCode): + return awsRestxml_deserializeErrorConcurrentModification(response, errorBody) - case strings.EqualFold("InvalidVPCId", errorCode): - return awsRestxml_deserializeErrorInvalidVPCId(response, errorBody) + case strings.EqualFold("DNSSECNotFound", errorCode): + return awsRestxml_deserializeErrorDNSSECNotFound(response, errorBody) - case strings.EqualFold("LastVPCAssociation", errorCode): - return awsRestxml_deserializeErrorLastVPCAssociation(response, errorBody) + case strings.EqualFold("InvalidArgument", errorCode): + return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + + case strings.EqualFold("InvalidKeySigningKeyStatus", errorCode): + return awsRestxml_deserializeErrorInvalidKeySigningKeyStatus(response, errorBody) + + case strings.EqualFold("InvalidKMSArn", errorCode): + return awsRestxml_deserializeErrorInvalidKMSArn(response, errorBody) + + case strings.EqualFold("KeySigningKeyInParentDSRecord", errorCode): + return awsRestxml_deserializeErrorKeySigningKeyInParentDSRecord(response, errorBody) case strings.EqualFold("NoSuchHostedZone", errorCode): return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) - case strings.EqualFold("VPCAssociationNotFound", errorCode): - return awsRestxml_deserializeErrorVPCAssociationNotFound(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2468,13 +3111,13 @@ func awsRestxml_deserializeOpErrorDisassociateVPCFromHostedZone(response *smithy } } -func awsRestxml_deserializeOpDocumentDisassociateVPCFromHostedZoneOutput(v **DisassociateVPCFromHostedZoneOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentDisableHostedZoneDNSSECOutput(v **DisableHostedZoneDNSSECOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *DisassociateVPCFromHostedZoneOutput + var sv *DisableHostedZoneDNSSECOutput if *v == nil { - sv = &DisassociateVPCFromHostedZoneOutput{} + sv = &DisableHostedZoneDNSSECOutput{} } else { sv = *v } @@ -2510,14 +3153,14 @@ func awsRestxml_deserializeOpDocumentDisassociateVPCFromHostedZoneOutput(v **Dis return nil } -type awsRestxml_deserializeOpGetAccountLimit struct { +type awsRestxml_deserializeOpDisassociateVPCFromHostedZone struct { } -func (*awsRestxml_deserializeOpGetAccountLimit) ID() string { +func (*awsRestxml_deserializeOpDisassociateVPCFromHostedZone) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetAccountLimit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpDisassociateVPCFromHostedZone) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2531,9 +3174,9 @@ func (m *awsRestxml_deserializeOpGetAccountLimit) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetAccountLimit(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorDisassociateVPCFromHostedZone(response, &metadata) } - output := &GetAccountLimitOutput{} + output := &DisassociateVPCFromHostedZoneOutput{} out.Result = output var buff [1024]byte @@ -2554,7 +3197,7 @@ func (m *awsRestxml_deserializeOpGetAccountLimit) HandleDeserialize(ctx context. } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetAccountLimitOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentDisassociateVPCFromHostedZoneOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2567,7 +3210,7 @@ func (m *awsRestxml_deserializeOpGetAccountLimit) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestxml_deserializeOpErrorGetAccountLimit(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorDisassociateVPCFromHostedZone(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2595,6 +3238,18 @@ func awsRestxml_deserializeOpErrorGetAccountLimit(response *smithyhttp.Response, case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) + case strings.EqualFold("InvalidVPCId", errorCode): + return awsRestxml_deserializeErrorInvalidVPCId(response, errorBody) + + case strings.EqualFold("LastVPCAssociation", errorCode): + return awsRestxml_deserializeErrorLastVPCAssociation(response, errorBody) + + case strings.EqualFold("NoSuchHostedZone", errorCode): + return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) + + case strings.EqualFold("VPCAssociationNotFound", errorCode): + return awsRestxml_deserializeErrorVPCAssociationNotFound(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2605,13 +3260,13 @@ func awsRestxml_deserializeOpErrorGetAccountLimit(response *smithyhttp.Response, } } -func awsRestxml_deserializeOpDocumentGetAccountLimitOutput(v **GetAccountLimitOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentDisassociateVPCFromHostedZoneOutput(v **DisassociateVPCFromHostedZoneOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetAccountLimitOutput + var sv *DisassociateVPCFromHostedZoneOutput if *v == nil { - sv = &GetAccountLimitOutput{} + sv = &DisassociateVPCFromHostedZoneOutput{} } else { sv = *v } @@ -2627,26 +3282,9 @@ func awsRestxml_deserializeOpDocumentGetAccountLimitOutput(v **GetAccountLimitOu originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Count", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Count = i64 - } - - case strings.EqualFold("Limit", t.Name.Local): + case strings.EqualFold("ChangeInfo", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentAccountLimit(&sv.Limit, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentChangeInfo(&sv.ChangeInfo, nodeDecoder); err != nil { return err } @@ -2664,14 +3302,14 @@ func awsRestxml_deserializeOpDocumentGetAccountLimitOutput(v **GetAccountLimitOu return nil } -type awsRestxml_deserializeOpGetChange struct { +type awsRestxml_deserializeOpEnableHostedZoneDNSSEC struct { } -func (*awsRestxml_deserializeOpGetChange) ID() string { +func (*awsRestxml_deserializeOpEnableHostedZoneDNSSEC) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetChange) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpEnableHostedZoneDNSSEC) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2685,9 +3323,9 @@ func (m *awsRestxml_deserializeOpGetChange) HandleDeserialize(ctx context.Contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetChange(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorEnableHostedZoneDNSSEC(response, &metadata) } - output := &GetChangeOutput{} + output := &EnableHostedZoneDNSSECOutput{} out.Result = output var buff [1024]byte @@ -2708,7 +3346,7 @@ func (m *awsRestxml_deserializeOpGetChange) HandleDeserialize(ctx context.Contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetChangeOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentEnableHostedZoneDNSSECOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2721,7 +3359,7 @@ func (m *awsRestxml_deserializeOpGetChange) HandleDeserialize(ctx context.Contex return out, metadata, err } -func awsRestxml_deserializeOpErrorGetChange(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorEnableHostedZoneDNSSEC(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2746,11 +3384,29 @@ func awsRestxml_deserializeOpErrorGetChange(response *smithyhttp.Response, metad } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("InvalidInput", errorCode): - return awsRestxml_deserializeErrorInvalidInput(response, errorBody) + case strings.EqualFold("ConcurrentModification", errorCode): + return awsRestxml_deserializeErrorConcurrentModification(response, errorBody) - case strings.EqualFold("NoSuchChange", errorCode): - return awsRestxml_deserializeErrorNoSuchChange(response, errorBody) + case strings.EqualFold("DNSSECNotFound", errorCode): + return awsRestxml_deserializeErrorDNSSECNotFound(response, errorBody) + + case strings.EqualFold("HostedZonePartiallyDelegated", errorCode): + return awsRestxml_deserializeErrorHostedZonePartiallyDelegated(response, errorBody) + + case strings.EqualFold("InvalidArgument", errorCode): + return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + + case strings.EqualFold("InvalidKeySigningKeyStatus", errorCode): + return awsRestxml_deserializeErrorInvalidKeySigningKeyStatus(response, errorBody) + + case strings.EqualFold("InvalidKMSArn", errorCode): + return awsRestxml_deserializeErrorInvalidKMSArn(response, errorBody) + + case strings.EqualFold("KeySigningKeyWithActiveStatusNotFound", errorCode): + return awsRestxml_deserializeErrorKeySigningKeyWithActiveStatusNotFound(response, errorBody) + + case strings.EqualFold("NoSuchHostedZone", errorCode): + return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -2762,13 +3418,13 @@ func awsRestxml_deserializeOpErrorGetChange(response *smithyhttp.Response, metad } } -func awsRestxml_deserializeOpDocumentGetChangeOutput(v **GetChangeOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentEnableHostedZoneDNSSECOutput(v **EnableHostedZoneDNSSECOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetChangeOutput + var sv *EnableHostedZoneDNSSECOutput if *v == nil { - sv = &GetChangeOutput{} + sv = &EnableHostedZoneDNSSECOutput{} } else { sv = *v } @@ -2804,14 +3460,14 @@ func awsRestxml_deserializeOpDocumentGetChangeOutput(v **GetChangeOutput, decode return nil } -type awsRestxml_deserializeOpGetCheckerIpRanges struct { +type awsRestxml_deserializeOpGetAccountLimit struct { } -func (*awsRestxml_deserializeOpGetCheckerIpRanges) ID() string { +func (*awsRestxml_deserializeOpGetAccountLimit) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetCheckerIpRanges) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetAccountLimit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2825,9 +3481,9 @@ func (m *awsRestxml_deserializeOpGetCheckerIpRanges) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetCheckerIpRanges(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetAccountLimit(response, &metadata) } - output := &GetCheckerIpRangesOutput{} + output := &GetAccountLimitOutput{} out.Result = output var buff [1024]byte @@ -2848,7 +3504,7 @@ func (m *awsRestxml_deserializeOpGetCheckerIpRanges) HandleDeserialize(ctx conte } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetCheckerIpRangesOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetAccountLimitOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2861,7 +3517,7 @@ func (m *awsRestxml_deserializeOpGetCheckerIpRanges) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestxml_deserializeOpErrorGetCheckerIpRanges(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetAccountLimit(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2886,6 +3542,9 @@ func awsRestxml_deserializeOpErrorGetCheckerIpRanges(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("InvalidInput", errorCode): + return awsRestxml_deserializeErrorInvalidInput(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2896,13 +3555,13 @@ func awsRestxml_deserializeOpErrorGetCheckerIpRanges(response *smithyhttp.Respon } } -func awsRestxml_deserializeOpDocumentGetCheckerIpRangesOutput(v **GetCheckerIpRangesOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetAccountLimitOutput(v **GetAccountLimitOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetCheckerIpRangesOutput + var sv *GetAccountLimitOutput if *v == nil { - sv = &GetCheckerIpRangesOutput{} + sv = &GetAccountLimitOutput{} } else { sv = *v } @@ -2918,9 +3577,26 @@ func awsRestxml_deserializeOpDocumentGetCheckerIpRangesOutput(v **GetCheckerIpRa originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("CheckerIpRanges", t.Name.Local): + case strings.EqualFold("Count", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Count = i64 + } + + case strings.EqualFold("Limit", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentCheckerIpRanges(&sv.CheckerIpRanges, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentAccountLimit(&sv.Limit, nodeDecoder); err != nil { return err } @@ -2938,14 +3614,14 @@ func awsRestxml_deserializeOpDocumentGetCheckerIpRangesOutput(v **GetCheckerIpRa return nil } -type awsRestxml_deserializeOpGetGeoLocation struct { +type awsRestxml_deserializeOpGetChange struct { } -func (*awsRestxml_deserializeOpGetGeoLocation) ID() string { +func (*awsRestxml_deserializeOpGetChange) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetGeoLocation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetChange) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2959,9 +3635,9 @@ func (m *awsRestxml_deserializeOpGetGeoLocation) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetGeoLocation(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetChange(response, &metadata) } - output := &GetGeoLocationOutput{} + output := &GetChangeOutput{} out.Result = output var buff [1024]byte @@ -2982,7 +3658,7 @@ func (m *awsRestxml_deserializeOpGetGeoLocation) HandleDeserialize(ctx context.C } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetGeoLocationOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetChangeOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2995,7 +3671,7 @@ func (m *awsRestxml_deserializeOpGetGeoLocation) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestxml_deserializeOpErrorGetGeoLocation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetChange(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3023,8 +3699,8 @@ func awsRestxml_deserializeOpErrorGetGeoLocation(response *smithyhttp.Response, case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NoSuchGeoLocation", errorCode): - return awsRestxml_deserializeErrorNoSuchGeoLocation(response, errorBody) + case strings.EqualFold("NoSuchChange", errorCode): + return awsRestxml_deserializeErrorNoSuchChange(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -3036,13 +3712,13 @@ func awsRestxml_deserializeOpErrorGetGeoLocation(response *smithyhttp.Response, } } -func awsRestxml_deserializeOpDocumentGetGeoLocationOutput(v **GetGeoLocationOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetChangeOutput(v **GetChangeOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetGeoLocationOutput + var sv *GetChangeOutput if *v == nil { - sv = &GetGeoLocationOutput{} + sv = &GetChangeOutput{} } else { sv = *v } @@ -3058,9 +3734,9 @@ func awsRestxml_deserializeOpDocumentGetGeoLocationOutput(v **GetGeoLocationOutp originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("GeoLocationDetails", t.Name.Local): + case strings.EqualFold("ChangeInfo", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentGeoLocationDetails(&sv.GeoLocationDetails, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentChangeInfo(&sv.ChangeInfo, nodeDecoder); err != nil { return err } @@ -3078,14 +3754,14 @@ func awsRestxml_deserializeOpDocumentGetGeoLocationOutput(v **GetGeoLocationOutp return nil } -type awsRestxml_deserializeOpGetHealthCheck struct { +type awsRestxml_deserializeOpGetCheckerIpRanges struct { } -func (*awsRestxml_deserializeOpGetHealthCheck) ID() string { +func (*awsRestxml_deserializeOpGetCheckerIpRanges) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetHealthCheck) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetCheckerIpRanges) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3099,9 +3775,9 @@ func (m *awsRestxml_deserializeOpGetHealthCheck) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetHealthCheck(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetCheckerIpRanges(response, &metadata) } - output := &GetHealthCheckOutput{} + output := &GetCheckerIpRangesOutput{} out.Result = output var buff [1024]byte @@ -3122,7 +3798,7 @@ func (m *awsRestxml_deserializeOpGetHealthCheck) HandleDeserialize(ctx context.C } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetHealthCheckOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetCheckerIpRangesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3135,7 +3811,7 @@ func (m *awsRestxml_deserializeOpGetHealthCheck) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestxml_deserializeOpErrorGetHealthCheck(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetCheckerIpRanges(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3160,15 +3836,6 @@ func awsRestxml_deserializeOpErrorGetHealthCheck(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("IncompatibleVersion", errorCode): - return awsRestxml_deserializeErrorIncompatibleVersion(response, errorBody) - - case strings.EqualFold("InvalidInput", errorCode): - return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - - case strings.EqualFold("NoSuchHealthCheck", errorCode): - return awsRestxml_deserializeErrorNoSuchHealthCheck(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3179,13 +3846,13 @@ func awsRestxml_deserializeOpErrorGetHealthCheck(response *smithyhttp.Response, } } -func awsRestxml_deserializeOpDocumentGetHealthCheckOutput(v **GetHealthCheckOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetCheckerIpRangesOutput(v **GetCheckerIpRangesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetHealthCheckOutput + var sv *GetCheckerIpRangesOutput if *v == nil { - sv = &GetHealthCheckOutput{} + sv = &GetCheckerIpRangesOutput{} } else { sv = *v } @@ -3201,9 +3868,9 @@ func awsRestxml_deserializeOpDocumentGetHealthCheckOutput(v **GetHealthCheckOutp originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("HealthCheck", t.Name.Local): + case strings.EqualFold("CheckerIpRanges", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentHealthCheck(&sv.HealthCheck, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentCheckerIpRanges(&sv.CheckerIpRanges, nodeDecoder); err != nil { return err } @@ -3221,14 +3888,14 @@ func awsRestxml_deserializeOpDocumentGetHealthCheckOutput(v **GetHealthCheckOutp return nil } -type awsRestxml_deserializeOpGetHealthCheckCount struct { +type awsRestxml_deserializeOpGetDNSSEC struct { } -func (*awsRestxml_deserializeOpGetHealthCheckCount) ID() string { +func (*awsRestxml_deserializeOpGetDNSSEC) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetHealthCheckCount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetDNSSEC) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3242,9 +3909,9 @@ func (m *awsRestxml_deserializeOpGetHealthCheckCount) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetHealthCheckCount(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetDNSSEC(response, &metadata) } - output := &GetHealthCheckCountOutput{} + output := &GetDNSSECOutput{} out.Result = output var buff [1024]byte @@ -3265,7 +3932,7 @@ func (m *awsRestxml_deserializeOpGetHealthCheckCount) HandleDeserialize(ctx cont } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetHealthCheckCountOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetDNSSECOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3278,7 +3945,7 @@ func (m *awsRestxml_deserializeOpGetHealthCheckCount) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestxml_deserializeOpErrorGetHealthCheckCount(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetDNSSEC(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3303,6 +3970,12 @@ func awsRestxml_deserializeOpErrorGetHealthCheckCount(response *smithyhttp.Respo } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("InvalidArgument", errorCode): + return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + + case strings.EqualFold("NoSuchHostedZone", errorCode): + return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3313,13 +3986,13 @@ func awsRestxml_deserializeOpErrorGetHealthCheckCount(response *smithyhttp.Respo } } -func awsRestxml_deserializeOpDocumentGetHealthCheckCountOutput(v **GetHealthCheckCountOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetDNSSECOutput(v **GetDNSSECOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetHealthCheckCountOutput + var sv *GetDNSSECOutput if *v == nil { - sv = &GetHealthCheckCountOutput{} + sv = &GetDNSSECOutput{} } else { sv = *v } @@ -3335,21 +4008,16 @@ func awsRestxml_deserializeOpDocumentGetHealthCheckCountOutput(v **GetHealthChec originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("HealthCheckCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("KeySigningKeys", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentKeySigningKeys(&sv.KeySigningKeys, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.HealthCheckCount = ptr.Int64(i64) + + case strings.EqualFold("Status", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentDNSSECStatus(&sv.Status, nodeDecoder); err != nil { + return err } default: @@ -3366,14 +4034,14 @@ func awsRestxml_deserializeOpDocumentGetHealthCheckCountOutput(v **GetHealthChec return nil } -type awsRestxml_deserializeOpGetHealthCheckLastFailureReason struct { +type awsRestxml_deserializeOpGetGeoLocation struct { } -func (*awsRestxml_deserializeOpGetHealthCheckLastFailureReason) ID() string { +func (*awsRestxml_deserializeOpGetGeoLocation) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetHealthCheckLastFailureReason) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetGeoLocation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3387,9 +4055,9 @@ func (m *awsRestxml_deserializeOpGetHealthCheckLastFailureReason) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetHealthCheckLastFailureReason(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetGeoLocation(response, &metadata) } - output := &GetHealthCheckLastFailureReasonOutput{} + output := &GetGeoLocationOutput{} out.Result = output var buff [1024]byte @@ -3410,7 +4078,7 @@ func (m *awsRestxml_deserializeOpGetHealthCheckLastFailureReason) HandleDeserial } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetHealthCheckLastFailureReasonOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetGeoLocationOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3423,7 +4091,7 @@ func (m *awsRestxml_deserializeOpGetHealthCheckLastFailureReason) HandleDeserial return out, metadata, err } -func awsRestxml_deserializeOpErrorGetHealthCheckLastFailureReason(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetGeoLocation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3451,8 +4119,8 @@ func awsRestxml_deserializeOpErrorGetHealthCheckLastFailureReason(response *smit case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NoSuchHealthCheck", errorCode): - return awsRestxml_deserializeErrorNoSuchHealthCheck(response, errorBody) + case strings.EqualFold("NoSuchGeoLocation", errorCode): + return awsRestxml_deserializeErrorNoSuchGeoLocation(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -3464,13 +4132,13 @@ func awsRestxml_deserializeOpErrorGetHealthCheckLastFailureReason(response *smit } } -func awsRestxml_deserializeOpDocumentGetHealthCheckLastFailureReasonOutput(v **GetHealthCheckLastFailureReasonOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetGeoLocationOutput(v **GetGeoLocationOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetHealthCheckLastFailureReasonOutput + var sv *GetGeoLocationOutput if *v == nil { - sv = &GetHealthCheckLastFailureReasonOutput{} + sv = &GetGeoLocationOutput{} } else { sv = *v } @@ -3486,9 +4154,9 @@ func awsRestxml_deserializeOpDocumentGetHealthCheckLastFailureReasonOutput(v **G originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("HealthCheckObservations", t.Name.Local): + case strings.EqualFold("GeoLocationDetails", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentHealthCheckObservations(&sv.HealthCheckObservations, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentGeoLocationDetails(&sv.GeoLocationDetails, nodeDecoder); err != nil { return err } @@ -3506,14 +4174,14 @@ func awsRestxml_deserializeOpDocumentGetHealthCheckLastFailureReasonOutput(v **G return nil } -type awsRestxml_deserializeOpGetHealthCheckStatus struct { +type awsRestxml_deserializeOpGetHealthCheck struct { } -func (*awsRestxml_deserializeOpGetHealthCheckStatus) ID() string { +func (*awsRestxml_deserializeOpGetHealthCheck) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetHealthCheckStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetHealthCheck) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3527,9 +4195,9 @@ func (m *awsRestxml_deserializeOpGetHealthCheckStatus) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetHealthCheckStatus(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetHealthCheck(response, &metadata) } - output := &GetHealthCheckStatusOutput{} + output := &GetHealthCheckOutput{} out.Result = output var buff [1024]byte @@ -3550,7 +4218,7 @@ func (m *awsRestxml_deserializeOpGetHealthCheckStatus) HandleDeserialize(ctx con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetHealthCheckStatusOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetHealthCheckOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3563,7 +4231,7 @@ func (m *awsRestxml_deserializeOpGetHealthCheckStatus) HandleDeserialize(ctx con return out, metadata, err } -func awsRestxml_deserializeOpErrorGetHealthCheckStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetHealthCheck(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3588,6 +4256,9 @@ func awsRestxml_deserializeOpErrorGetHealthCheckStatus(response *smithyhttp.Resp } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("IncompatibleVersion", errorCode): + return awsRestxml_deserializeErrorIncompatibleVersion(response, errorBody) + case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) @@ -3604,13 +4275,13 @@ func awsRestxml_deserializeOpErrorGetHealthCheckStatus(response *smithyhttp.Resp } } -func awsRestxml_deserializeOpDocumentGetHealthCheckStatusOutput(v **GetHealthCheckStatusOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetHealthCheckOutput(v **GetHealthCheckOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetHealthCheckStatusOutput + var sv *GetHealthCheckOutput if *v == nil { - sv = &GetHealthCheckStatusOutput{} + sv = &GetHealthCheckOutput{} } else { sv = *v } @@ -3626,9 +4297,9 @@ func awsRestxml_deserializeOpDocumentGetHealthCheckStatusOutput(v **GetHealthChe originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("HealthCheckObservations", t.Name.Local): + case strings.EqualFold("HealthCheck", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentHealthCheckObservations(&sv.HealthCheckObservations, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentHealthCheck(&sv.HealthCheck, nodeDecoder); err != nil { return err } @@ -3646,14 +4317,14 @@ func awsRestxml_deserializeOpDocumentGetHealthCheckStatusOutput(v **GetHealthChe return nil } -type awsRestxml_deserializeOpGetHostedZone struct { +type awsRestxml_deserializeOpGetHealthCheckCount struct { } -func (*awsRestxml_deserializeOpGetHostedZone) ID() string { +func (*awsRestxml_deserializeOpGetHealthCheckCount) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetHostedZone) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetHealthCheckCount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3667,9 +4338,9 @@ func (m *awsRestxml_deserializeOpGetHostedZone) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetHostedZone(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetHealthCheckCount(response, &metadata) } - output := &GetHostedZoneOutput{} + output := &GetHealthCheckCountOutput{} out.Result = output var buff [1024]byte @@ -3690,7 +4361,7 @@ func (m *awsRestxml_deserializeOpGetHostedZone) HandleDeserialize(ctx context.Co } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetHostedZoneOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetHealthCheckCountOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3703,7 +4374,7 @@ func (m *awsRestxml_deserializeOpGetHostedZone) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestxml_deserializeOpErrorGetHostedZone(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetHealthCheckCount(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3728,12 +4399,6 @@ func awsRestxml_deserializeOpErrorGetHostedZone(response *smithyhttp.Response, m } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("InvalidInput", errorCode): - return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - - case strings.EqualFold("NoSuchHostedZone", errorCode): - return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3744,13 +4409,13 @@ func awsRestxml_deserializeOpErrorGetHostedZone(response *smithyhttp.Response, m } } -func awsRestxml_deserializeOpDocumentGetHostedZoneOutput(v **GetHostedZoneOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetHealthCheckCountOutput(v **GetHealthCheckCountOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetHostedZoneOutput + var sv *GetHealthCheckCountOutput if *v == nil { - sv = &GetHostedZoneOutput{} + sv = &GetHealthCheckCountOutput{} } else { sv = *v } @@ -3766,22 +4431,21 @@ func awsRestxml_deserializeOpDocumentGetHostedZoneOutput(v **GetHostedZoneOutput originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("DelegationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentDelegationSet(&sv.DelegationSet, nodeDecoder); err != nil { + case strings.EqualFold("HealthCheckCount", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } - - case strings.EqualFold("HostedZone", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentHostedZone(&sv.HostedZone, nodeDecoder); err != nil { - return err + if val == nil { + break } - - case strings.EqualFold("VPCs", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentVPCs(&sv.VPCs, nodeDecoder); err != nil { - return err + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.HealthCheckCount = ptr.Int64(i64) } default: @@ -3798,14 +4462,14 @@ func awsRestxml_deserializeOpDocumentGetHostedZoneOutput(v **GetHostedZoneOutput return nil } -type awsRestxml_deserializeOpGetHostedZoneCount struct { +type awsRestxml_deserializeOpGetHealthCheckLastFailureReason struct { } -func (*awsRestxml_deserializeOpGetHostedZoneCount) ID() string { +func (*awsRestxml_deserializeOpGetHealthCheckLastFailureReason) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetHostedZoneCount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetHealthCheckLastFailureReason) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3819,9 +4483,9 @@ func (m *awsRestxml_deserializeOpGetHostedZoneCount) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetHostedZoneCount(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetHealthCheckLastFailureReason(response, &metadata) } - output := &GetHostedZoneCountOutput{} + output := &GetHealthCheckLastFailureReasonOutput{} out.Result = output var buff [1024]byte @@ -3842,7 +4506,7 @@ func (m *awsRestxml_deserializeOpGetHostedZoneCount) HandleDeserialize(ctx conte } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetHostedZoneCountOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetHealthCheckLastFailureReasonOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3855,7 +4519,7 @@ func (m *awsRestxml_deserializeOpGetHostedZoneCount) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestxml_deserializeOpErrorGetHostedZoneCount(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetHealthCheckLastFailureReason(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3883,6 +4547,9 @@ func awsRestxml_deserializeOpErrorGetHostedZoneCount(response *smithyhttp.Respon case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) + case strings.EqualFold("NoSuchHealthCheck", errorCode): + return awsRestxml_deserializeErrorNoSuchHealthCheck(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3893,13 +4560,13 @@ func awsRestxml_deserializeOpErrorGetHostedZoneCount(response *smithyhttp.Respon } } -func awsRestxml_deserializeOpDocumentGetHostedZoneCountOutput(v **GetHostedZoneCountOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetHealthCheckLastFailureReasonOutput(v **GetHealthCheckLastFailureReasonOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetHostedZoneCountOutput + var sv *GetHealthCheckLastFailureReasonOutput if *v == nil { - sv = &GetHostedZoneCountOutput{} + sv = &GetHealthCheckLastFailureReasonOutput{} } else { sv = *v } @@ -3915,22 +4582,11 @@ func awsRestxml_deserializeOpDocumentGetHostedZoneCountOutput(v **GetHostedZoneC originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("HostedZoneCount", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("HealthCheckObservations", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentHealthCheckObservations(&sv.HealthCheckObservations, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.HostedZoneCount = ptr.Int64(i64) - } default: // Do nothing and ignore the unexpected tag element @@ -3946,14 +4602,14 @@ func awsRestxml_deserializeOpDocumentGetHostedZoneCountOutput(v **GetHostedZoneC return nil } -type awsRestxml_deserializeOpGetHostedZoneLimit struct { +type awsRestxml_deserializeOpGetHealthCheckStatus struct { } -func (*awsRestxml_deserializeOpGetHostedZoneLimit) ID() string { +func (*awsRestxml_deserializeOpGetHealthCheckStatus) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetHostedZoneLimit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetHealthCheckStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3967,9 +4623,9 @@ func (m *awsRestxml_deserializeOpGetHostedZoneLimit) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetHostedZoneLimit(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetHealthCheckStatus(response, &metadata) } - output := &GetHostedZoneLimitOutput{} + output := &GetHealthCheckStatusOutput{} out.Result = output var buff [1024]byte @@ -3990,7 +4646,7 @@ func (m *awsRestxml_deserializeOpGetHostedZoneLimit) HandleDeserialize(ctx conte } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetHostedZoneLimitOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetHealthCheckStatusOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4003,7 +4659,7 @@ func (m *awsRestxml_deserializeOpGetHostedZoneLimit) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestxml_deserializeOpErrorGetHostedZoneLimit(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetHealthCheckStatus(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4028,14 +4684,11 @@ func awsRestxml_deserializeOpErrorGetHostedZoneLimit(response *smithyhttp.Respon } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("HostedZoneNotPrivate", errorCode): - return awsRestxml_deserializeErrorHostedZoneNotPrivate(response, errorBody) - case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NoSuchHostedZone", errorCode): - return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) + case strings.EqualFold("NoSuchHealthCheck", errorCode): + return awsRestxml_deserializeErrorNoSuchHealthCheck(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -4047,13 +4700,13 @@ func awsRestxml_deserializeOpErrorGetHostedZoneLimit(response *smithyhttp.Respon } } -func awsRestxml_deserializeOpDocumentGetHostedZoneLimitOutput(v **GetHostedZoneLimitOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetHealthCheckStatusOutput(v **GetHealthCheckStatusOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetHostedZoneLimitOutput + var sv *GetHealthCheckStatusOutput if *v == nil { - sv = &GetHostedZoneLimitOutput{} + sv = &GetHealthCheckStatusOutput{} } else { sv = *v } @@ -4069,26 +4722,9 @@ func awsRestxml_deserializeOpDocumentGetHostedZoneLimitOutput(v **GetHostedZoneL originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Count", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Count = i64 - } - - case strings.EqualFold("Limit", t.Name.Local): + case strings.EqualFold("HealthCheckObservations", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentHostedZoneLimit(&sv.Limit, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentHealthCheckObservations(&sv.HealthCheckObservations, nodeDecoder); err != nil { return err } @@ -4106,14 +4742,14 @@ func awsRestxml_deserializeOpDocumentGetHostedZoneLimitOutput(v **GetHostedZoneL return nil } -type awsRestxml_deserializeOpGetQueryLoggingConfig struct { +type awsRestxml_deserializeOpGetHostedZone struct { } -func (*awsRestxml_deserializeOpGetQueryLoggingConfig) ID() string { +func (*awsRestxml_deserializeOpGetHostedZone) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetQueryLoggingConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetHostedZone) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4127,9 +4763,9 @@ func (m *awsRestxml_deserializeOpGetQueryLoggingConfig) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetQueryLoggingConfig(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetHostedZone(response, &metadata) } - output := &GetQueryLoggingConfigOutput{} + output := &GetHostedZoneOutput{} out.Result = output var buff [1024]byte @@ -4150,7 +4786,7 @@ func (m *awsRestxml_deserializeOpGetQueryLoggingConfig) HandleDeserialize(ctx co } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetQueryLoggingConfigOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetHostedZoneOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4163,7 +4799,7 @@ func (m *awsRestxml_deserializeOpGetQueryLoggingConfig) HandleDeserialize(ctx co return out, metadata, err } -func awsRestxml_deserializeOpErrorGetQueryLoggingConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetHostedZone(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4191,8 +4827,8 @@ func awsRestxml_deserializeOpErrorGetQueryLoggingConfig(response *smithyhttp.Res case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NoSuchQueryLoggingConfig", errorCode): - return awsRestxml_deserializeErrorNoSuchQueryLoggingConfig(response, errorBody) + case strings.EqualFold("NoSuchHostedZone", errorCode): + return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -4204,13 +4840,13 @@ func awsRestxml_deserializeOpErrorGetQueryLoggingConfig(response *smithyhttp.Res } } -func awsRestxml_deserializeOpDocumentGetQueryLoggingConfigOutput(v **GetQueryLoggingConfigOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetHostedZoneOutput(v **GetHostedZoneOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetQueryLoggingConfigOutput + var sv *GetHostedZoneOutput if *v == nil { - sv = &GetQueryLoggingConfigOutput{} + sv = &GetHostedZoneOutput{} } else { sv = *v } @@ -4226,9 +4862,21 @@ func awsRestxml_deserializeOpDocumentGetQueryLoggingConfigOutput(v **GetQueryLog originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("QueryLoggingConfig", t.Name.Local): + case strings.EqualFold("DelegationSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentQueryLoggingConfig(&sv.QueryLoggingConfig, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentDelegationSet(&sv.DelegationSet, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("HostedZone", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentHostedZone(&sv.HostedZone, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("VPCs", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentVPCs(&sv.VPCs, nodeDecoder); err != nil { return err } @@ -4246,14 +4894,14 @@ func awsRestxml_deserializeOpDocumentGetQueryLoggingConfigOutput(v **GetQueryLog return nil } -type awsRestxml_deserializeOpGetReusableDelegationSet struct { +type awsRestxml_deserializeOpGetHostedZoneCount struct { } -func (*awsRestxml_deserializeOpGetReusableDelegationSet) ID() string { +func (*awsRestxml_deserializeOpGetHostedZoneCount) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetReusableDelegationSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetHostedZoneCount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4267,9 +4915,9 @@ func (m *awsRestxml_deserializeOpGetReusableDelegationSet) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetReusableDelegationSet(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetHostedZoneCount(response, &metadata) } - output := &GetReusableDelegationSetOutput{} + output := &GetHostedZoneCountOutput{} out.Result = output var buff [1024]byte @@ -4290,7 +4938,7 @@ func (m *awsRestxml_deserializeOpGetReusableDelegationSet) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetReusableDelegationSetOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetHostedZoneCountOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4303,7 +4951,7 @@ func (m *awsRestxml_deserializeOpGetReusableDelegationSet) HandleDeserialize(ctx return out, metadata, err } -func awsRestxml_deserializeOpErrorGetReusableDelegationSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetHostedZoneCount(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4328,15 +4976,9 @@ func awsRestxml_deserializeOpErrorGetReusableDelegationSet(response *smithyhttp. } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("DelegationSetNotReusable", errorCode): - return awsRestxml_deserializeErrorDelegationSetNotReusable(response, errorBody) - case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NoSuchDelegationSet", errorCode): - return awsRestxml_deserializeErrorNoSuchDelegationSet(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4347,13 +4989,13 @@ func awsRestxml_deserializeOpErrorGetReusableDelegationSet(response *smithyhttp. } } -func awsRestxml_deserializeOpDocumentGetReusableDelegationSetOutput(v **GetReusableDelegationSetOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetHostedZoneCountOutput(v **GetHostedZoneCountOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetReusableDelegationSetOutput + var sv *GetHostedZoneCountOutput if *v == nil { - sv = &GetReusableDelegationSetOutput{} + sv = &GetHostedZoneCountOutput{} } else { sv = *v } @@ -4369,11 +5011,22 @@ func awsRestxml_deserializeOpDocumentGetReusableDelegationSetOutput(v **GetReusa originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("DelegationSet", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentDelegationSet(&sv.DelegationSet, nodeDecoder); err != nil { + case strings.EqualFold("HostedZoneCount", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.HostedZoneCount = ptr.Int64(i64) + } default: // Do nothing and ignore the unexpected tag element @@ -4389,14 +5042,14 @@ func awsRestxml_deserializeOpDocumentGetReusableDelegationSetOutput(v **GetReusa return nil } -type awsRestxml_deserializeOpGetReusableDelegationSetLimit struct { +type awsRestxml_deserializeOpGetHostedZoneLimit struct { } -func (*awsRestxml_deserializeOpGetReusableDelegationSetLimit) ID() string { +func (*awsRestxml_deserializeOpGetHostedZoneLimit) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetReusableDelegationSetLimit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetHostedZoneLimit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4410,9 +5063,9 @@ func (m *awsRestxml_deserializeOpGetReusableDelegationSetLimit) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetReusableDelegationSetLimit(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetHostedZoneLimit(response, &metadata) } - output := &GetReusableDelegationSetLimitOutput{} + output := &GetHostedZoneLimitOutput{} out.Result = output var buff [1024]byte @@ -4433,7 +5086,7 @@ func (m *awsRestxml_deserializeOpGetReusableDelegationSetLimit) HandleDeserializ } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetReusableDelegationSetLimitOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetHostedZoneLimitOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4446,7 +5099,7 @@ func (m *awsRestxml_deserializeOpGetReusableDelegationSetLimit) HandleDeserializ return out, metadata, err } -func awsRestxml_deserializeOpErrorGetReusableDelegationSetLimit(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetHostedZoneLimit(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4471,11 +5124,14 @@ func awsRestxml_deserializeOpErrorGetReusableDelegationSetLimit(response *smithy } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("HostedZoneNotPrivate", errorCode): + return awsRestxml_deserializeErrorHostedZoneNotPrivate(response, errorBody) + case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NoSuchDelegationSet", errorCode): - return awsRestxml_deserializeErrorNoSuchDelegationSet(response, errorBody) + case strings.EqualFold("NoSuchHostedZone", errorCode): + return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -4487,13 +5143,13 @@ func awsRestxml_deserializeOpErrorGetReusableDelegationSetLimit(response *smithy } } -func awsRestxml_deserializeOpDocumentGetReusableDelegationSetLimitOutput(v **GetReusableDelegationSetLimitOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetHostedZoneLimitOutput(v **GetHostedZoneLimitOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetReusableDelegationSetLimitOutput + var sv *GetHostedZoneLimitOutput if *v == nil { - sv = &GetReusableDelegationSetLimitOutput{} + sv = &GetHostedZoneLimitOutput{} } else { sv = *v } @@ -4528,7 +5184,7 @@ func awsRestxml_deserializeOpDocumentGetReusableDelegationSetLimitOutput(v **Get case strings.EqualFold("Limit", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentReusableDelegationSetLimit(&sv.Limit, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentHostedZoneLimit(&sv.Limit, nodeDecoder); err != nil { return err } @@ -4546,14 +5202,14 @@ func awsRestxml_deserializeOpDocumentGetReusableDelegationSetLimitOutput(v **Get return nil } -type awsRestxml_deserializeOpGetTrafficPolicy struct { +type awsRestxml_deserializeOpGetQueryLoggingConfig struct { } -func (*awsRestxml_deserializeOpGetTrafficPolicy) ID() string { +func (*awsRestxml_deserializeOpGetQueryLoggingConfig) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetTrafficPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetQueryLoggingConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4567,9 +5223,9 @@ func (m *awsRestxml_deserializeOpGetTrafficPolicy) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetTrafficPolicy(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetQueryLoggingConfig(response, &metadata) } - output := &GetTrafficPolicyOutput{} + output := &GetQueryLoggingConfigOutput{} out.Result = output var buff [1024]byte @@ -4590,7 +5246,7 @@ func (m *awsRestxml_deserializeOpGetTrafficPolicy) HandleDeserialize(ctx context } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetTrafficPolicyOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetQueryLoggingConfigOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4603,7 +5259,7 @@ func (m *awsRestxml_deserializeOpGetTrafficPolicy) HandleDeserialize(ctx context return out, metadata, err } -func awsRestxml_deserializeOpErrorGetTrafficPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetQueryLoggingConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4631,8 +5287,8 @@ func awsRestxml_deserializeOpErrorGetTrafficPolicy(response *smithyhttp.Response case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NoSuchTrafficPolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchTrafficPolicy(response, errorBody) + case strings.EqualFold("NoSuchQueryLoggingConfig", errorCode): + return awsRestxml_deserializeErrorNoSuchQueryLoggingConfig(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -4644,13 +5300,13 @@ func awsRestxml_deserializeOpErrorGetTrafficPolicy(response *smithyhttp.Response } } -func awsRestxml_deserializeOpDocumentGetTrafficPolicyOutput(v **GetTrafficPolicyOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetQueryLoggingConfigOutput(v **GetQueryLoggingConfigOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetTrafficPolicyOutput + var sv *GetQueryLoggingConfigOutput if *v == nil { - sv = &GetTrafficPolicyOutput{} + sv = &GetQueryLoggingConfigOutput{} } else { sv = *v } @@ -4666,9 +5322,9 @@ func awsRestxml_deserializeOpDocumentGetTrafficPolicyOutput(v **GetTrafficPolicy originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("TrafficPolicy", t.Name.Local): + case strings.EqualFold("QueryLoggingConfig", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentTrafficPolicy(&sv.TrafficPolicy, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentQueryLoggingConfig(&sv.QueryLoggingConfig, nodeDecoder); err != nil { return err } @@ -4686,14 +5342,14 @@ func awsRestxml_deserializeOpDocumentGetTrafficPolicyOutput(v **GetTrafficPolicy return nil } -type awsRestxml_deserializeOpGetTrafficPolicyInstance struct { +type awsRestxml_deserializeOpGetReusableDelegationSet struct { } -func (*awsRestxml_deserializeOpGetTrafficPolicyInstance) ID() string { +func (*awsRestxml_deserializeOpGetReusableDelegationSet) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetTrafficPolicyInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetReusableDelegationSet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4707,9 +5363,9 @@ func (m *awsRestxml_deserializeOpGetTrafficPolicyInstance) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetTrafficPolicyInstance(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetReusableDelegationSet(response, &metadata) } - output := &GetTrafficPolicyInstanceOutput{} + output := &GetReusableDelegationSetOutput{} out.Result = output var buff [1024]byte @@ -4730,7 +5386,7 @@ func (m *awsRestxml_deserializeOpGetTrafficPolicyInstance) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetTrafficPolicyInstanceOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetReusableDelegationSetOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4743,7 +5399,7 @@ func (m *awsRestxml_deserializeOpGetTrafficPolicyInstance) HandleDeserialize(ctx return out, metadata, err } -func awsRestxml_deserializeOpErrorGetTrafficPolicyInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetReusableDelegationSet(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4768,11 +5424,14 @@ func awsRestxml_deserializeOpErrorGetTrafficPolicyInstance(response *smithyhttp. } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("DelegationSetNotReusable", errorCode): + return awsRestxml_deserializeErrorDelegationSetNotReusable(response, errorBody) + case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NoSuchTrafficPolicyInstance", errorCode): - return awsRestxml_deserializeErrorNoSuchTrafficPolicyInstance(response, errorBody) + case strings.EqualFold("NoSuchDelegationSet", errorCode): + return awsRestxml_deserializeErrorNoSuchDelegationSet(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -4784,13 +5443,13 @@ func awsRestxml_deserializeOpErrorGetTrafficPolicyInstance(response *smithyhttp. } } -func awsRestxml_deserializeOpDocumentGetTrafficPolicyInstanceOutput(v **GetTrafficPolicyInstanceOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetReusableDelegationSetOutput(v **GetReusableDelegationSetOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetTrafficPolicyInstanceOutput + var sv *GetReusableDelegationSetOutput if *v == nil { - sv = &GetTrafficPolicyInstanceOutput{} + sv = &GetReusableDelegationSetOutput{} } else { sv = *v } @@ -4806,9 +5465,9 @@ func awsRestxml_deserializeOpDocumentGetTrafficPolicyInstanceOutput(v **GetTraff originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("TrafficPolicyInstance", t.Name.Local): + case strings.EqualFold("DelegationSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentTrafficPolicyInstance(&sv.TrafficPolicyInstance, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentDelegationSet(&sv.DelegationSet, nodeDecoder); err != nil { return err } @@ -4826,14 +5485,14 @@ func awsRestxml_deserializeOpDocumentGetTrafficPolicyInstanceOutput(v **GetTraff return nil } -type awsRestxml_deserializeOpGetTrafficPolicyInstanceCount struct { +type awsRestxml_deserializeOpGetReusableDelegationSetLimit struct { } -func (*awsRestxml_deserializeOpGetTrafficPolicyInstanceCount) ID() string { +func (*awsRestxml_deserializeOpGetReusableDelegationSetLimit) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetTrafficPolicyInstanceCount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetReusableDelegationSetLimit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4847,9 +5506,9 @@ func (m *awsRestxml_deserializeOpGetTrafficPolicyInstanceCount) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetTrafficPolicyInstanceCount(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetReusableDelegationSetLimit(response, &metadata) } - output := &GetTrafficPolicyInstanceCountOutput{} + output := &GetReusableDelegationSetLimitOutput{} out.Result = output var buff [1024]byte @@ -4870,7 +5529,7 @@ func (m *awsRestxml_deserializeOpGetTrafficPolicyInstanceCount) HandleDeserializ } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetTrafficPolicyInstanceCountOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetReusableDelegationSetLimitOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4883,7 +5542,7 @@ func (m *awsRestxml_deserializeOpGetTrafficPolicyInstanceCount) HandleDeserializ return out, metadata, err } -func awsRestxml_deserializeOpErrorGetTrafficPolicyInstanceCount(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetReusableDelegationSetLimit(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4908,6 +5567,12 @@ func awsRestxml_deserializeOpErrorGetTrafficPolicyInstanceCount(response *smithy } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("InvalidInput", errorCode): + return awsRestxml_deserializeErrorInvalidInput(response, errorBody) + + case strings.EqualFold("NoSuchDelegationSet", errorCode): + return awsRestxml_deserializeErrorNoSuchDelegationSet(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4918,13 +5583,13 @@ func awsRestxml_deserializeOpErrorGetTrafficPolicyInstanceCount(response *smithy } } -func awsRestxml_deserializeOpDocumentGetTrafficPolicyInstanceCountOutput(v **GetTrafficPolicyInstanceCountOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetReusableDelegationSetLimitOutput(v **GetReusableDelegationSetLimitOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetTrafficPolicyInstanceCountOutput + var sv *GetReusableDelegationSetLimitOutput if *v == nil { - sv = &GetTrafficPolicyInstanceCountOutput{} + sv = &GetReusableDelegationSetLimitOutput{} } else { sv = *v } @@ -4940,7 +5605,7 @@ func awsRestxml_deserializeOpDocumentGetTrafficPolicyInstanceCountOutput(v **Get originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("TrafficPolicyInstanceCount", t.Name.Local): + case strings.EqualFold("Count", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -4954,7 +5619,13 @@ func awsRestxml_deserializeOpDocumentGetTrafficPolicyInstanceCountOutput(v **Get if err != nil { return err } - sv.TrafficPolicyInstanceCount = ptr.Int32(int32(i64)) + sv.Count = i64 + } + + case strings.EqualFold("Limit", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentReusableDelegationSetLimit(&sv.Limit, nodeDecoder); err != nil { + return err } default: @@ -4971,14 +5642,14 @@ func awsRestxml_deserializeOpDocumentGetTrafficPolicyInstanceCountOutput(v **Get return nil } -type awsRestxml_deserializeOpListGeoLocations struct { +type awsRestxml_deserializeOpGetTrafficPolicy struct { } -func (*awsRestxml_deserializeOpListGeoLocations) ID() string { +func (*awsRestxml_deserializeOpGetTrafficPolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListGeoLocations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetTrafficPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4992,9 +5663,9 @@ func (m *awsRestxml_deserializeOpListGeoLocations) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListGeoLocations(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetTrafficPolicy(response, &metadata) } - output := &ListGeoLocationsOutput{} + output := &GetTrafficPolicyOutput{} out.Result = output var buff [1024]byte @@ -5015,7 +5686,7 @@ func (m *awsRestxml_deserializeOpListGeoLocations) HandleDeserialize(ctx context } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentListGeoLocationsOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetTrafficPolicyOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5028,7 +5699,7 @@ func (m *awsRestxml_deserializeOpListGeoLocations) HandleDeserialize(ctx context return out, metadata, err } -func awsRestxml_deserializeOpErrorListGeoLocations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetTrafficPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5056,6 +5727,9 @@ func awsRestxml_deserializeOpErrorListGeoLocations(response *smithyhttp.Response case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) + case strings.EqualFold("NoSuchTrafficPolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchTrafficPolicy(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5066,13 +5740,13 @@ func awsRestxml_deserializeOpErrorListGeoLocations(response *smithyhttp.Response } } -func awsRestxml_deserializeOpDocumentListGeoLocationsOutput(v **ListGeoLocationsOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetTrafficPolicyOutput(v **GetTrafficPolicyOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListGeoLocationsOutput + var sv *GetTrafficPolicyOutput if *v == nil { - sv = &ListGeoLocationsOutput{} + sv = &GetTrafficPolicyOutput{} } else { sv = *v } @@ -5088,87 +5762,15 @@ func awsRestxml_deserializeOpDocumentListGeoLocationsOutput(v **ListGeoLocations originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("GeoLocationDetailsList", t.Name.Local): + case strings.EqualFold("TrafficPolicy", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentGeoLocationDetailsList(&sv.GeoLocationDetailsList, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentTrafficPolicy(&sv.TrafficPolicy, nodeDecoder); err != nil { return err } - case strings.EqualFold("IsTruncated", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected PageTruncated to be of type *bool, got %T instead", val) - } - sv.IsTruncated = xtv - } - - case strings.EqualFold("MaxItems", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaxItems = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("NextContinentCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextContinentCode = ptr.String(xtv) - } - - case strings.EqualFold("NextCountryCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextCountryCode = ptr.String(xtv) - } - - case strings.EqualFold("NextSubdivisionCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextSubdivisionCode = ptr.String(xtv) - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() if err != nil { return err } @@ -5180,14 +5782,14 @@ func awsRestxml_deserializeOpDocumentListGeoLocationsOutput(v **ListGeoLocations return nil } -type awsRestxml_deserializeOpListHealthChecks struct { +type awsRestxml_deserializeOpGetTrafficPolicyInstance struct { } -func (*awsRestxml_deserializeOpListHealthChecks) ID() string { +func (*awsRestxml_deserializeOpGetTrafficPolicyInstance) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListHealthChecks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetTrafficPolicyInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5201,9 +5803,9 @@ func (m *awsRestxml_deserializeOpListHealthChecks) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListHealthChecks(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetTrafficPolicyInstance(response, &metadata) } - output := &ListHealthChecksOutput{} + output := &GetTrafficPolicyInstanceOutput{} out.Result = output var buff [1024]byte @@ -5224,7 +5826,7 @@ func (m *awsRestxml_deserializeOpListHealthChecks) HandleDeserialize(ctx context } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentListHealthChecksOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetTrafficPolicyInstanceOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5237,7 +5839,7 @@ func (m *awsRestxml_deserializeOpListHealthChecks) HandleDeserialize(ctx context return out, metadata, err } -func awsRestxml_deserializeOpErrorListHealthChecks(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetTrafficPolicyInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5262,12 +5864,12 @@ func awsRestxml_deserializeOpErrorListHealthChecks(response *smithyhttp.Response } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("IncompatibleVersion", errorCode): - return awsRestxml_deserializeErrorIncompatibleVersion(response, errorBody) - case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) + case strings.EqualFold("NoSuchTrafficPolicyInstance", errorCode): + return awsRestxml_deserializeErrorNoSuchTrafficPolicyInstance(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5278,13 +5880,13 @@ func awsRestxml_deserializeOpErrorListHealthChecks(response *smithyhttp.Response } } -func awsRestxml_deserializeOpDocumentListHealthChecksOutput(v **ListHealthChecksOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetTrafficPolicyInstanceOutput(v **GetTrafficPolicyInstanceOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListHealthChecksOutput + var sv *GetTrafficPolicyInstanceOutput if *v == nil { - sv = &ListHealthChecksOutput{} + sv = &GetTrafficPolicyInstanceOutput{} } else { sv = *v } @@ -5300,70 +5902,11 @@ func awsRestxml_deserializeOpDocumentListHealthChecksOutput(v **ListHealthChecks originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("HealthChecks", t.Name.Local): + case strings.EqualFold("TrafficPolicyInstance", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentHealthChecks(&sv.HealthChecks, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("IsTruncated", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected PageTruncated to be of type *bool, got %T instead", val) - } - sv.IsTruncated = xtv - } - - case strings.EqualFold("Marker", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Marker = ptr.String(xtv) - } - - case strings.EqualFold("MaxItems", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaxItems = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("NextMarker", t.Name.Local): - val, err := decoder.Value() - if err != nil { + if err := awsRestxml_deserializeDocumentTrafficPolicyInstance(&sv.TrafficPolicyInstance, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.NextMarker = ptr.String(xtv) - } default: // Do nothing and ignore the unexpected tag element @@ -5379,14 +5922,14 @@ func awsRestxml_deserializeOpDocumentListHealthChecksOutput(v **ListHealthChecks return nil } -type awsRestxml_deserializeOpListHostedZones struct { +type awsRestxml_deserializeOpGetTrafficPolicyInstanceCount struct { } -func (*awsRestxml_deserializeOpListHostedZones) ID() string { +func (*awsRestxml_deserializeOpGetTrafficPolicyInstanceCount) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListHostedZones) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetTrafficPolicyInstanceCount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5400,9 +5943,9 @@ func (m *awsRestxml_deserializeOpListHostedZones) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListHostedZones(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetTrafficPolicyInstanceCount(response, &metadata) } - output := &ListHostedZonesOutput{} + output := &GetTrafficPolicyInstanceCountOutput{} out.Result = output var buff [1024]byte @@ -5423,7 +5966,7 @@ func (m *awsRestxml_deserializeOpListHostedZones) HandleDeserialize(ctx context. } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentListHostedZonesOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentGetTrafficPolicyInstanceCountOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5436,7 +5979,7 @@ func (m *awsRestxml_deserializeOpListHostedZones) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestxml_deserializeOpErrorListHostedZones(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetTrafficPolicyInstanceCount(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5461,15 +6004,6 @@ func awsRestxml_deserializeOpErrorListHostedZones(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("DelegationSetNotReusable", errorCode): - return awsRestxml_deserializeErrorDelegationSetNotReusable(response, errorBody) - - case strings.EqualFold("InvalidInput", errorCode): - return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - - case strings.EqualFold("NoSuchDelegationSet", errorCode): - return awsRestxml_deserializeErrorNoSuchDelegationSet(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5480,13 +6014,13 @@ func awsRestxml_deserializeOpErrorListHostedZones(response *smithyhttp.Response, } } -func awsRestxml_deserializeOpDocumentListHostedZonesOutput(v **ListHostedZonesOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetTrafficPolicyInstanceCountOutput(v **GetTrafficPolicyInstanceCountOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListHostedZonesOutput + var sv *GetTrafficPolicyInstanceCountOutput if *v == nil { - sv = &ListHostedZonesOutput{} + sv = &GetTrafficPolicyInstanceCountOutput{} } else { sv = *v } @@ -5502,42 +6036,7 @@ func awsRestxml_deserializeOpDocumentListHostedZonesOutput(v **ListHostedZonesOu originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("HostedZones", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentHostedZones(&sv.HostedZones, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("IsTruncated", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected PageTruncated to be of type *bool, got %T instead", val) - } - sv.IsTruncated = xtv - } - - case strings.EqualFold("Marker", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Marker = ptr.String(xtv) - } - - case strings.EqualFold("MaxItems", t.Name.Local): + case strings.EqualFold("TrafficPolicyInstanceCount", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -5551,20 +6050,7 @@ func awsRestxml_deserializeOpDocumentListHostedZonesOutput(v **ListHostedZonesOu if err != nil { return err } - sv.MaxItems = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("NextMarker", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextMarker = ptr.String(xtv) + sv.TrafficPolicyInstanceCount = ptr.Int32(int32(i64)) } default: @@ -5581,14 +6067,14 @@ func awsRestxml_deserializeOpDocumentListHostedZonesOutput(v **ListHostedZonesOu return nil } -type awsRestxml_deserializeOpListHostedZonesByName struct { +type awsRestxml_deserializeOpListGeoLocations struct { } -func (*awsRestxml_deserializeOpListHostedZonesByName) ID() string { +func (*awsRestxml_deserializeOpListGeoLocations) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListHostedZonesByName) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListGeoLocations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5602,9 +6088,9 @@ func (m *awsRestxml_deserializeOpListHostedZonesByName) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListHostedZonesByName(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListGeoLocations(response, &metadata) } - output := &ListHostedZonesByNameOutput{} + output := &ListGeoLocationsOutput{} out.Result = output var buff [1024]byte @@ -5625,7 +6111,7 @@ func (m *awsRestxml_deserializeOpListHostedZonesByName) HandleDeserialize(ctx co } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentListHostedZonesByNameOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentListGeoLocationsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5638,7 +6124,7 @@ func (m *awsRestxml_deserializeOpListHostedZonesByName) HandleDeserialize(ctx co return out, metadata, err } -func awsRestxml_deserializeOpErrorListHostedZonesByName(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListGeoLocations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5663,9 +6149,6 @@ func awsRestxml_deserializeOpErrorListHostedZonesByName(response *smithyhttp.Res } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("InvalidDomainName", errorCode): - return awsRestxml_deserializeErrorInvalidDomainName(response, errorBody) - case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) @@ -5679,13 +6162,13 @@ func awsRestxml_deserializeOpErrorListHostedZonesByName(response *smithyhttp.Res } } -func awsRestxml_deserializeOpDocumentListHostedZonesByNameOutput(v **ListHostedZonesByNameOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListGeoLocationsOutput(v **ListGeoLocationsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListHostedZonesByNameOutput + var sv *ListGeoLocationsOutput if *v == nil { - sv = &ListHostedZonesByNameOutput{} + sv = &ListGeoLocationsOutput{} } else { sv = *v } @@ -5701,7 +6184,13 @@ func awsRestxml_deserializeOpDocumentListHostedZonesByNameOutput(v **ListHostedZ originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("DNSName", t.Name.Local): + case strings.EqualFold("GeoLocationDetailsList", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentGeoLocationDetailsList(&sv.GeoLocationDetailsList, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("IsTruncated", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -5710,11 +6199,14 @@ func awsRestxml_deserializeOpDocumentListHostedZonesByNameOutput(v **ListHostedZ break } { - xtv := string(val) - sv.DNSName = ptr.String(xtv) + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected PageTruncated to be of type *bool, got %T instead", val) + } + sv.IsTruncated = xtv } - case strings.EqualFold("HostedZoneId", t.Name.Local): + case strings.EqualFold("MaxItems", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -5724,32 +6216,14 @@ func awsRestxml_deserializeOpDocumentListHostedZonesByNameOutput(v **ListHostedZ } { xtv := string(val) - sv.HostedZoneId = ptr.String(xtv) - } - - case strings.EqualFold("HostedZones", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentHostedZones(&sv.HostedZones, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("IsTruncated", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) + i64, err := strconv.ParseInt(xtv, 10, 64) if err != nil { - return fmt.Errorf("expected PageTruncated to be of type *bool, got %T instead", val) + return err } - sv.IsTruncated = xtv + sv.MaxItems = ptr.Int32(int32(i64)) } - case strings.EqualFold("MaxItems", t.Name.Local): + case strings.EqualFold("NextContinentCode", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -5759,14 +6233,10 @@ func awsRestxml_deserializeOpDocumentListHostedZonesByNameOutput(v **ListHostedZ } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaxItems = ptr.Int32(int32(i64)) + sv.NextContinentCode = ptr.String(xtv) } - case strings.EqualFold("NextDNSName", t.Name.Local): + case strings.EqualFold("NextCountryCode", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -5776,10 +6246,10 @@ func awsRestxml_deserializeOpDocumentListHostedZonesByNameOutput(v **ListHostedZ } { xtv := string(val) - sv.NextDNSName = ptr.String(xtv) + sv.NextCountryCode = ptr.String(xtv) } - case strings.EqualFold("NextHostedZoneId", t.Name.Local): + case strings.EqualFold("NextSubdivisionCode", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -5789,7 +6259,7 @@ func awsRestxml_deserializeOpDocumentListHostedZonesByNameOutput(v **ListHostedZ } { xtv := string(val) - sv.NextHostedZoneId = ptr.String(xtv) + sv.NextSubdivisionCode = ptr.String(xtv) } default: @@ -5806,14 +6276,14 @@ func awsRestxml_deserializeOpDocumentListHostedZonesByNameOutput(v **ListHostedZ return nil } -type awsRestxml_deserializeOpListHostedZonesByVPC struct { +type awsRestxml_deserializeOpListHealthChecks struct { } -func (*awsRestxml_deserializeOpListHostedZonesByVPC) ID() string { +func (*awsRestxml_deserializeOpListHealthChecks) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListHostedZonesByVPC) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListHealthChecks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5827,9 +6297,9 @@ func (m *awsRestxml_deserializeOpListHostedZonesByVPC) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListHostedZonesByVPC(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListHealthChecks(response, &metadata) } - output := &ListHostedZonesByVPCOutput{} + output := &ListHealthChecksOutput{} out.Result = output var buff [1024]byte @@ -5850,7 +6320,7 @@ func (m *awsRestxml_deserializeOpListHostedZonesByVPC) HandleDeserialize(ctx con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentListHostedZonesByVPCOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentListHealthChecksOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5863,7 +6333,7 @@ func (m *awsRestxml_deserializeOpListHostedZonesByVPC) HandleDeserialize(ctx con return out, metadata, err } -func awsRestxml_deserializeOpErrorListHostedZonesByVPC(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListHealthChecks(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5888,12 +6358,12 @@ func awsRestxml_deserializeOpErrorListHostedZonesByVPC(response *smithyhttp.Resp } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("IncompatibleVersion", errorCode): + return awsRestxml_deserializeErrorIncompatibleVersion(response, errorBody) + case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("InvalidPaginationToken", errorCode): - return awsRestxml_deserializeErrorInvalidPaginationToken(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5904,13 +6374,13 @@ func awsRestxml_deserializeOpErrorListHostedZonesByVPC(response *smithyhttp.Resp } } -func awsRestxml_deserializeOpDocumentListHostedZonesByVPCOutput(v **ListHostedZonesByVPCOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListHealthChecksOutput(v **ListHealthChecksOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListHostedZonesByVPCOutput + var sv *ListHealthChecksOutput if *v == nil { - sv = &ListHostedZonesByVPCOutput{} + sv = &ListHealthChecksOutput{} } else { sv = *v } @@ -5926,11 +6396,40 @@ func awsRestxml_deserializeOpDocumentListHostedZonesByVPCOutput(v **ListHostedZo originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("HostedZoneSummaries", t.Name.Local): + case strings.EqualFold("HealthChecks", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentHostedZoneSummaries(&sv.HostedZoneSummaries, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentHealthChecks(&sv.HealthChecks, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("IsTruncated", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected PageTruncated to be of type *bool, got %T instead", val) + } + sv.IsTruncated = xtv + } + + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } case strings.EqualFold("MaxItems", t.Name.Local): val, err := decoder.Value() @@ -5949,7 +6448,7 @@ func awsRestxml_deserializeOpDocumentListHostedZonesByVPCOutput(v **ListHostedZo sv.MaxItems = ptr.Int32(int32(i64)) } - case strings.EqualFold("NextToken", t.Name.Local): + case strings.EqualFold("NextMarker", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -5959,7 +6458,7 @@ func awsRestxml_deserializeOpDocumentListHostedZonesByVPCOutput(v **ListHostedZo } { xtv := string(val) - sv.NextToken = ptr.String(xtv) + sv.NextMarker = ptr.String(xtv) } default: @@ -5976,14 +6475,14 @@ func awsRestxml_deserializeOpDocumentListHostedZonesByVPCOutput(v **ListHostedZo return nil } -type awsRestxml_deserializeOpListQueryLoggingConfigs struct { +type awsRestxml_deserializeOpListHostedZones struct { } -func (*awsRestxml_deserializeOpListQueryLoggingConfigs) ID() string { +func (*awsRestxml_deserializeOpListHostedZones) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListQueryLoggingConfigs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListHostedZones) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5997,9 +6496,9 @@ func (m *awsRestxml_deserializeOpListQueryLoggingConfigs) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListQueryLoggingConfigs(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListHostedZones(response, &metadata) } - output := &ListQueryLoggingConfigsOutput{} + output := &ListHostedZonesOutput{} out.Result = output var buff [1024]byte @@ -6020,7 +6519,7 @@ func (m *awsRestxml_deserializeOpListQueryLoggingConfigs) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentListQueryLoggingConfigsOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentListHostedZonesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6033,7 +6532,7 @@ func (m *awsRestxml_deserializeOpListQueryLoggingConfigs) HandleDeserialize(ctx return out, metadata, err } -func awsRestxml_deserializeOpErrorListQueryLoggingConfigs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListHostedZones(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6058,14 +6557,14 @@ func awsRestxml_deserializeOpErrorListQueryLoggingConfigs(response *smithyhttp.R } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("DelegationSetNotReusable", errorCode): + return awsRestxml_deserializeErrorDelegationSetNotReusable(response, errorBody) + case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("InvalidPaginationToken", errorCode): - return awsRestxml_deserializeErrorInvalidPaginationToken(response, errorBody) - - case strings.EqualFold("NoSuchHostedZone", errorCode): - return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) + case strings.EqualFold("NoSuchDelegationSet", errorCode): + return awsRestxml_deserializeErrorNoSuchDelegationSet(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -6077,13 +6576,13 @@ func awsRestxml_deserializeOpErrorListQueryLoggingConfigs(response *smithyhttp.R } } -func awsRestxml_deserializeOpDocumentListQueryLoggingConfigsOutput(v **ListQueryLoggingConfigsOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListHostedZonesOutput(v **ListHostedZonesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListQueryLoggingConfigsOutput + var sv *ListHostedZonesOutput if *v == nil { - sv = &ListQueryLoggingConfigsOutput{} + sv = &ListHostedZonesOutput{} } else { sv = *v } @@ -6099,7 +6598,29 @@ func awsRestxml_deserializeOpDocumentListQueryLoggingConfigsOutput(v **ListQuery originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("NextToken", t.Name.Local): + case strings.EqualFold("HostedZones", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentHostedZones(&sv.HostedZones, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("IsTruncated", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected PageTruncated to be of type *bool, got %T instead", val) + } + sv.IsTruncated = xtv + } + + case strings.EqualFold("Marker", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -6109,14 +6630,38 @@ func awsRestxml_deserializeOpDocumentListQueryLoggingConfigsOutput(v **ListQuery } { xtv := string(val) - sv.NextToken = ptr.String(xtv) + sv.Marker = ptr.String(xtv) } - case strings.EqualFold("QueryLoggingConfigs", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentQueryLoggingConfigs(&sv.QueryLoggingConfigs, nodeDecoder); err != nil { + case strings.EqualFold("MaxItems", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MaxItems = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("NextMarker", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.NextMarker = ptr.String(xtv) + } default: // Do nothing and ignore the unexpected tag element @@ -6132,14 +6677,14 @@ func awsRestxml_deserializeOpDocumentListQueryLoggingConfigsOutput(v **ListQuery return nil } -type awsRestxml_deserializeOpListResourceRecordSets struct { +type awsRestxml_deserializeOpListHostedZonesByName struct { } -func (*awsRestxml_deserializeOpListResourceRecordSets) ID() string { +func (*awsRestxml_deserializeOpListHostedZonesByName) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListResourceRecordSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListHostedZonesByName) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6153,9 +6698,9 @@ func (m *awsRestxml_deserializeOpListResourceRecordSets) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListResourceRecordSets(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListHostedZonesByName(response, &metadata) } - output := &ListResourceRecordSetsOutput{} + output := &ListHostedZonesByNameOutput{} out.Result = output var buff [1024]byte @@ -6176,7 +6721,7 @@ func (m *awsRestxml_deserializeOpListResourceRecordSets) HandleDeserialize(ctx c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentListResourceRecordSetsOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentListHostedZonesByNameOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6189,7 +6734,7 @@ func (m *awsRestxml_deserializeOpListResourceRecordSets) HandleDeserialize(ctx c return out, metadata, err } -func awsRestxml_deserializeOpErrorListResourceRecordSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListHostedZonesByName(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6214,12 +6759,12 @@ func awsRestxml_deserializeOpErrorListResourceRecordSets(response *smithyhttp.Re } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("InvalidDomainName", errorCode): + return awsRestxml_deserializeErrorInvalidDomainName(response, errorBody) + case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NoSuchHostedZone", errorCode): - return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -6230,13 +6775,13 @@ func awsRestxml_deserializeOpErrorListResourceRecordSets(response *smithyhttp.Re } } -func awsRestxml_deserializeOpDocumentListResourceRecordSetsOutput(v **ListResourceRecordSetsOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListHostedZonesByNameOutput(v **ListHostedZonesByNameOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListResourceRecordSetsOutput + var sv *ListHostedZonesByNameOutput if *v == nil { - sv = &ListResourceRecordSetsOutput{} + sv = &ListHostedZonesByNameOutput{} } else { sv = *v } @@ -6252,6 +6797,38 @@ func awsRestxml_deserializeOpDocumentListResourceRecordSetsOutput(v **ListResour originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { + case strings.EqualFold("DNSName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DNSName = ptr.String(xtv) + } + + case strings.EqualFold("HostedZoneId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.HostedZoneId = ptr.String(xtv) + } + + case strings.EqualFold("HostedZones", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentHostedZones(&sv.HostedZones, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("IsTruncated", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -6285,20 +6862,7 @@ func awsRestxml_deserializeOpDocumentListResourceRecordSetsOutput(v **ListResour sv.MaxItems = ptr.Int32(int32(i64)) } - case strings.EqualFold("NextRecordIdentifier", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.NextRecordIdentifier = ptr.String(xtv) - } - - case strings.EqualFold("NextRecordName", t.Name.Local): + case strings.EqualFold("NextDNSName", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -6308,10 +6872,10 @@ func awsRestxml_deserializeOpDocumentListResourceRecordSetsOutput(v **ListResour } { xtv := string(val) - sv.NextRecordName = ptr.String(xtv) + sv.NextDNSName = ptr.String(xtv) } - case strings.EqualFold("NextRecordType", t.Name.Local): + case strings.EqualFold("NextHostedZoneId", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -6321,13 +6885,7 @@ func awsRestxml_deserializeOpDocumentListResourceRecordSetsOutput(v **ListResour } { xtv := string(val) - sv.NextRecordType = types.RRType(xtv) - } - - case strings.EqualFold("ResourceRecordSets", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentResourceRecordSets(&sv.ResourceRecordSets, nodeDecoder); err != nil { - return err + sv.NextHostedZoneId = ptr.String(xtv) } default: @@ -6344,14 +6902,14 @@ func awsRestxml_deserializeOpDocumentListResourceRecordSetsOutput(v **ListResour return nil } -type awsRestxml_deserializeOpListReusableDelegationSets struct { +type awsRestxml_deserializeOpListHostedZonesByVPC struct { } -func (*awsRestxml_deserializeOpListReusableDelegationSets) ID() string { +func (*awsRestxml_deserializeOpListHostedZonesByVPC) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListReusableDelegationSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListHostedZonesByVPC) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6365,9 +6923,9 @@ func (m *awsRestxml_deserializeOpListReusableDelegationSets) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListReusableDelegationSets(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListHostedZonesByVPC(response, &metadata) } - output := &ListReusableDelegationSetsOutput{} + output := &ListHostedZonesByVPCOutput{} out.Result = output var buff [1024]byte @@ -6388,7 +6946,7 @@ func (m *awsRestxml_deserializeOpListReusableDelegationSets) HandleDeserialize(c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentListReusableDelegationSetsOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentListHostedZonesByVPCOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6401,7 +6959,7 @@ func (m *awsRestxml_deserializeOpListReusableDelegationSets) HandleDeserialize(c return out, metadata, err } -func awsRestxml_deserializeOpErrorListReusableDelegationSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListHostedZonesByVPC(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6429,6 +6987,9 @@ func awsRestxml_deserializeOpErrorListReusableDelegationSets(response *smithyhtt case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) + case strings.EqualFold("InvalidPaginationToken", errorCode): + return awsRestxml_deserializeErrorInvalidPaginationToken(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -6439,13 +7000,13 @@ func awsRestxml_deserializeOpErrorListReusableDelegationSets(response *smithyhtt } } -func awsRestxml_deserializeOpDocumentListReusableDelegationSetsOutput(v **ListReusableDelegationSetsOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListHostedZonesByVPCOutput(v **ListHostedZonesByVPCOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListReusableDelegationSetsOutput + var sv *ListHostedZonesByVPCOutput if *v == nil { - sv = &ListReusableDelegationSetsOutput{} + sv = &ListHostedZonesByVPCOutput{} } else { sv = *v } @@ -6461,40 +7022,11 @@ func awsRestxml_deserializeOpDocumentListReusableDelegationSetsOutput(v **ListRe originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("DelegationSets", t.Name.Local): + case strings.EqualFold("HostedZoneSummaries", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentDelegationSets(&sv.DelegationSets, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("IsTruncated", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected PageTruncated to be of type *bool, got %T instead", val) - } - sv.IsTruncated = xtv - } - - case strings.EqualFold("Marker", t.Name.Local): - val, err := decoder.Value() - if err != nil { + if err := awsRestxml_deserializeDocumentHostedZoneSummaries(&sv.HostedZoneSummaries, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.Marker = ptr.String(xtv) - } case strings.EqualFold("MaxItems", t.Name.Local): val, err := decoder.Value() @@ -6513,7 +7045,7 @@ func awsRestxml_deserializeOpDocumentListReusableDelegationSetsOutput(v **ListRe sv.MaxItems = ptr.Int32(int32(i64)) } - case strings.EqualFold("NextMarker", t.Name.Local): + case strings.EqualFold("NextToken", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -6523,7 +7055,7 @@ func awsRestxml_deserializeOpDocumentListReusableDelegationSetsOutput(v **ListRe } { xtv := string(val) - sv.NextMarker = ptr.String(xtv) + sv.NextToken = ptr.String(xtv) } default: @@ -6540,14 +7072,14 @@ func awsRestxml_deserializeOpDocumentListReusableDelegationSetsOutput(v **ListRe return nil } -type awsRestxml_deserializeOpListTagsForResource struct { +type awsRestxml_deserializeOpListQueryLoggingConfigs struct { } -func (*awsRestxml_deserializeOpListTagsForResource) ID() string { +func (*awsRestxml_deserializeOpListQueryLoggingConfigs) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListQueryLoggingConfigs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6561,9 +7093,9 @@ func (m *awsRestxml_deserializeOpListTagsForResource) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListQueryLoggingConfigs(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListQueryLoggingConfigsOutput{} out.Result = output var buff [1024]byte @@ -6584,7 +7116,7 @@ func (m *awsRestxml_deserializeOpListTagsForResource) HandleDeserialize(ctx cont } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentListTagsForResourceOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentListQueryLoggingConfigsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6597,7 +7129,7 @@ func (m *awsRestxml_deserializeOpListTagsForResource) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestxml_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListQueryLoggingConfigs(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6625,18 +7157,12 @@ func awsRestxml_deserializeOpErrorListTagsForResource(response *smithyhttp.Respo case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NoSuchHealthCheck", errorCode): - return awsRestxml_deserializeErrorNoSuchHealthCheck(response, errorBody) + case strings.EqualFold("InvalidPaginationToken", errorCode): + return awsRestxml_deserializeErrorInvalidPaginationToken(response, errorBody) case strings.EqualFold("NoSuchHostedZone", errorCode): return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) - case strings.EqualFold("PriorRequestNotComplete", errorCode): - return awsRestxml_deserializeErrorPriorRequestNotComplete(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestxml_deserializeErrorThrottlingException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -6647,13 +7173,13 @@ func awsRestxml_deserializeOpErrorListTagsForResource(response *smithyhttp.Respo } } -func awsRestxml_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListQueryLoggingConfigsOutput(v **ListQueryLoggingConfigsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListTagsForResourceOutput + var sv *ListQueryLoggingConfigsOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &ListQueryLoggingConfigsOutput{} } else { sv = *v } @@ -6669,9 +7195,22 @@ func awsRestxml_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForRe originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("ResourceTagSet", t.Name.Local): + case strings.EqualFold("NextToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextToken = ptr.String(xtv) + } + + case strings.EqualFold("QueryLoggingConfigs", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentResourceTagSet(&sv.ResourceTagSet, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentQueryLoggingConfigs(&sv.QueryLoggingConfigs, nodeDecoder); err != nil { return err } @@ -6689,14 +7228,14 @@ func awsRestxml_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForRe return nil } -type awsRestxml_deserializeOpListTagsForResources struct { +type awsRestxml_deserializeOpListResourceRecordSets struct { } -func (*awsRestxml_deserializeOpListTagsForResources) ID() string { +func (*awsRestxml_deserializeOpListResourceRecordSets) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListTagsForResources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListResourceRecordSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6710,9 +7249,9 @@ func (m *awsRestxml_deserializeOpListTagsForResources) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListTagsForResources(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListResourceRecordSets(response, &metadata) } - output := &ListTagsForResourcesOutput{} + output := &ListResourceRecordSetsOutput{} out.Result = output var buff [1024]byte @@ -6733,7 +7272,7 @@ func (m *awsRestxml_deserializeOpListTagsForResources) HandleDeserialize(ctx con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentListTagsForResourcesOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentListResourceRecordSetsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6746,7 +7285,7 @@ func (m *awsRestxml_deserializeOpListTagsForResources) HandleDeserialize(ctx con return out, metadata, err } -func awsRestxml_deserializeOpErrorListTagsForResources(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListResourceRecordSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6774,18 +7313,9 @@ func awsRestxml_deserializeOpErrorListTagsForResources(response *smithyhttp.Resp case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NoSuchHealthCheck", errorCode): - return awsRestxml_deserializeErrorNoSuchHealthCheck(response, errorBody) - case strings.EqualFold("NoSuchHostedZone", errorCode): return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) - case strings.EqualFold("PriorRequestNotComplete", errorCode): - return awsRestxml_deserializeErrorPriorRequestNotComplete(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestxml_deserializeErrorThrottlingException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -6796,13 +7326,13 @@ func awsRestxml_deserializeOpErrorListTagsForResources(response *smithyhttp.Resp } } -func awsRestxml_deserializeOpDocumentListTagsForResourcesOutput(v **ListTagsForResourcesOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListResourceRecordSetsOutput(v **ListResourceRecordSetsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListTagsForResourcesOutput + var sv *ListResourceRecordSetsOutput if *v == nil { - sv = &ListTagsForResourcesOutput{} + sv = &ListResourceRecordSetsOutput{} } else { sv = *v } @@ -6818,9 +7348,81 @@ func awsRestxml_deserializeOpDocumentListTagsForResourcesOutput(v **ListTagsForR originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("ResourceTagSets", t.Name.Local): + case strings.EqualFold("IsTruncated", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected PageTruncated to be of type *bool, got %T instead", val) + } + sv.IsTruncated = xtv + } + + case strings.EqualFold("MaxItems", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MaxItems = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("NextRecordIdentifier", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextRecordIdentifier = ptr.String(xtv) + } + + case strings.EqualFold("NextRecordName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextRecordName = ptr.String(xtv) + } + + case strings.EqualFold("NextRecordType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextRecordType = types.RRType(xtv) + } + + case strings.EqualFold("ResourceRecordSets", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentResourceTagSetList(&sv.ResourceTagSets, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentResourceRecordSets(&sv.ResourceRecordSets, nodeDecoder); err != nil { return err } @@ -6838,14 +7440,14 @@ func awsRestxml_deserializeOpDocumentListTagsForResourcesOutput(v **ListTagsForR return nil } -type awsRestxml_deserializeOpListTrafficPolicies struct { +type awsRestxml_deserializeOpListReusableDelegationSets struct { } -func (*awsRestxml_deserializeOpListTrafficPolicies) ID() string { +func (*awsRestxml_deserializeOpListReusableDelegationSets) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListTrafficPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListReusableDelegationSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6859,9 +7461,9 @@ func (m *awsRestxml_deserializeOpListTrafficPolicies) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListTrafficPolicies(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListReusableDelegationSets(response, &metadata) } - output := &ListTrafficPoliciesOutput{} + output := &ListReusableDelegationSetsOutput{} out.Result = output var buff [1024]byte @@ -6882,7 +7484,7 @@ func (m *awsRestxml_deserializeOpListTrafficPolicies) HandleDeserialize(ctx cont } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentListTrafficPoliciesOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentListReusableDelegationSetsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6895,7 +7497,7 @@ func (m *awsRestxml_deserializeOpListTrafficPolicies) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestxml_deserializeOpErrorListTrafficPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListReusableDelegationSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6933,13 +7535,13 @@ func awsRestxml_deserializeOpErrorListTrafficPolicies(response *smithyhttp.Respo } } -func awsRestxml_deserializeOpDocumentListTrafficPoliciesOutput(v **ListTrafficPoliciesOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListReusableDelegationSetsOutput(v **ListReusableDelegationSetsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListTrafficPoliciesOutput + var sv *ListReusableDelegationSetsOutput if *v == nil { - sv = &ListTrafficPoliciesOutput{} + sv = &ListReusableDelegationSetsOutput{} } else { sv = *v } @@ -6955,6 +7557,12 @@ func awsRestxml_deserializeOpDocumentListTrafficPoliciesOutput(v **ListTrafficPo originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { + case strings.EqualFold("DelegationSets", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentDelegationSets(&sv.DelegationSets, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("IsTruncated", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -6971,6 +7579,19 @@ func awsRestxml_deserializeOpDocumentListTrafficPoliciesOutput(v **ListTrafficPo sv.IsTruncated = xtv } + case strings.EqualFold("Marker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Marker = ptr.String(xtv) + } + case strings.EqualFold("MaxItems", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -6988,7 +7609,7 @@ func awsRestxml_deserializeOpDocumentListTrafficPoliciesOutput(v **ListTrafficPo sv.MaxItems = ptr.Int32(int32(i64)) } - case strings.EqualFold("TrafficPolicyIdMarker", t.Name.Local): + case strings.EqualFold("NextMarker", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -6998,13 +7619,7 @@ func awsRestxml_deserializeOpDocumentListTrafficPoliciesOutput(v **ListTrafficPo } { xtv := string(val) - sv.TrafficPolicyIdMarker = ptr.String(xtv) - } - - case strings.EqualFold("TrafficPolicySummaries", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentTrafficPolicySummaries(&sv.TrafficPolicySummaries, nodeDecoder); err != nil { - return err + sv.NextMarker = ptr.String(xtv) } default: @@ -7021,14 +7636,14 @@ func awsRestxml_deserializeOpDocumentListTrafficPoliciesOutput(v **ListTrafficPo return nil } -type awsRestxml_deserializeOpListTrafficPolicyInstances struct { +type awsRestxml_deserializeOpListTagsForResource struct { } -func (*awsRestxml_deserializeOpListTrafficPolicyInstances) ID() string { +func (*awsRestxml_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListTrafficPolicyInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_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) @@ -7042,9 +7657,9 @@ func (m *awsRestxml_deserializeOpListTrafficPolicyInstances) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListTrafficPolicyInstances(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &ListTrafficPolicyInstancesOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -7065,7 +7680,7 @@ func (m *awsRestxml_deserializeOpListTrafficPolicyInstances) HandleDeserialize(c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentListTrafficPolicyInstancesOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentListTagsForResourceOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7078,7 +7693,7 @@ func (m *awsRestxml_deserializeOpListTrafficPolicyInstances) HandleDeserialize(c return out, metadata, err } -func awsRestxml_deserializeOpErrorListTrafficPolicyInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_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)} @@ -7106,8 +7721,17 @@ func awsRestxml_deserializeOpErrorListTrafficPolicyInstances(response *smithyhtt case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NoSuchTrafficPolicyInstance", errorCode): - return awsRestxml_deserializeErrorNoSuchTrafficPolicyInstance(response, errorBody) + case strings.EqualFold("NoSuchHealthCheck", errorCode): + return awsRestxml_deserializeErrorNoSuchHealthCheck(response, errorBody) + + case strings.EqualFold("NoSuchHostedZone", errorCode): + return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) + + case strings.EqualFold("PriorRequestNotComplete", errorCode): + return awsRestxml_deserializeErrorPriorRequestNotComplete(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestxml_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -7119,13 +7743,13 @@ func awsRestxml_deserializeOpErrorListTrafficPolicyInstances(response *smithyhtt } } -func awsRestxml_deserializeOpDocumentListTrafficPolicyInstancesOutput(v **ListTrafficPolicyInstancesOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListTrafficPolicyInstancesOutput + var sv *ListTagsForResourceOutput if *v == nil { - sv = &ListTrafficPolicyInstancesOutput{} + sv = &ListTagsForResourceOutput{} } else { sv = *v } @@ -7141,83 +7765,11 @@ func awsRestxml_deserializeOpDocumentListTrafficPolicyInstancesOutput(v **ListTr originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("HostedZoneIdMarker", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HostedZoneIdMarker = ptr.String(xtv) - } - - case strings.EqualFold("IsTruncated", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected PageTruncated to be of type *bool, got %T instead", val) - } - sv.IsTruncated = xtv - } - - case strings.EqualFold("MaxItems", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaxItems = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("TrafficPolicyInstanceNameMarker", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TrafficPolicyInstanceNameMarker = ptr.String(xtv) - } - - case strings.EqualFold("TrafficPolicyInstances", t.Name.Local): + case strings.EqualFold("ResourceTagSet", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentTrafficPolicyInstances(&sv.TrafficPolicyInstances, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("TrafficPolicyInstanceTypeMarker", t.Name.Local): - val, err := decoder.Value() - if err != nil { + if err := awsRestxml_deserializeDocumentResourceTagSet(&sv.ResourceTagSet, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.TrafficPolicyInstanceTypeMarker = types.RRType(xtv) - } default: // Do nothing and ignore the unexpected tag element @@ -7233,14 +7785,14 @@ func awsRestxml_deserializeOpDocumentListTrafficPolicyInstancesOutput(v **ListTr return nil } -type awsRestxml_deserializeOpListTrafficPolicyInstancesByHostedZone struct { +type awsRestxml_deserializeOpListTagsForResources struct { } -func (*awsRestxml_deserializeOpListTrafficPolicyInstancesByHostedZone) ID() string { +func (*awsRestxml_deserializeOpListTagsForResources) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListTrafficPolicyInstancesByHostedZone) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListTagsForResources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7254,9 +7806,9 @@ func (m *awsRestxml_deserializeOpListTrafficPolicyInstancesByHostedZone) HandleD } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListTrafficPolicyInstancesByHostedZone(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListTagsForResources(response, &metadata) } - output := &ListTrafficPolicyInstancesByHostedZoneOutput{} + output := &ListTagsForResourcesOutput{} out.Result = output var buff [1024]byte @@ -7277,7 +7829,7 @@ func (m *awsRestxml_deserializeOpListTrafficPolicyInstancesByHostedZone) HandleD } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentListTrafficPolicyInstancesByHostedZoneOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentListTagsForResourcesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7290,7 +7842,7 @@ func (m *awsRestxml_deserializeOpListTrafficPolicyInstancesByHostedZone) HandleD return out, metadata, err } -func awsRestxml_deserializeOpErrorListTrafficPolicyInstancesByHostedZone(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListTagsForResources(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7318,11 +7870,17 @@ func awsRestxml_deserializeOpErrorListTrafficPolicyInstancesByHostedZone(respons case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) + case strings.EqualFold("NoSuchHealthCheck", errorCode): + return awsRestxml_deserializeErrorNoSuchHealthCheck(response, errorBody) + case strings.EqualFold("NoSuchHostedZone", errorCode): return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) - case strings.EqualFold("NoSuchTrafficPolicyInstance", errorCode): - return awsRestxml_deserializeErrorNoSuchTrafficPolicyInstance(response, errorBody) + case strings.EqualFold("PriorRequestNotComplete", errorCode): + return awsRestxml_deserializeErrorPriorRequestNotComplete(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestxml_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -7334,13 +7892,13 @@ func awsRestxml_deserializeOpErrorListTrafficPolicyInstancesByHostedZone(respons } } -func awsRestxml_deserializeOpDocumentListTrafficPolicyInstancesByHostedZoneOutput(v **ListTrafficPolicyInstancesByHostedZoneOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListTagsForResourcesOutput(v **ListTagsForResourcesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListTrafficPolicyInstancesByHostedZoneOutput + var sv *ListTagsForResourcesOutput if *v == nil { - sv = &ListTrafficPolicyInstancesByHostedZoneOutput{} + sv = &ListTagsForResourcesOutput{} } else { sv = *v } @@ -7356,70 +7914,11 @@ func awsRestxml_deserializeOpDocumentListTrafficPolicyInstancesByHostedZoneOutpu originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("IsTruncated", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected PageTruncated to be of type *bool, got %T instead", val) - } - sv.IsTruncated = xtv - } - - case strings.EqualFold("MaxItems", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.MaxItems = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("TrafficPolicyInstanceNameMarker", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.TrafficPolicyInstanceNameMarker = ptr.String(xtv) - } - - case strings.EqualFold("TrafficPolicyInstances", t.Name.Local): + case strings.EqualFold("ResourceTagSets", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentTrafficPolicyInstances(&sv.TrafficPolicyInstances, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("TrafficPolicyInstanceTypeMarker", t.Name.Local): - val, err := decoder.Value() - if err != nil { + if err := awsRestxml_deserializeDocumentResourceTagSetList(&sv.ResourceTagSets, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.TrafficPolicyInstanceTypeMarker = types.RRType(xtv) - } default: // Do nothing and ignore the unexpected tag element @@ -7435,14 +7934,14 @@ func awsRestxml_deserializeOpDocumentListTrafficPolicyInstancesByHostedZoneOutpu return nil } -type awsRestxml_deserializeOpListTrafficPolicyInstancesByPolicy struct { +type awsRestxml_deserializeOpListTrafficPolicies struct { } -func (*awsRestxml_deserializeOpListTrafficPolicyInstancesByPolicy) ID() string { +func (*awsRestxml_deserializeOpListTrafficPolicies) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListTrafficPolicyInstancesByPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListTrafficPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7456,9 +7955,9 @@ func (m *awsRestxml_deserializeOpListTrafficPolicyInstancesByPolicy) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListTrafficPolicyInstancesByPolicy(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListTrafficPolicies(response, &metadata) } - output := &ListTrafficPolicyInstancesByPolicyOutput{} + output := &ListTrafficPoliciesOutput{} out.Result = output var buff [1024]byte @@ -7479,7 +7978,7 @@ func (m *awsRestxml_deserializeOpListTrafficPolicyInstancesByPolicy) HandleDeser } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentListTrafficPolicyInstancesByPolicyOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentListTrafficPoliciesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7492,7 +7991,7 @@ func (m *awsRestxml_deserializeOpListTrafficPolicyInstancesByPolicy) HandleDeser return out, metadata, err } -func awsRestxml_deserializeOpErrorListTrafficPolicyInstancesByPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListTrafficPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7520,12 +8019,6 @@ func awsRestxml_deserializeOpErrorListTrafficPolicyInstancesByPolicy(response *s case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NoSuchTrafficPolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchTrafficPolicy(response, errorBody) - - case strings.EqualFold("NoSuchTrafficPolicyInstance", errorCode): - return awsRestxml_deserializeErrorNoSuchTrafficPolicyInstance(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7536,13 +8029,13 @@ func awsRestxml_deserializeOpErrorListTrafficPolicyInstancesByPolicy(response *s } } -func awsRestxml_deserializeOpDocumentListTrafficPolicyInstancesByPolicyOutput(v **ListTrafficPolicyInstancesByPolicyOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListTrafficPoliciesOutput(v **ListTrafficPoliciesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListTrafficPolicyInstancesByPolicyOutput + var sv *ListTrafficPoliciesOutput if *v == nil { - sv = &ListTrafficPolicyInstancesByPolicyOutput{} + sv = &ListTrafficPoliciesOutput{} } else { sv = *v } @@ -7558,19 +8051,6 @@ func awsRestxml_deserializeOpDocumentListTrafficPolicyInstancesByPolicyOutput(v originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("HostedZoneIdMarker", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HostedZoneIdMarker = ptr.String(xtv) - } - case strings.EqualFold("IsTruncated", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -7604,7 +8084,7 @@ func awsRestxml_deserializeOpDocumentListTrafficPolicyInstancesByPolicyOutput(v sv.MaxItems = ptr.Int32(int32(i64)) } - case strings.EqualFold("TrafficPolicyInstanceNameMarker", t.Name.Local): + case strings.EqualFold("TrafficPolicyIdMarker", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -7614,27 +8094,14 @@ func awsRestxml_deserializeOpDocumentListTrafficPolicyInstancesByPolicyOutput(v } { xtv := string(val) - sv.TrafficPolicyInstanceNameMarker = ptr.String(xtv) + sv.TrafficPolicyIdMarker = ptr.String(xtv) } - case strings.EqualFold("TrafficPolicyInstances", t.Name.Local): + case strings.EqualFold("TrafficPolicySummaries", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentTrafficPolicyInstances(&sv.TrafficPolicyInstances, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("TrafficPolicyInstanceTypeMarker", t.Name.Local): - val, err := decoder.Value() - if err != nil { + if err := awsRestxml_deserializeDocumentTrafficPolicySummaries(&sv.TrafficPolicySummaries, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.TrafficPolicyInstanceTypeMarker = types.RRType(xtv) - } default: // Do nothing and ignore the unexpected tag element @@ -7650,14 +8117,14 @@ func awsRestxml_deserializeOpDocumentListTrafficPolicyInstancesByPolicyOutput(v return nil } -type awsRestxml_deserializeOpListTrafficPolicyVersions struct { +type awsRestxml_deserializeOpListTrafficPolicyInstances struct { } -func (*awsRestxml_deserializeOpListTrafficPolicyVersions) ID() string { +func (*awsRestxml_deserializeOpListTrafficPolicyInstances) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListTrafficPolicyVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListTrafficPolicyInstances) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7671,9 +8138,9 @@ func (m *awsRestxml_deserializeOpListTrafficPolicyVersions) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListTrafficPolicyVersions(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListTrafficPolicyInstances(response, &metadata) } - output := &ListTrafficPolicyVersionsOutput{} + output := &ListTrafficPolicyInstancesOutput{} out.Result = output var buff [1024]byte @@ -7694,7 +8161,7 @@ func (m *awsRestxml_deserializeOpListTrafficPolicyVersions) HandleDeserialize(ct } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentListTrafficPolicyVersionsOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentListTrafficPolicyInstancesOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7707,7 +8174,7 @@ func (m *awsRestxml_deserializeOpListTrafficPolicyVersions) HandleDeserialize(ct return out, metadata, err } -func awsRestxml_deserializeOpErrorListTrafficPolicyVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListTrafficPolicyInstances(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7735,8 +8202,8 @@ func awsRestxml_deserializeOpErrorListTrafficPolicyVersions(response *smithyhttp case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NoSuchTrafficPolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchTrafficPolicy(response, errorBody) + case strings.EqualFold("NoSuchTrafficPolicyInstance", errorCode): + return awsRestxml_deserializeErrorNoSuchTrafficPolicyInstance(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -7748,13 +8215,13 @@ func awsRestxml_deserializeOpErrorListTrafficPolicyVersions(response *smithyhttp } } -func awsRestxml_deserializeOpDocumentListTrafficPolicyVersionsOutput(v **ListTrafficPolicyVersionsOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListTrafficPolicyInstancesOutput(v **ListTrafficPolicyInstancesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListTrafficPolicyVersionsOutput + var sv *ListTrafficPolicyInstancesOutput if *v == nil { - sv = &ListTrafficPolicyVersionsOutput{} + sv = &ListTrafficPolicyInstancesOutput{} } else { sv = *v } @@ -7770,6 +8237,19 @@ func awsRestxml_deserializeOpDocumentListTrafficPolicyVersionsOutput(v **ListTra originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { + case strings.EqualFold("HostedZoneIdMarker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.HostedZoneIdMarker = ptr.String(xtv) + } + case strings.EqualFold("IsTruncated", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -7803,13 +8283,26 @@ func awsRestxml_deserializeOpDocumentListTrafficPolicyVersionsOutput(v **ListTra sv.MaxItems = ptr.Int32(int32(i64)) } - case strings.EqualFold("TrafficPolicies", t.Name.Local): + case strings.EqualFold("TrafficPolicyInstanceNameMarker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.TrafficPolicyInstanceNameMarker = ptr.String(xtv) + } + + case strings.EqualFold("TrafficPolicyInstances", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentTrafficPolicies(&sv.TrafficPolicies, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentTrafficPolicyInstances(&sv.TrafficPolicyInstances, nodeDecoder); err != nil { return err } - case strings.EqualFold("TrafficPolicyVersionMarker", t.Name.Local): + case strings.EqualFold("TrafficPolicyInstanceTypeMarker", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -7819,7 +8312,7 @@ func awsRestxml_deserializeOpDocumentListTrafficPolicyVersionsOutput(v **ListTra } { xtv := string(val) - sv.TrafficPolicyVersionMarker = ptr.String(xtv) + sv.TrafficPolicyInstanceTypeMarker = types.RRType(xtv) } default: @@ -7836,14 +8329,14 @@ func awsRestxml_deserializeOpDocumentListTrafficPolicyVersionsOutput(v **ListTra return nil } -type awsRestxml_deserializeOpListVPCAssociationAuthorizations struct { +type awsRestxml_deserializeOpListTrafficPolicyInstancesByHostedZone struct { } -func (*awsRestxml_deserializeOpListVPCAssociationAuthorizations) ID() string { +func (*awsRestxml_deserializeOpListTrafficPolicyInstancesByHostedZone) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListVPCAssociationAuthorizations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListTrafficPolicyInstancesByHostedZone) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7857,9 +8350,9 @@ func (m *awsRestxml_deserializeOpListVPCAssociationAuthorizations) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListVPCAssociationAuthorizations(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListTrafficPolicyInstancesByHostedZone(response, &metadata) } - output := &ListVPCAssociationAuthorizationsOutput{} + output := &ListTrafficPolicyInstancesByHostedZoneOutput{} out.Result = output var buff [1024]byte @@ -7880,7 +8373,7 @@ func (m *awsRestxml_deserializeOpListVPCAssociationAuthorizations) HandleDeseria } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentListVPCAssociationAuthorizationsOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentListTrafficPolicyInstancesByHostedZoneOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7893,7 +8386,7 @@ func (m *awsRestxml_deserializeOpListVPCAssociationAuthorizations) HandleDeseria return out, metadata, err } -func awsRestxml_deserializeOpErrorListVPCAssociationAuthorizations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListTrafficPolicyInstancesByHostedZone(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7921,12 +8414,12 @@ func awsRestxml_deserializeOpErrorListVPCAssociationAuthorizations(response *smi case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("InvalidPaginationToken", errorCode): - return awsRestxml_deserializeErrorInvalidPaginationToken(response, errorBody) - case strings.EqualFold("NoSuchHostedZone", errorCode): return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) + case strings.EqualFold("NoSuchTrafficPolicyInstance", errorCode): + return awsRestxml_deserializeErrorNoSuchTrafficPolicyInstance(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -7937,13 +8430,13 @@ func awsRestxml_deserializeOpErrorListVPCAssociationAuthorizations(response *smi } } -func awsRestxml_deserializeOpDocumentListVPCAssociationAuthorizationsOutput(v **ListVPCAssociationAuthorizationsOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListTrafficPolicyInstancesByHostedZoneOutput(v **ListTrafficPolicyInstancesByHostedZoneOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListVPCAssociationAuthorizationsOutput + var sv *ListTrafficPolicyInstancesByHostedZoneOutput if *v == nil { - sv = &ListVPCAssociationAuthorizationsOutput{} + sv = &ListTrafficPolicyInstancesByHostedZoneOutput{} } else { sv = *v } @@ -7959,7 +8452,23 @@ func awsRestxml_deserializeOpDocumentListVPCAssociationAuthorizationsOutput(v ** originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("HostedZoneId", t.Name.Local): + case strings.EqualFold("IsTruncated", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected PageTruncated to be of type *bool, got %T instead", val) + } + sv.IsTruncated = xtv + } + + case strings.EqualFold("MaxItems", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -7969,10 +8478,14 @@ func awsRestxml_deserializeOpDocumentListVPCAssociationAuthorizationsOutput(v ** } { xtv := string(val) - sv.HostedZoneId = ptr.String(xtv) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MaxItems = ptr.Int32(int32(i64)) } - case strings.EqualFold("NextToken", t.Name.Local): + case strings.EqualFold("TrafficPolicyInstanceNameMarker", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -7982,14 +8495,27 @@ func awsRestxml_deserializeOpDocumentListVPCAssociationAuthorizationsOutput(v ** } { xtv := string(val) - sv.NextToken = ptr.String(xtv) + sv.TrafficPolicyInstanceNameMarker = ptr.String(xtv) } - case strings.EqualFold("VPCs", t.Name.Local): + case strings.EqualFold("TrafficPolicyInstances", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentVPCs(&sv.VPCs, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentTrafficPolicyInstances(&sv.TrafficPolicyInstances, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("TrafficPolicyInstanceTypeMarker", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.TrafficPolicyInstanceTypeMarker = types.RRType(xtv) + } default: // Do nothing and ignore the unexpected tag element @@ -8005,14 +8531,14 @@ func awsRestxml_deserializeOpDocumentListVPCAssociationAuthorizationsOutput(v ** return nil } -type awsRestxml_deserializeOpTestDNSAnswer struct { +type awsRestxml_deserializeOpListTrafficPolicyInstancesByPolicy struct { } -func (*awsRestxml_deserializeOpTestDNSAnswer) ID() string { +func (*awsRestxml_deserializeOpListTrafficPolicyInstancesByPolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpTestDNSAnswer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListTrafficPolicyInstancesByPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8026,9 +8552,9 @@ func (m *awsRestxml_deserializeOpTestDNSAnswer) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorTestDNSAnswer(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListTrafficPolicyInstancesByPolicy(response, &metadata) } - output := &TestDNSAnswerOutput{} + output := &ListTrafficPolicyInstancesByPolicyOutput{} out.Result = output var buff [1024]byte @@ -8049,7 +8575,7 @@ func (m *awsRestxml_deserializeOpTestDNSAnswer) HandleDeserialize(ctx context.Co } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentTestDNSAnswerOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentListTrafficPolicyInstancesByPolicyOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8062,7 +8588,7 @@ func (m *awsRestxml_deserializeOpTestDNSAnswer) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestxml_deserializeOpErrorTestDNSAnswer(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListTrafficPolicyInstancesByPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8090,8 +8616,11 @@ func awsRestxml_deserializeOpErrorTestDNSAnswer(response *smithyhttp.Response, m case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NoSuchHostedZone", errorCode): - return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) + case strings.EqualFold("NoSuchTrafficPolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchTrafficPolicy(response, errorBody) + + case strings.EqualFold("NoSuchTrafficPolicyInstance", errorCode): + return awsRestxml_deserializeErrorNoSuchTrafficPolicyInstance(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -8103,13 +8632,13 @@ func awsRestxml_deserializeOpErrorTestDNSAnswer(response *smithyhttp.Response, m } } -func awsRestxml_deserializeOpDocumentTestDNSAnswerOutput(v **TestDNSAnswerOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListTrafficPolicyInstancesByPolicyOutput(v **ListTrafficPolicyInstancesByPolicyOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *TestDNSAnswerOutput + var sv *ListTrafficPolicyInstancesByPolicyOutput if *v == nil { - sv = &TestDNSAnswerOutput{} + sv = &ListTrafficPolicyInstancesByPolicyOutput{} } else { sv = *v } @@ -8125,7 +8654,7 @@ func awsRestxml_deserializeOpDocumentTestDNSAnswerOutput(v **TestDNSAnswerOutput originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Nameserver", t.Name.Local): + case strings.EqualFold("HostedZoneIdMarker", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -8135,10 +8664,10 @@ func awsRestxml_deserializeOpDocumentTestDNSAnswerOutput(v **TestDNSAnswerOutput } { xtv := string(val) - sv.Nameserver = ptr.String(xtv) + sv.HostedZoneIdMarker = ptr.String(xtv) } - case strings.EqualFold("Protocol", t.Name.Local): + case strings.EqualFold("IsTruncated", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -8147,17 +8676,14 @@ func awsRestxml_deserializeOpDocumentTestDNSAnswerOutput(v **TestDNSAnswerOutput break } { - xtv := string(val) - sv.Protocol = ptr.String(xtv) - } - - case strings.EqualFold("RecordData", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentRecordData(&sv.RecordData, nodeDecoder); err != nil { - return err + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected PageTruncated to be of type *bool, got %T instead", val) + } + sv.IsTruncated = xtv } - case strings.EqualFold("RecordName", t.Name.Local): + case strings.EqualFold("MaxItems", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -8167,10 +8693,14 @@ func awsRestxml_deserializeOpDocumentTestDNSAnswerOutput(v **TestDNSAnswerOutput } { xtv := string(val) - sv.RecordName = ptr.String(xtv) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MaxItems = ptr.Int32(int32(i64)) } - case strings.EqualFold("RecordType", t.Name.Local): + case strings.EqualFold("TrafficPolicyInstanceNameMarker", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -8180,10 +8710,16 @@ func awsRestxml_deserializeOpDocumentTestDNSAnswerOutput(v **TestDNSAnswerOutput } { xtv := string(val) - sv.RecordType = types.RRType(xtv) + sv.TrafficPolicyInstanceNameMarker = ptr.String(xtv) } - case strings.EqualFold("ResponseCode", t.Name.Local): + case strings.EqualFold("TrafficPolicyInstances", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentTrafficPolicyInstances(&sv.TrafficPolicyInstances, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("TrafficPolicyInstanceTypeMarker", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -8193,7 +8729,7 @@ func awsRestxml_deserializeOpDocumentTestDNSAnswerOutput(v **TestDNSAnswerOutput } { xtv := string(val) - sv.ResponseCode = ptr.String(xtv) + sv.TrafficPolicyInstanceTypeMarker = types.RRType(xtv) } default: @@ -8210,14 +8746,14 @@ func awsRestxml_deserializeOpDocumentTestDNSAnswerOutput(v **TestDNSAnswerOutput return nil } -type awsRestxml_deserializeOpUpdateHealthCheck struct { +type awsRestxml_deserializeOpListTrafficPolicyVersions struct { } -func (*awsRestxml_deserializeOpUpdateHealthCheck) ID() string { +func (*awsRestxml_deserializeOpListTrafficPolicyVersions) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpUpdateHealthCheck) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListTrafficPolicyVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8231,9 +8767,9 @@ func (m *awsRestxml_deserializeOpUpdateHealthCheck) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorUpdateHealthCheck(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListTrafficPolicyVersions(response, &metadata) } - output := &UpdateHealthCheckOutput{} + output := &ListTrafficPolicyVersionsOutput{} out.Result = output var buff [1024]byte @@ -8254,7 +8790,7 @@ func (m *awsRestxml_deserializeOpUpdateHealthCheck) HandleDeserialize(ctx contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentUpdateHealthCheckOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentListTrafficPolicyVersionsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8267,7 +8803,7 @@ func (m *awsRestxml_deserializeOpUpdateHealthCheck) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestxml_deserializeOpErrorUpdateHealthCheck(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListTrafficPolicyVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8292,14 +8828,11 @@ func awsRestxml_deserializeOpErrorUpdateHealthCheck(response *smithyhttp.Respons } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("HealthCheckVersionMismatch", errorCode): - return awsRestxml_deserializeErrorHealthCheckVersionMismatch(response, errorBody) - case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NoSuchHealthCheck", errorCode): - return awsRestxml_deserializeErrorNoSuchHealthCheck(response, errorBody) + case strings.EqualFold("NoSuchTrafficPolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchTrafficPolicy(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -8311,13 +8844,13 @@ func awsRestxml_deserializeOpErrorUpdateHealthCheck(response *smithyhttp.Respons } } -func awsRestxml_deserializeOpDocumentUpdateHealthCheckOutput(v **UpdateHealthCheckOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListTrafficPolicyVersionsOutput(v **ListTrafficPolicyVersionsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *UpdateHealthCheckOutput + var sv *ListTrafficPolicyVersionsOutput if *v == nil { - sv = &UpdateHealthCheckOutput{} + sv = &ListTrafficPolicyVersionsOutput{} } else { sv = *v } @@ -8333,11 +8866,57 @@ func awsRestxml_deserializeOpDocumentUpdateHealthCheckOutput(v **UpdateHealthChe originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("HealthCheck", t.Name.Local): + case strings.EqualFold("IsTruncated", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected PageTruncated to be of type *bool, got %T instead", val) + } + sv.IsTruncated = xtv + } + + case strings.EqualFold("MaxItems", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MaxItems = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("TrafficPolicies", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentHealthCheck(&sv.HealthCheck, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentTrafficPolicies(&sv.TrafficPolicies, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("TrafficPolicyVersionMarker", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.TrafficPolicyVersionMarker = ptr.String(xtv) + } default: // Do nothing and ignore the unexpected tag element @@ -8353,14 +8932,14 @@ func awsRestxml_deserializeOpDocumentUpdateHealthCheckOutput(v **UpdateHealthChe return nil } -type awsRestxml_deserializeOpUpdateHostedZoneComment struct { +type awsRestxml_deserializeOpListVPCAssociationAuthorizations struct { } -func (*awsRestxml_deserializeOpUpdateHostedZoneComment) ID() string { +func (*awsRestxml_deserializeOpListVPCAssociationAuthorizations) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpUpdateHostedZoneComment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListVPCAssociationAuthorizations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8374,9 +8953,9 @@ func (m *awsRestxml_deserializeOpUpdateHostedZoneComment) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorUpdateHostedZoneComment(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListVPCAssociationAuthorizations(response, &metadata) } - output := &UpdateHostedZoneCommentOutput{} + output := &ListVPCAssociationAuthorizationsOutput{} out.Result = output var buff [1024]byte @@ -8397,7 +8976,7 @@ func (m *awsRestxml_deserializeOpUpdateHostedZoneComment) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentUpdateHostedZoneCommentOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentListVPCAssociationAuthorizationsOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8410,7 +8989,7 @@ func (m *awsRestxml_deserializeOpUpdateHostedZoneComment) HandleDeserialize(ctx return out, metadata, err } -func awsRestxml_deserializeOpErrorUpdateHostedZoneComment(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListVPCAssociationAuthorizations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8438,6 +9017,9 @@ func awsRestxml_deserializeOpErrorUpdateHostedZoneComment(response *smithyhttp.R case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) + case strings.EqualFold("InvalidPaginationToken", errorCode): + return awsRestxml_deserializeErrorInvalidPaginationToken(response, errorBody) + case strings.EqualFold("NoSuchHostedZone", errorCode): return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) @@ -8451,13 +9033,13 @@ func awsRestxml_deserializeOpErrorUpdateHostedZoneComment(response *smithyhttp.R } } -func awsRestxml_deserializeOpDocumentUpdateHostedZoneCommentOutput(v **UpdateHostedZoneCommentOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListVPCAssociationAuthorizationsOutput(v **ListVPCAssociationAuthorizationsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *UpdateHostedZoneCommentOutput + var sv *ListVPCAssociationAuthorizationsOutput if *v == nil { - sv = &UpdateHostedZoneCommentOutput{} + sv = &ListVPCAssociationAuthorizationsOutput{} } else { sv = *v } @@ -8473,9 +9055,35 @@ func awsRestxml_deserializeOpDocumentUpdateHostedZoneCommentOutput(v **UpdateHos originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("HostedZone", t.Name.Local): + case strings.EqualFold("HostedZoneId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.HostedZoneId = ptr.String(xtv) + } + + case strings.EqualFold("NextToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextToken = ptr.String(xtv) + } + + case strings.EqualFold("VPCs", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentHostedZone(&sv.HostedZone, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentVPCs(&sv.VPCs, nodeDecoder); err != nil { return err } @@ -8493,14 +9101,14 @@ func awsRestxml_deserializeOpDocumentUpdateHostedZoneCommentOutput(v **UpdateHos return nil } -type awsRestxml_deserializeOpUpdateTrafficPolicyComment struct { +type awsRestxml_deserializeOpTestDNSAnswer struct { } -func (*awsRestxml_deserializeOpUpdateTrafficPolicyComment) ID() string { +func (*awsRestxml_deserializeOpTestDNSAnswer) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpUpdateTrafficPolicyComment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpTestDNSAnswer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8514,9 +9122,9 @@ func (m *awsRestxml_deserializeOpUpdateTrafficPolicyComment) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorUpdateTrafficPolicyComment(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorTestDNSAnswer(response, &metadata) } - output := &UpdateTrafficPolicyCommentOutput{} + output := &TestDNSAnswerOutput{} out.Result = output var buff [1024]byte @@ -8537,7 +9145,7 @@ func (m *awsRestxml_deserializeOpUpdateTrafficPolicyComment) HandleDeserialize(c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentUpdateTrafficPolicyCommentOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentTestDNSAnswerOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8550,7 +9158,7 @@ func (m *awsRestxml_deserializeOpUpdateTrafficPolicyComment) HandleDeserialize(c return out, metadata, err } -func awsRestxml_deserializeOpErrorUpdateTrafficPolicyComment(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorTestDNSAnswer(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8575,14 +9183,11 @@ func awsRestxml_deserializeOpErrorUpdateTrafficPolicyComment(response *smithyhtt } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("ConcurrentModification", errorCode): - return awsRestxml_deserializeErrorConcurrentModification(response, errorBody) - case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NoSuchTrafficPolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchTrafficPolicy(response, errorBody) + case strings.EqualFold("NoSuchHostedZone", errorCode): + return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -8594,13 +9199,13 @@ func awsRestxml_deserializeOpErrorUpdateTrafficPolicyComment(response *smithyhtt } } -func awsRestxml_deserializeOpDocumentUpdateTrafficPolicyCommentOutput(v **UpdateTrafficPolicyCommentOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentTestDNSAnswerOutput(v **TestDNSAnswerOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *UpdateTrafficPolicyCommentOutput + var sv *TestDNSAnswerOutput if *v == nil { - sv = &UpdateTrafficPolicyCommentOutput{} + sv = &TestDNSAnswerOutput{} } else { sv = *v } @@ -8616,11 +9221,76 @@ func awsRestxml_deserializeOpDocumentUpdateTrafficPolicyCommentOutput(v **Update originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("TrafficPolicy", t.Name.Local): + case strings.EqualFold("Nameserver", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Nameserver = ptr.String(xtv) + } + + case strings.EqualFold("Protocol", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Protocol = ptr.String(xtv) + } + + case strings.EqualFold("RecordData", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentTrafficPolicy(&sv.TrafficPolicy, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentRecordData(&sv.RecordData, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("RecordName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.RecordName = ptr.String(xtv) + } + + case strings.EqualFold("RecordType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.RecordType = types.RRType(xtv) + } + + case strings.EqualFold("ResponseCode", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.ResponseCode = ptr.String(xtv) + } default: // Do nothing and ignore the unexpected tag element @@ -8636,14 +9306,14 @@ func awsRestxml_deserializeOpDocumentUpdateTrafficPolicyCommentOutput(v **Update return nil } -type awsRestxml_deserializeOpUpdateTrafficPolicyInstance struct { +type awsRestxml_deserializeOpUpdateHealthCheck struct { } -func (*awsRestxml_deserializeOpUpdateTrafficPolicyInstance) ID() string { +func (*awsRestxml_deserializeOpUpdateHealthCheck) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpUpdateTrafficPolicyInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpUpdateHealthCheck) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8657,9 +9327,9 @@ func (m *awsRestxml_deserializeOpUpdateTrafficPolicyInstance) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorUpdateTrafficPolicyInstance(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorUpdateHealthCheck(response, &metadata) } - output := &UpdateTrafficPolicyInstanceOutput{} + output := &UpdateHealthCheckOutput{} out.Result = output var buff [1024]byte @@ -8680,7 +9350,7 @@ func (m *awsRestxml_deserializeOpUpdateTrafficPolicyInstance) HandleDeserialize( } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentUpdateTrafficPolicyInstanceOutput(&output, decoder) + err = awsRestxml_deserializeOpDocumentUpdateHealthCheckOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8693,7 +9363,7 @@ func (m *awsRestxml_deserializeOpUpdateTrafficPolicyInstance) HandleDeserialize( return out, metadata, err } -func awsRestxml_deserializeOpErrorUpdateTrafficPolicyInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorUpdateHealthCheck(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8718,20 +9388,14 @@ func awsRestxml_deserializeOpErrorUpdateTrafficPolicyInstance(response *smithyht } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("ConflictingTypes", errorCode): - return awsRestxml_deserializeErrorConflictingTypes(response, errorBody) + case strings.EqualFold("HealthCheckVersionMismatch", errorCode): + return awsRestxml_deserializeErrorHealthCheckVersionMismatch(response, errorBody) case strings.EqualFold("InvalidInput", errorCode): return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - case strings.EqualFold("NoSuchTrafficPolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchTrafficPolicy(response, errorBody) - - case strings.EqualFold("NoSuchTrafficPolicyInstance", errorCode): - return awsRestxml_deserializeErrorNoSuchTrafficPolicyInstance(response, errorBody) - - case strings.EqualFold("PriorRequestNotComplete", errorCode): - return awsRestxml_deserializeErrorPriorRequestNotComplete(response, errorBody) + case strings.EqualFold("NoSuchHealthCheck", errorCode): + return awsRestxml_deserializeErrorNoSuchHealthCheck(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -8743,13 +9407,13 @@ func awsRestxml_deserializeOpErrorUpdateTrafficPolicyInstance(response *smithyht } } -func awsRestxml_deserializeOpDocumentUpdateTrafficPolicyInstanceOutput(v **UpdateTrafficPolicyInstanceOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentUpdateHealthCheckOutput(v **UpdateHealthCheckOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *UpdateTrafficPolicyInstanceOutput + var sv *UpdateHealthCheckOutput if *v == nil { - sv = &UpdateTrafficPolicyInstanceOutput{} + sv = &UpdateHealthCheckOutput{} } else { sv = *v } @@ -8765,9 +9429,9 @@ func awsRestxml_deserializeOpDocumentUpdateTrafficPolicyInstanceOutput(v **Updat originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("TrafficPolicyInstance", t.Name.Local): + case strings.EqualFold("HealthCheck", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentTrafficPolicyInstance(&sv.TrafficPolicyInstance, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentHealthCheck(&sv.HealthCheck, nodeDecoder); err != nil { return err } @@ -8785,272 +9449,440 @@ func awsRestxml_deserializeOpDocumentUpdateTrafficPolicyInstanceOutput(v **Updat return nil } -func awsRestxml_deserializeErrorConcurrentModification(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ConcurrentModification{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return output - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } +type awsRestxml_deserializeOpUpdateHostedZoneComment struct { +} - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("Error") +func (*awsRestxml_deserializeOpUpdateHostedZoneComment) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpUpdateHostedZoneComment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } + return out, metadata, err } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentConcurrentModification(&output, decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } - return output -} + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestxml_deserializeOpErrorUpdateHostedZoneComment(response, &metadata) + } + output := &UpdateHostedZoneCommentOutput{} + out.Result = output -func awsRestxml_deserializeErrorConflictingDomainExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ConflictingDomainExists{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) rootDecoder := xml.NewDecoder(body) t, err := smithyxml.FetchRootElement(rootDecoder) if err == io.EOF { - return output + return out, metadata, nil } if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("Error") + err = awsRestxml_deserializeOpDocumentUpdateHostedZoneCommentOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentConflictingDomainExists(&output, decoder) + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorUpdateHostedZoneComment(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("InvalidInput", errorCode): + return awsRestxml_deserializeErrorInvalidInput(response, errorBody) - return output + case strings.EqualFold("NoSuchHostedZone", errorCode): + return awsRestxml_deserializeErrorNoSuchHostedZone(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } } -func awsRestxml_deserializeErrorConflictingTypes(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ConflictingTypes{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return output +func awsRestxml_deserializeOpDocumentUpdateHostedZoneCommentOutput(v **UpdateHostedZoneCommentOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } + var sv *UpdateHostedZoneCommentOutput + if *v == nil { + sv = &UpdateHostedZoneCommentOutput{} + } else { + sv = *v } - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("Error") - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + for { + t, done, err := decoder.Token() + if err != nil { + return err } - } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("HostedZone", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentHostedZone(&sv.HostedZone, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentConflictingTypes(&output, decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), } + decoder = originalDecoder } + *v = sv + return nil +} - return output +type awsRestxml_deserializeOpUpdateTrafficPolicyComment struct { } -func awsRestxml_deserializeErrorDelegationSetAlreadyCreated(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.DelegationSetAlreadyCreated{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return output - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } +func (*awsRestxml_deserializeOpUpdateTrafficPolicyComment) ID() string { + return "OperationDeserializer" +} - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("Error") +func (m *awsRestxml_deserializeOpUpdateTrafficPolicyComment) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } + return out, metadata, err } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentDelegationSetAlreadyCreated(&output, decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } - return output -} + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestxml_deserializeOpErrorUpdateTrafficPolicyComment(response, &metadata) + } + output := &UpdateTrafficPolicyCommentOutput{} + out.Result = output -func awsRestxml_deserializeErrorDelegationSetAlreadyReusable(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.DelegationSetAlreadyReusable{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) rootDecoder := xml.NewDecoder(body) t, err := smithyxml.FetchRootElement(rootDecoder) if err == io.EOF { - return output + return out, metadata, nil } if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("Error") - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentDelegationSetAlreadyReusable(&output, decoder) + err = awsRestxml_deserializeOpDocumentUpdateTrafficPolicyCommentOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } } - return output + return out, metadata, err } -func awsRestxml_deserializeErrorDelegationSetInUse(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.DelegationSetInUse{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) - rootDecoder := xml.NewDecoder(body) +func awsRestxml_deserializeOpErrorUpdateTrafficPolicyComment(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) + if err != nil { + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ConcurrentModification", errorCode): + return awsRestxml_deserializeErrorConcurrentModification(response, errorBody) + + case strings.EqualFold("InvalidInput", errorCode): + return awsRestxml_deserializeErrorInvalidInput(response, errorBody) + + case strings.EqualFold("NoSuchTrafficPolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchTrafficPolicy(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpDocumentUpdateTrafficPolicyCommentOutput(v **UpdateTrafficPolicyCommentOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *UpdateTrafficPolicyCommentOutput + if *v == nil { + sv = &UpdateTrafficPolicyCommentOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("TrafficPolicy", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentTrafficPolicy(&sv.TrafficPolicy, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +type awsRestxml_deserializeOpUpdateTrafficPolicyInstance struct { +} + +func (*awsRestxml_deserializeOpUpdateTrafficPolicyInstance) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpUpdateTrafficPolicyInstance) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestxml_deserializeOpErrorUpdateTrafficPolicyInstance(response, &metadata) + } + output := &UpdateTrafficPolicyInstanceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) t, err := smithyxml.FetchRootElement(rootDecoder) if err == io.EOF { - return output + return out, metadata, nil } if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - t, err = decoder.GetElement("Error") + err = awsRestxml_deserializeOpDocumentUpdateTrafficPolicyInstanceOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ + return out, metadata, &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } } - decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentDelegationSetInUse(&output, decoder) + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorUpdateTrafficPolicyInstance(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := awsxml.GetErrorResponseComponents(errorBody, false) if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + return err + } + if reqID := errorComponents.RequestID; len(reqID) != 0 { + awsmiddleware.SetRequestIDMetadata(metadata, reqID) + } + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + case strings.EqualFold("ConflictingTypes", errorCode): + return awsRestxml_deserializeErrorConflictingTypes(response, errorBody) + + case strings.EqualFold("InvalidInput", errorCode): + return awsRestxml_deserializeErrorInvalidInput(response, errorBody) + + case strings.EqualFold("NoSuchTrafficPolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchTrafficPolicy(response, errorBody) + + case strings.EqualFold("NoSuchTrafficPolicyInstance", errorCode): + return awsRestxml_deserializeErrorNoSuchTrafficPolicyInstance(response, errorBody) + + case strings.EqualFold("PriorRequestNotComplete", errorCode): + return awsRestxml_deserializeErrorPriorRequestNotComplete(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } + return genericError + } +} - return output +func awsRestxml_deserializeOpDocumentUpdateTrafficPolicyInstanceOutput(v **UpdateTrafficPolicyInstanceOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *UpdateTrafficPolicyInstanceOutput + if *v == nil { + sv = &UpdateTrafficPolicyInstanceOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("TrafficPolicyInstance", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentTrafficPolicyInstance(&sv.TrafficPolicyInstance, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil } -func awsRestxml_deserializeErrorDelegationSetNotAvailable(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.DelegationSetNotAvailable{} +func awsRestxml_deserializeErrorConcurrentModification(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConcurrentModification{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9080,7 +9912,7 @@ func awsRestxml_deserializeErrorDelegationSetNotAvailable(response *smithyhttp.R } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentDelegationSetNotAvailable(&output, decoder) + err = awsRestxml_deserializeDocumentConcurrentModification(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9093,8 +9925,8 @@ func awsRestxml_deserializeErrorDelegationSetNotAvailable(response *smithyhttp.R return output } -func awsRestxml_deserializeErrorDelegationSetNotReusable(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.DelegationSetNotReusable{} +func awsRestxml_deserializeErrorConflictingDomainExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictingDomainExists{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9124,7 +9956,7 @@ func awsRestxml_deserializeErrorDelegationSetNotReusable(response *smithyhttp.Re } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentDelegationSetNotReusable(&output, decoder) + err = awsRestxml_deserializeDocumentConflictingDomainExists(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9137,8 +9969,8 @@ func awsRestxml_deserializeErrorDelegationSetNotReusable(response *smithyhttp.Re return output } -func awsRestxml_deserializeErrorHealthCheckAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.HealthCheckAlreadyExists{} +func awsRestxml_deserializeErrorConflictingTypes(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictingTypes{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9168,7 +10000,7 @@ func awsRestxml_deserializeErrorHealthCheckAlreadyExists(response *smithyhttp.Re } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentHealthCheckAlreadyExists(&output, decoder) + err = awsRestxml_deserializeDocumentConflictingTypes(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9181,8 +10013,8 @@ func awsRestxml_deserializeErrorHealthCheckAlreadyExists(response *smithyhttp.Re return output } -func awsRestxml_deserializeErrorHealthCheckInUse(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.HealthCheckInUse{} +func awsRestxml_deserializeErrorDelegationSetAlreadyCreated(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DelegationSetAlreadyCreated{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9212,7 +10044,7 @@ func awsRestxml_deserializeErrorHealthCheckInUse(response *smithyhttp.Response, } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentHealthCheckInUse(&output, decoder) + err = awsRestxml_deserializeDocumentDelegationSetAlreadyCreated(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9225,8 +10057,8 @@ func awsRestxml_deserializeErrorHealthCheckInUse(response *smithyhttp.Response, return output } -func awsRestxml_deserializeErrorHealthCheckVersionMismatch(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.HealthCheckVersionMismatch{} +func awsRestxml_deserializeErrorDelegationSetAlreadyReusable(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DelegationSetAlreadyReusable{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9256,7 +10088,7 @@ func awsRestxml_deserializeErrorHealthCheckVersionMismatch(response *smithyhttp. } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentHealthCheckVersionMismatch(&output, decoder) + err = awsRestxml_deserializeDocumentDelegationSetAlreadyReusable(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9269,8 +10101,8 @@ func awsRestxml_deserializeErrorHealthCheckVersionMismatch(response *smithyhttp. return output } -func awsRestxml_deserializeErrorHostedZoneAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.HostedZoneAlreadyExists{} +func awsRestxml_deserializeErrorDelegationSetInUse(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DelegationSetInUse{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9300,7 +10132,7 @@ func awsRestxml_deserializeErrorHostedZoneAlreadyExists(response *smithyhttp.Res } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentHostedZoneAlreadyExists(&output, decoder) + err = awsRestxml_deserializeDocumentDelegationSetInUse(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9313,8 +10145,8 @@ func awsRestxml_deserializeErrorHostedZoneAlreadyExists(response *smithyhttp.Res return output } -func awsRestxml_deserializeErrorHostedZoneNotEmpty(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.HostedZoneNotEmpty{} +func awsRestxml_deserializeErrorDelegationSetNotAvailable(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DelegationSetNotAvailable{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9344,7 +10176,7 @@ func awsRestxml_deserializeErrorHostedZoneNotEmpty(response *smithyhttp.Response } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentHostedZoneNotEmpty(&output, decoder) + err = awsRestxml_deserializeDocumentDelegationSetNotAvailable(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9357,8 +10189,8 @@ func awsRestxml_deserializeErrorHostedZoneNotEmpty(response *smithyhttp.Response return output } -func awsRestxml_deserializeErrorHostedZoneNotFound(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.HostedZoneNotFound{} +func awsRestxml_deserializeErrorDelegationSetNotReusable(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DelegationSetNotReusable{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9388,7 +10220,7 @@ func awsRestxml_deserializeErrorHostedZoneNotFound(response *smithyhttp.Response } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentHostedZoneNotFound(&output, decoder) + err = awsRestxml_deserializeDocumentDelegationSetNotReusable(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9401,8 +10233,8 @@ func awsRestxml_deserializeErrorHostedZoneNotFound(response *smithyhttp.Response return output } -func awsRestxml_deserializeErrorHostedZoneNotPrivate(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.HostedZoneNotPrivate{} +func awsRestxml_deserializeErrorDNSSECNotFound(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.DNSSECNotFound{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9432,7 +10264,7 @@ func awsRestxml_deserializeErrorHostedZoneNotPrivate(response *smithyhttp.Respon } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentHostedZoneNotPrivate(&output, decoder) + err = awsRestxml_deserializeDocumentDNSSECNotFound(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9445,8 +10277,8 @@ func awsRestxml_deserializeErrorHostedZoneNotPrivate(response *smithyhttp.Respon return output } -func awsRestxml_deserializeErrorIncompatibleVersion(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.IncompatibleVersion{} +func awsRestxml_deserializeErrorHealthCheckAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.HealthCheckAlreadyExists{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9476,7 +10308,7 @@ func awsRestxml_deserializeErrorIncompatibleVersion(response *smithyhttp.Respons } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentIncompatibleVersion(&output, decoder) + err = awsRestxml_deserializeDocumentHealthCheckAlreadyExists(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9489,8 +10321,8 @@ func awsRestxml_deserializeErrorIncompatibleVersion(response *smithyhttp.Respons return output } -func awsRestxml_deserializeErrorInsufficientCloudWatchLogsResourcePolicy(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InsufficientCloudWatchLogsResourcePolicy{} +func awsRestxml_deserializeErrorHealthCheckInUse(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.HealthCheckInUse{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9520,7 +10352,7 @@ func awsRestxml_deserializeErrorInsufficientCloudWatchLogsResourcePolicy(respons } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentInsufficientCloudWatchLogsResourcePolicy(&output, decoder) + err = awsRestxml_deserializeDocumentHealthCheckInUse(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9533,8 +10365,8 @@ func awsRestxml_deserializeErrorInsufficientCloudWatchLogsResourcePolicy(respons return output } -func awsRestxml_deserializeErrorInvalidArgument(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidArgument{} +func awsRestxml_deserializeErrorHealthCheckVersionMismatch(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.HealthCheckVersionMismatch{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9564,7 +10396,7 @@ func awsRestxml_deserializeErrorInvalidArgument(response *smithyhttp.Response, e } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentInvalidArgument(&output, decoder) + err = awsRestxml_deserializeDocumentHealthCheckVersionMismatch(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9577,8 +10409,8 @@ func awsRestxml_deserializeErrorInvalidArgument(response *smithyhttp.Response, e return output } -func awsRestxml_deserializeErrorInvalidChangeBatch(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidChangeBatch{} +func awsRestxml_deserializeErrorHostedZoneAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.HostedZoneAlreadyExists{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9608,7 +10440,7 @@ func awsRestxml_deserializeErrorInvalidChangeBatch(response *smithyhttp.Response } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentInvalidChangeBatch(&output, decoder) + err = awsRestxml_deserializeDocumentHostedZoneAlreadyExists(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9621,8 +10453,8 @@ func awsRestxml_deserializeErrorInvalidChangeBatch(response *smithyhttp.Response return output } -func awsRestxml_deserializeErrorInvalidDomainName(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidDomainName{} +func awsRestxml_deserializeErrorHostedZoneNotEmpty(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.HostedZoneNotEmpty{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9652,7 +10484,7 @@ func awsRestxml_deserializeErrorInvalidDomainName(response *smithyhttp.Response, } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentInvalidDomainName(&output, decoder) + err = awsRestxml_deserializeDocumentHostedZoneNotEmpty(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9665,8 +10497,8 @@ func awsRestxml_deserializeErrorInvalidDomainName(response *smithyhttp.Response, return output } -func awsRestxml_deserializeErrorInvalidInput(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidInput{} +func awsRestxml_deserializeErrorHostedZoneNotFound(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.HostedZoneNotFound{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9696,7 +10528,7 @@ func awsRestxml_deserializeErrorInvalidInput(response *smithyhttp.Response, erro } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentInvalidInput(&output, decoder) + err = awsRestxml_deserializeDocumentHostedZoneNotFound(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9709,8 +10541,8 @@ func awsRestxml_deserializeErrorInvalidInput(response *smithyhttp.Response, erro return output } -func awsRestxml_deserializeErrorInvalidPaginationToken(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidPaginationToken{} +func awsRestxml_deserializeErrorHostedZoneNotPrivate(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.HostedZoneNotPrivate{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9740,7 +10572,7 @@ func awsRestxml_deserializeErrorInvalidPaginationToken(response *smithyhttp.Resp } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentInvalidPaginationToken(&output, decoder) + err = awsRestxml_deserializeDocumentHostedZoneNotPrivate(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9753,8 +10585,8 @@ func awsRestxml_deserializeErrorInvalidPaginationToken(response *smithyhttp.Resp return output } -func awsRestxml_deserializeErrorInvalidTrafficPolicyDocument(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidTrafficPolicyDocument{} +func awsRestxml_deserializeErrorHostedZonePartiallyDelegated(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.HostedZonePartiallyDelegated{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9784,7 +10616,7 @@ func awsRestxml_deserializeErrorInvalidTrafficPolicyDocument(response *smithyhtt } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentInvalidTrafficPolicyDocument(&output, decoder) + err = awsRestxml_deserializeDocumentHostedZonePartiallyDelegated(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9797,8 +10629,8 @@ func awsRestxml_deserializeErrorInvalidTrafficPolicyDocument(response *smithyhtt return output } -func awsRestxml_deserializeErrorInvalidVPCId(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidVPCId{} +func awsRestxml_deserializeErrorIncompatibleVersion(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.IncompatibleVersion{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9828,7 +10660,7 @@ func awsRestxml_deserializeErrorInvalidVPCId(response *smithyhttp.Response, erro } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentInvalidVPCId(&output, decoder) + err = awsRestxml_deserializeDocumentIncompatibleVersion(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9841,8 +10673,8 @@ func awsRestxml_deserializeErrorInvalidVPCId(response *smithyhttp.Response, erro return output } -func awsRestxml_deserializeErrorLastVPCAssociation(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.LastVPCAssociation{} +func awsRestxml_deserializeErrorInsufficientCloudWatchLogsResourcePolicy(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InsufficientCloudWatchLogsResourcePolicy{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9872,7 +10704,7 @@ func awsRestxml_deserializeErrorLastVPCAssociation(response *smithyhttp.Response } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentLastVPCAssociation(&output, decoder) + err = awsRestxml_deserializeDocumentInsufficientCloudWatchLogsResourcePolicy(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9885,8 +10717,8 @@ func awsRestxml_deserializeErrorLastVPCAssociation(response *smithyhttp.Response return output } -func awsRestxml_deserializeErrorLimitsExceeded(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.LimitsExceeded{} +func awsRestxml_deserializeErrorInvalidArgument(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidArgument{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9916,7 +10748,7 @@ func awsRestxml_deserializeErrorLimitsExceeded(response *smithyhttp.Response, er } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentLimitsExceeded(&output, decoder) + err = awsRestxml_deserializeDocumentInvalidArgument(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9929,8 +10761,8 @@ func awsRestxml_deserializeErrorLimitsExceeded(response *smithyhttp.Response, er return output } -func awsRestxml_deserializeErrorNoSuchChange(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.NoSuchChange{} +func awsRestxml_deserializeErrorInvalidChangeBatch(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidChangeBatch{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -9960,7 +10792,7 @@ func awsRestxml_deserializeErrorNoSuchChange(response *smithyhttp.Response, erro } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentNoSuchChange(&output, decoder) + err = awsRestxml_deserializeDocumentInvalidChangeBatch(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9973,8 +10805,8 @@ func awsRestxml_deserializeErrorNoSuchChange(response *smithyhttp.Response, erro return output } -func awsRestxml_deserializeErrorNoSuchCloudWatchLogsLogGroup(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.NoSuchCloudWatchLogsLogGroup{} +func awsRestxml_deserializeErrorInvalidDomainName(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidDomainName{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10004,7 +10836,7 @@ func awsRestxml_deserializeErrorNoSuchCloudWatchLogsLogGroup(response *smithyhtt } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentNoSuchCloudWatchLogsLogGroup(&output, decoder) + err = awsRestxml_deserializeDocumentInvalidDomainName(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10017,8 +10849,8 @@ func awsRestxml_deserializeErrorNoSuchCloudWatchLogsLogGroup(response *smithyhtt return output } -func awsRestxml_deserializeErrorNoSuchDelegationSet(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.NoSuchDelegationSet{} +func awsRestxml_deserializeErrorInvalidInput(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidInput{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10048,7 +10880,7 @@ func awsRestxml_deserializeErrorNoSuchDelegationSet(response *smithyhttp.Respons } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentNoSuchDelegationSet(&output, decoder) + err = awsRestxml_deserializeDocumentInvalidInput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10061,8 +10893,8 @@ func awsRestxml_deserializeErrorNoSuchDelegationSet(response *smithyhttp.Respons return output } -func awsRestxml_deserializeErrorNoSuchGeoLocation(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.NoSuchGeoLocation{} +func awsRestxml_deserializeErrorInvalidKeySigningKeyName(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidKeySigningKeyName{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10092,7 +10924,7 @@ func awsRestxml_deserializeErrorNoSuchGeoLocation(response *smithyhttp.Response, } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentNoSuchGeoLocation(&output, decoder) + err = awsRestxml_deserializeDocumentInvalidKeySigningKeyName(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10105,8 +10937,8 @@ func awsRestxml_deserializeErrorNoSuchGeoLocation(response *smithyhttp.Response, return output } -func awsRestxml_deserializeErrorNoSuchHealthCheck(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.NoSuchHealthCheck{} +func awsRestxml_deserializeErrorInvalidKeySigningKeyStatus(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidKeySigningKeyStatus{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10136,7 +10968,7 @@ func awsRestxml_deserializeErrorNoSuchHealthCheck(response *smithyhttp.Response, } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentNoSuchHealthCheck(&output, decoder) + err = awsRestxml_deserializeDocumentInvalidKeySigningKeyStatus(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10149,8 +10981,8 @@ func awsRestxml_deserializeErrorNoSuchHealthCheck(response *smithyhttp.Response, return output } -func awsRestxml_deserializeErrorNoSuchHostedZone(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.NoSuchHostedZone{} +func awsRestxml_deserializeErrorInvalidKMSArn(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidKMSArn{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10180,7 +11012,7 @@ func awsRestxml_deserializeErrorNoSuchHostedZone(response *smithyhttp.Response, } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentNoSuchHostedZone(&output, decoder) + err = awsRestxml_deserializeDocumentInvalidKMSArn(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10193,8 +11025,8 @@ func awsRestxml_deserializeErrorNoSuchHostedZone(response *smithyhttp.Response, return output } -func awsRestxml_deserializeErrorNoSuchQueryLoggingConfig(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.NoSuchQueryLoggingConfig{} +func awsRestxml_deserializeErrorInvalidPaginationToken(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidPaginationToken{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10224,7 +11056,7 @@ func awsRestxml_deserializeErrorNoSuchQueryLoggingConfig(response *smithyhttp.Re } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentNoSuchQueryLoggingConfig(&output, decoder) + err = awsRestxml_deserializeDocumentInvalidPaginationToken(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10237,8 +11069,8 @@ func awsRestxml_deserializeErrorNoSuchQueryLoggingConfig(response *smithyhttp.Re return output } -func awsRestxml_deserializeErrorNoSuchTrafficPolicy(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.NoSuchTrafficPolicy{} +func awsRestxml_deserializeErrorInvalidSigningStatus(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidSigningStatus{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10268,7 +11100,7 @@ func awsRestxml_deserializeErrorNoSuchTrafficPolicy(response *smithyhttp.Respons } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentNoSuchTrafficPolicy(&output, decoder) + err = awsRestxml_deserializeDocumentInvalidSigningStatus(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10281,8 +11113,8 @@ func awsRestxml_deserializeErrorNoSuchTrafficPolicy(response *smithyhttp.Respons return output } -func awsRestxml_deserializeErrorNoSuchTrafficPolicyInstance(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.NoSuchTrafficPolicyInstance{} +func awsRestxml_deserializeErrorInvalidTrafficPolicyDocument(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidTrafficPolicyDocument{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10312,7 +11144,7 @@ func awsRestxml_deserializeErrorNoSuchTrafficPolicyInstance(response *smithyhttp } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentNoSuchTrafficPolicyInstance(&output, decoder) + err = awsRestxml_deserializeDocumentInvalidTrafficPolicyDocument(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10325,8 +11157,8 @@ func awsRestxml_deserializeErrorNoSuchTrafficPolicyInstance(response *smithyhttp return output } -func awsRestxml_deserializeErrorNotAuthorizedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.NotAuthorizedException{} +func awsRestxml_deserializeErrorInvalidVPCId(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidVPCId{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10356,7 +11188,7 @@ func awsRestxml_deserializeErrorNotAuthorizedException(response *smithyhttp.Resp } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentNotAuthorizedException(&output, decoder) + err = awsRestxml_deserializeDocumentInvalidVPCId(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10369,8 +11201,8 @@ func awsRestxml_deserializeErrorNotAuthorizedException(response *smithyhttp.Resp return output } -func awsRestxml_deserializeErrorPriorRequestNotComplete(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.PriorRequestNotComplete{} +func awsRestxml_deserializeErrorKeySigningKeyAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.KeySigningKeyAlreadyExists{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10400,7 +11232,7 @@ func awsRestxml_deserializeErrorPriorRequestNotComplete(response *smithyhttp.Res } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentPriorRequestNotComplete(&output, decoder) + err = awsRestxml_deserializeDocumentKeySigningKeyAlreadyExists(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10413,8 +11245,8 @@ func awsRestxml_deserializeErrorPriorRequestNotComplete(response *smithyhttp.Res return output } -func awsRestxml_deserializeErrorPublicZoneVPCAssociation(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.PublicZoneVPCAssociation{} +func awsRestxml_deserializeErrorKeySigningKeyInParentDSRecord(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.KeySigningKeyInParentDSRecord{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10444,7 +11276,7 @@ func awsRestxml_deserializeErrorPublicZoneVPCAssociation(response *smithyhttp.Re } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentPublicZoneVPCAssociation(&output, decoder) + err = awsRestxml_deserializeDocumentKeySigningKeyInParentDSRecord(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10457,8 +11289,8 @@ func awsRestxml_deserializeErrorPublicZoneVPCAssociation(response *smithyhttp.Re return output } -func awsRestxml_deserializeErrorQueryLoggingConfigAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.QueryLoggingConfigAlreadyExists{} +func awsRestxml_deserializeErrorKeySigningKeyInUse(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.KeySigningKeyInUse{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10488,7 +11320,7 @@ func awsRestxml_deserializeErrorQueryLoggingConfigAlreadyExists(response *smithy } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentQueryLoggingConfigAlreadyExists(&output, decoder) + err = awsRestxml_deserializeDocumentKeySigningKeyInUse(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10501,8 +11333,8 @@ func awsRestxml_deserializeErrorQueryLoggingConfigAlreadyExists(response *smithy return output } -func awsRestxml_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.ThrottlingException{} +func awsRestxml_deserializeErrorKeySigningKeyWithActiveStatusNotFound(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.KeySigningKeyWithActiveStatusNotFound{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10532,7 +11364,7 @@ func awsRestxml_deserializeErrorThrottlingException(response *smithyhttp.Respons } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentThrottlingException(&output, decoder) + err = awsRestxml_deserializeDocumentKeySigningKeyWithActiveStatusNotFound(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10545,8 +11377,8 @@ func awsRestxml_deserializeErrorThrottlingException(response *smithyhttp.Respons return output } -func awsRestxml_deserializeErrorTooManyHealthChecks(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyHealthChecks{} +func awsRestxml_deserializeErrorLastVPCAssociation(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.LastVPCAssociation{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10576,7 +11408,7 @@ func awsRestxml_deserializeErrorTooManyHealthChecks(response *smithyhttp.Respons } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentTooManyHealthChecks(&output, decoder) + err = awsRestxml_deserializeDocumentLastVPCAssociation(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10589,8 +11421,8 @@ func awsRestxml_deserializeErrorTooManyHealthChecks(response *smithyhttp.Respons return output } -func awsRestxml_deserializeErrorTooManyHostedZones(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyHostedZones{} +func awsRestxml_deserializeErrorLimitsExceeded(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.LimitsExceeded{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10620,7 +11452,7 @@ func awsRestxml_deserializeErrorTooManyHostedZones(response *smithyhttp.Response } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentTooManyHostedZones(&output, decoder) + err = awsRestxml_deserializeDocumentLimitsExceeded(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10633,8 +11465,8 @@ func awsRestxml_deserializeErrorTooManyHostedZones(response *smithyhttp.Response return output } -func awsRestxml_deserializeErrorTooManyTrafficPolicies(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyTrafficPolicies{} +func awsRestxml_deserializeErrorNoSuchChange(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.NoSuchChange{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10664,7 +11496,7 @@ func awsRestxml_deserializeErrorTooManyTrafficPolicies(response *smithyhttp.Resp } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentTooManyTrafficPolicies(&output, decoder) + err = awsRestxml_deserializeDocumentNoSuchChange(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10677,8 +11509,8 @@ func awsRestxml_deserializeErrorTooManyTrafficPolicies(response *smithyhttp.Resp return output } -func awsRestxml_deserializeErrorTooManyTrafficPolicyInstances(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyTrafficPolicyInstances{} +func awsRestxml_deserializeErrorNoSuchCloudWatchLogsLogGroup(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.NoSuchCloudWatchLogsLogGroup{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10708,7 +11540,7 @@ func awsRestxml_deserializeErrorTooManyTrafficPolicyInstances(response *smithyht } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentTooManyTrafficPolicyInstances(&output, decoder) + err = awsRestxml_deserializeDocumentNoSuchCloudWatchLogsLogGroup(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10721,8 +11553,8 @@ func awsRestxml_deserializeErrorTooManyTrafficPolicyInstances(response *smithyht return output } -func awsRestxml_deserializeErrorTooManyTrafficPolicyVersionsForCurrentPolicy(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyTrafficPolicyVersionsForCurrentPolicy{} +func awsRestxml_deserializeErrorNoSuchDelegationSet(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.NoSuchDelegationSet{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10752,7 +11584,7 @@ func awsRestxml_deserializeErrorTooManyTrafficPolicyVersionsForCurrentPolicy(res } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentTooManyTrafficPolicyVersionsForCurrentPolicy(&output, decoder) + err = awsRestxml_deserializeDocumentNoSuchDelegationSet(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10765,8 +11597,8 @@ func awsRestxml_deserializeErrorTooManyTrafficPolicyVersionsForCurrentPolicy(res return output } -func awsRestxml_deserializeErrorTooManyVPCAssociationAuthorizations(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TooManyVPCAssociationAuthorizations{} +func awsRestxml_deserializeErrorNoSuchGeoLocation(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.NoSuchGeoLocation{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10796,7 +11628,7 @@ func awsRestxml_deserializeErrorTooManyVPCAssociationAuthorizations(response *sm } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentTooManyVPCAssociationAuthorizations(&output, decoder) + err = awsRestxml_deserializeDocumentNoSuchGeoLocation(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10809,8 +11641,8 @@ func awsRestxml_deserializeErrorTooManyVPCAssociationAuthorizations(response *sm return output } -func awsRestxml_deserializeErrorTrafficPolicyAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TrafficPolicyAlreadyExists{} +func awsRestxml_deserializeErrorNoSuchHealthCheck(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.NoSuchHealthCheck{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10840,7 +11672,7 @@ func awsRestxml_deserializeErrorTrafficPolicyAlreadyExists(response *smithyhttp. } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentTrafficPolicyAlreadyExists(&output, decoder) + err = awsRestxml_deserializeDocumentNoSuchHealthCheck(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10853,8 +11685,8 @@ func awsRestxml_deserializeErrorTrafficPolicyAlreadyExists(response *smithyhttp. return output } -func awsRestxml_deserializeErrorTrafficPolicyInstanceAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TrafficPolicyInstanceAlreadyExists{} +func awsRestxml_deserializeErrorNoSuchHostedZone(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.NoSuchHostedZone{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10884,7 +11716,7 @@ func awsRestxml_deserializeErrorTrafficPolicyInstanceAlreadyExists(response *smi } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentTrafficPolicyInstanceAlreadyExists(&output, decoder) + err = awsRestxml_deserializeDocumentNoSuchHostedZone(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10897,8 +11729,8 @@ func awsRestxml_deserializeErrorTrafficPolicyInstanceAlreadyExists(response *smi return output } -func awsRestxml_deserializeErrorTrafficPolicyInUse(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.TrafficPolicyInUse{} +func awsRestxml_deserializeErrorNoSuchKeySigningKey(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.NoSuchKeySigningKey{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10928,7 +11760,7 @@ func awsRestxml_deserializeErrorTrafficPolicyInUse(response *smithyhttp.Response } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentTrafficPolicyInUse(&output, decoder) + err = awsRestxml_deserializeDocumentNoSuchKeySigningKey(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10941,8 +11773,8 @@ func awsRestxml_deserializeErrorTrafficPolicyInUse(response *smithyhttp.Response return output } -func awsRestxml_deserializeErrorVPCAssociationAuthorizationNotFound(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.VPCAssociationAuthorizationNotFound{} +func awsRestxml_deserializeErrorNoSuchQueryLoggingConfig(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.NoSuchQueryLoggingConfig{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -10972,7 +11804,7 @@ func awsRestxml_deserializeErrorVPCAssociationAuthorizationNotFound(response *sm } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentVPCAssociationAuthorizationNotFound(&output, decoder) + err = awsRestxml_deserializeDocumentNoSuchQueryLoggingConfig(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10985,8 +11817,8 @@ func awsRestxml_deserializeErrorVPCAssociationAuthorizationNotFound(response *sm return output } -func awsRestxml_deserializeErrorVPCAssociationNotFound(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.VPCAssociationNotFound{} +func awsRestxml_deserializeErrorNoSuchTrafficPolicy(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.NoSuchTrafficPolicy{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) @@ -11016,7 +11848,7 @@ func awsRestxml_deserializeErrorVPCAssociationNotFound(response *smithyhttp.Resp } decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) - err = awsRestxml_deserializeDocumentVPCAssociationNotFound(&output, decoder) + err = awsRestxml_deserializeDocumentNoSuchTrafficPolicy(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11029,31 +11861,1475 @@ func awsRestxml_deserializeErrorVPCAssociationNotFound(response *smithyhttp.Resp return output } -func awsRestxml_deserializeDocumentAccountLimit(v **types.AccountLimit, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) +func awsRestxml_deserializeErrorNoSuchTrafficPolicyInstance(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.NoSuchTrafficPolicyInstance{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output } - var sv *types.AccountLimit - if *v == nil { - sv = &types.AccountLimit{} - } else { - sv = *v + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } } - for { - t, done, err := decoder.Token() - if err != nil { - return err + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } - if done { - break + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentNoSuchTrafficPolicyInstance(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Type", t.Name.Local): - val, err := decoder.Value() - if err != nil { + } + + return output +} + +func awsRestxml_deserializeErrorNotAuthorizedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.NotAuthorizedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentNotAuthorizedException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeErrorPriorRequestNotComplete(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.PriorRequestNotComplete{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentPriorRequestNotComplete(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeErrorPublicZoneVPCAssociation(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.PublicZoneVPCAssociation{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentPublicZoneVPCAssociation(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeErrorQueryLoggingConfigAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.QueryLoggingConfigAlreadyExists{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentQueryLoggingConfigAlreadyExists(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottlingException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentThrottlingException(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeErrorTooManyHealthChecks(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyHealthChecks{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentTooManyHealthChecks(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeErrorTooManyHostedZones(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyHostedZones{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentTooManyHostedZones(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeErrorTooManyKeySigningKeys(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyKeySigningKeys{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentTooManyKeySigningKeys(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeErrorTooManyTrafficPolicies(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyTrafficPolicies{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentTooManyTrafficPolicies(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeErrorTooManyTrafficPolicyInstances(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyTrafficPolicyInstances{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentTooManyTrafficPolicyInstances(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeErrorTooManyTrafficPolicyVersionsForCurrentPolicy(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyTrafficPolicyVersionsForCurrentPolicy{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentTooManyTrafficPolicyVersionsForCurrentPolicy(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeErrorTooManyVPCAssociationAuthorizations(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyVPCAssociationAuthorizations{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentTooManyVPCAssociationAuthorizations(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeErrorTrafficPolicyAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TrafficPolicyAlreadyExists{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentTrafficPolicyAlreadyExists(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeErrorTrafficPolicyInstanceAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TrafficPolicyInstanceAlreadyExists{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentTrafficPolicyInstanceAlreadyExists(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeErrorTrafficPolicyInUse(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TrafficPolicyInUse{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentTrafficPolicyInUse(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeErrorVPCAssociationAuthorizationNotFound(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.VPCAssociationAuthorizationNotFound{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentVPCAssociationAuthorizationNotFound(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeErrorVPCAssociationNotFound(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.VPCAssociationNotFound{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(errorBody, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return output + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + t, err = decoder.GetElement("Error") + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder = smithyxml.WrapNodeDecoder(decoder.Decoder, t) + err = awsRestxml_deserializeDocumentVPCAssociationNotFound(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return output +} + +func awsRestxml_deserializeDocumentAccountLimit(v **types.AccountLimit, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AccountLimit + if *v == nil { + sv = &types.AccountLimit{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Type", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Type = types.AccountLimitType(xtv) + } + + case strings.EqualFold("Value", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Value = i64 + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentAlarmIdentifier(v **types.AlarmIdentifier, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AlarmIdentifier + if *v == nil { + sv = &types.AlarmIdentifier{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + case strings.EqualFold("Region", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Region = types.CloudWatchRegion(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentAliasTarget(v **types.AliasTarget, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.AliasTarget + if *v == nil { + sv = &types.AliasTarget{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("DNSName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DNSName = ptr.String(xtv) + } + + case strings.EqualFold("EvaluateTargetHealth", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected AliasHealthEnabled to be of type *bool, got %T instead", val) + } + sv.EvaluateTargetHealth = xtv + } + + case strings.EqualFold("HostedZoneId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.HostedZoneId = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentChangeInfo(v **types.ChangeInfo, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ChangeInfo + if *v == nil { + sv = &types.ChangeInfo{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Comment", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Comment = ptr.String(xtv) + } + + case strings.EqualFold("Id", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Id = ptr.String(xtv) + } + + case strings.EqualFold("Status", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Status = types.ChangeStatus(xtv) + } + + case strings.EqualFold("SubmittedAt", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.SubmittedAt = ptr.Time(t) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentCheckerIpRanges(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("member", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentCheckerIpRangesUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsRestxml_deserializeDocumentChildHealthCheckList(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("ChildHealthCheck", t.Name.Local): + var col string + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + col = xtv + } + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentChildHealthCheckListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsRestxml_deserializeDocumentCloudWatchAlarmConfiguration(v **types.CloudWatchAlarmConfiguration, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CloudWatchAlarmConfiguration + if *v == nil { + sv = &types.CloudWatchAlarmConfiguration{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ComparisonOperator", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ComparisonOperator = types.ComparisonOperator(xtv) + } + + case strings.EqualFold("Dimensions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentDimensionList(&sv.Dimensions, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("EvaluationPeriods", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.EvaluationPeriods = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("MetricName", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.MetricName = ptr.String(xtv) + } + + case strings.EqualFold("Namespace", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Namespace = ptr.String(xtv) + } + + case strings.EqualFold("Period", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Period = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("Statistic", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Statistic = types.Statistic(xtv) + } + + case strings.EqualFold("Threshold", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + f64, err := strconv.ParseFloat(xtv, 64) + if err != nil { + return err + } + sv.Threshold = ptr.Float64(f64) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentConcurrentModification(v **types.ConcurrentModification, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ConcurrentModification + if *v == nil { + sv = &types.ConcurrentModification{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentConflictingDomainExists(v **types.ConflictingDomainExists, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ConflictingDomainExists + if *v == nil { + sv = &types.ConflictingDomainExists{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } if val == nil { @@ -11061,10 +13337,46 @@ func awsRestxml_deserializeDocumentAccountLimit(v **types.AccountLimit, decoder } { xtv := string(val) - sv.Type = types.AccountLimitType(xtv) + sv.Message = ptr.String(xtv) } - case strings.EqualFold("Value", t.Name.Local): + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentConflictingTypes(v **types.ConflictingTypes, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ConflictingTypes + if *v == nil { + sv = &types.ConflictingTypes{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11074,11 +13386,7 @@ func awsRestxml_deserializeDocumentAccountLimit(v **types.AccountLimit, decoder } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Value = i64 + sv.Message = ptr.String(xtv) } default: @@ -11095,13 +13403,13 @@ func awsRestxml_deserializeDocumentAccountLimit(v **types.AccountLimit, decoder return nil } -func awsRestxml_deserializeDocumentAlarmIdentifier(v **types.AlarmIdentifier, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentDelegationSet(v **types.DelegationSet, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.AlarmIdentifier + var sv *types.DelegationSet if *v == nil { - sv = &types.AlarmIdentifier{} + sv = &types.DelegationSet{} } else { sv = *v } @@ -11117,7 +13425,7 @@ func awsRestxml_deserializeDocumentAlarmIdentifier(v **types.AlarmIdentifier, de originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Name", t.Name.Local): + case strings.EqualFold("CallerReference", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11127,10 +13435,214 @@ func awsRestxml_deserializeDocumentAlarmIdentifier(v **types.AlarmIdentifier, de } { xtv := string(val) - sv.Name = ptr.String(xtv) + sv.CallerReference = ptr.String(xtv) } - case strings.EqualFold("Region", t.Name.Local): + case strings.EqualFold("Id", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Id = ptr.String(xtv) + } + + case strings.EqualFold("NameServers", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentDelegationSetNameServers(&sv.NameServers, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentDelegationSetAlreadyCreated(v **types.DelegationSetAlreadyCreated, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DelegationSetAlreadyCreated + if *v == nil { + sv = &types.DelegationSetAlreadyCreated{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentDelegationSetAlreadyReusable(v **types.DelegationSetAlreadyReusable, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DelegationSetAlreadyReusable + if *v == nil { + sv = &types.DelegationSetAlreadyReusable{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentDelegationSetInUse(v **types.DelegationSetInUse, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DelegationSetInUse + if *v == nil { + sv = &types.DelegationSetInUse{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentDelegationSetNameServers(v *[]string, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("NameServer", t.Name.Local): + var col string val, err := decoder.Value() if err != nil { return err @@ -11140,11 +13652,11 @@ func awsRestxml_deserializeDocumentAlarmIdentifier(v **types.AlarmIdentifier, de } { xtv := string(val) - sv.Region = types.CloudWatchRegion(xtv) + col = xtv } + sv = append(sv, col) default: - // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -11157,13 +13669,42 @@ func awsRestxml_deserializeDocumentAlarmIdentifier(v **types.AlarmIdentifier, de return nil } -func awsRestxml_deserializeDocumentAliasTarget(v **types.AliasTarget, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentDelegationSetNameServersUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsRestxml_deserializeDocumentDelegationSetNotAvailable(v **types.DelegationSetNotAvailable, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.AliasTarget + var sv *types.DelegationSetNotAvailable if *v == nil { - sv = &types.AliasTarget{} + sv = &types.DelegationSetNotAvailable{} } else { sv = *v } @@ -11179,36 +13720,7 @@ func awsRestxml_deserializeDocumentAliasTarget(v **types.AliasTarget, decoder sm originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("DNSName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.DNSName = ptr.String(xtv) - } - - case strings.EqualFold("EvaluateTargetHealth", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected AliasHealthEnabled to be of type *bool, got %T instead", val) - } - sv.EvaluateTargetHealth = xtv - } - - case strings.EqualFold("HostedZoneId", t.Name.Local): + case strings.EqualFold("message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11218,7 +13730,7 @@ func awsRestxml_deserializeDocumentAliasTarget(v **types.AliasTarget, decoder sm } { xtv := string(val) - sv.HostedZoneId = ptr.String(xtv) + sv.Message = ptr.String(xtv) } default: @@ -11235,13 +13747,13 @@ func awsRestxml_deserializeDocumentAliasTarget(v **types.AliasTarget, decoder sm return nil } -func awsRestxml_deserializeDocumentChangeInfo(v **types.ChangeInfo, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentDelegationSetNotReusable(v **types.DelegationSetNotReusable, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.ChangeInfo + var sv *types.DelegationSetNotReusable if *v == nil { - sv = &types.ChangeInfo{} + sv = &types.DelegationSetNotReusable{} } else { sv = *v } @@ -11257,46 +13769,7 @@ func awsRestxml_deserializeDocumentChangeInfo(v **types.ChangeInfo, decoder smit originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Comment", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Comment = ptr.String(xtv) - } - - case strings.EqualFold("Id", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Id = ptr.String(xtv) - } - - case strings.EqualFold("Status", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Status = types.ChangeStatus(xtv) - } - - case strings.EqualFold("SubmittedAt", t.Name.Local): + case strings.EqualFold("message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11306,11 +13779,7 @@ func awsRestxml_deserializeDocumentChangeInfo(v **types.ChangeInfo, decoder smit } { xtv := string(val) - t, err := smithytime.ParseDateTime(xtv) - if err != nil { - return err - } - sv.SubmittedAt = ptr.Time(t) + sv.Message = ptr.String(xtv) } default: @@ -11327,13 +13796,13 @@ func awsRestxml_deserializeDocumentChangeInfo(v **types.ChangeInfo, decoder smit return nil } -func awsRestxml_deserializeDocumentCheckerIpRanges(v *[]string, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentDelegationSets(v *[]types.DelegationSet, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []string + var sv []types.DelegationSet if *v == nil { - sv = make([]string, 0) + sv = make([]types.DelegationSet, 0) } else { sv = *v } @@ -11347,22 +13816,15 @@ func awsRestxml_deserializeDocumentCheckerIpRanges(v *[]string, decoder smithyxm if done { break } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder switch { - case strings.EqualFold("member", t.Name.Local): - var col string - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("DelegationSet", t.Name.Local): + var col types.DelegationSet + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsRestxml_deserializeDocumentDelegationSet(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - col = xtv - } + col = *destAddr sv = append(sv, col) default: @@ -11378,47 +13840,41 @@ func awsRestxml_deserializeDocumentCheckerIpRanges(v *[]string, decoder smithyxm return nil } -func awsRestxml_deserializeDocumentCheckerIpRangesUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string +func awsRestxml_deserializeDocumentDelegationSetsUnwrapped(v *[]types.DelegationSet, decoder smithyxml.NodeDecoder) error { + var sv []types.DelegationSet if *v == nil { - sv = make([]string, 0) + sv = make([]types.DelegationSet, 0) } else { sv = *v } switch { default: - var mv string + var mv types.DelegationSet t := decoder.StartEl _ = t - val, err := decoder.Value() - if err != nil { + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsRestxml_deserializeDocumentDelegationSet(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } + mv = *destAddr sv = append(sv, mv) } *v = sv return nil } -func awsRestxml_deserializeDocumentChildHealthCheckList(v *[]string, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentDimension(v **types.Dimension, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []string + var sv *types.Dimension if *v == nil { - sv = make([]string, 0) + sv = &types.Dimension{} } else { sv = *v } - originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -11427,11 +13883,10 @@ func awsRestxml_deserializeDocumentChildHealthCheckList(v *[]string, decoder smi if done { break } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("ChildHealthCheck", t.Name.Local): - var col string + case strings.EqualFold("Name", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11441,8 +13896,65 @@ func awsRestxml_deserializeDocumentChildHealthCheckList(v *[]string, decoder smi } { xtv := string(val) - col = xtv + sv.Name = ptr.String(xtv) + } + + case strings.EqualFold("Value", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Value = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentDimensionList(v *[]types.Dimension, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.Dimension + if *v == nil { + sv = make([]types.Dimension, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("Dimension", t.Name.Local): + var col types.Dimension + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsRestxml_deserializeDocumentDimension(&destAddr, nodeDecoder); err != nil { + return err } + col = *destAddr sv = append(sv, col) default: @@ -11458,42 +13970,37 @@ func awsRestxml_deserializeDocumentChildHealthCheckList(v *[]string, decoder smi return nil } -func awsRestxml_deserializeDocumentChildHealthCheckListUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string +func awsRestxml_deserializeDocumentDimensionListUnwrapped(v *[]types.Dimension, decoder smithyxml.NodeDecoder) error { + var sv []types.Dimension if *v == nil { - sv = make([]string, 0) + sv = make([]types.Dimension, 0) } else { sv = *v } switch { default: - var mv string + var mv types.Dimension t := decoder.StartEl _ = t - val, err := decoder.Value() - if err != nil { + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsRestxml_deserializeDocumentDimension(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } + mv = *destAddr sv = append(sv, mv) } *v = sv return nil } -func awsRestxml_deserializeDocumentCloudWatchAlarmConfiguration(v **types.CloudWatchAlarmConfiguration, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentDNSSECNotFound(v **types.DNSSECNotFound, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.CloudWatchAlarmConfiguration + var sv *types.DNSSECNotFound if *v == nil { - sv = &types.CloudWatchAlarmConfiguration{} + sv = &types.DNSSECNotFound{} } else { sv = *v } @@ -11509,26 +14016,7 @@ func awsRestxml_deserializeDocumentCloudWatchAlarmConfiguration(v **types.CloudW originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("ComparisonOperator", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.ComparisonOperator = types.ComparisonOperator(xtv) - } - - case strings.EqualFold("Dimensions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentDimensionList(&sv.Dimensions, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("EvaluationPeriods", t.Name.Local): + case strings.EqualFold("message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11538,57 +14026,46 @@ func awsRestxml_deserializeDocumentCloudWatchAlarmConfiguration(v **types.CloudW } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.EvaluationPeriods = ptr.Int32(int32(i64)) + sv.Message = ptr.String(xtv) } - case strings.EqualFold("MetricName", t.Name.Local): - val, err := decoder.Value() + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() if err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.MetricName = ptr.String(xtv) - } - case strings.EqualFold("Namespace", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Namespace = ptr.String(xtv) - } + } + decoder = originalDecoder + } + *v = sv + return nil +} - case strings.EqualFold("Period", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Period = ptr.Int32(int32(i64)) - } +func awsRestxml_deserializeDocumentDNSSECStatus(v **types.DNSSECStatus, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.DNSSECStatus + if *v == nil { + sv = &types.DNSSECStatus{} + } else { + sv = *v + } - case strings.EqualFold("Statistic", t.Name.Local): + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ServeSignature", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11598,10 +14075,10 @@ func awsRestxml_deserializeDocumentCloudWatchAlarmConfiguration(v **types.CloudW } { xtv := string(val) - sv.Statistic = types.Statistic(xtv) + sv.ServeSignature = ptr.String(xtv) } - case strings.EqualFold("Threshold", t.Name.Local): + case strings.EqualFold("StatusMessage", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11611,11 +14088,7 @@ func awsRestxml_deserializeDocumentCloudWatchAlarmConfiguration(v **types.CloudW } { xtv := string(val) - f64, err := strconv.ParseFloat(xtv, 64) - if err != nil { - return err - } - sv.Threshold = ptr.Float64(f64) + sv.StatusMessage = ptr.String(xtv) } default: @@ -11632,17 +14105,18 @@ func awsRestxml_deserializeDocumentCloudWatchAlarmConfiguration(v **types.CloudW return nil } -func awsRestxml_deserializeDocumentConcurrentModification(v **types.ConcurrentModification, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentErrorMessages(v *[]string, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.ConcurrentModification + var sv []string if *v == nil { - sv = &types.ConcurrentModification{} + sv = make([]string, 0) } else { sv = *v } + originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -11651,10 +14125,11 @@ func awsRestxml_deserializeDocumentConcurrentModification(v **types.ConcurrentMo if done { break } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder switch { - case strings.EqualFold("message", t.Name.Local): + case strings.EqualFold("Message", t.Name.Local): + var col string val, err := decoder.Value() if err != nil { return err @@ -11664,11 +14139,11 @@ func awsRestxml_deserializeDocumentConcurrentModification(v **types.ConcurrentMo } { xtv := string(val) - sv.Message = ptr.String(xtv) + col = xtv } + sv = append(sv, col) default: - // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -11681,13 +14156,42 @@ func awsRestxml_deserializeDocumentConcurrentModification(v **types.ConcurrentMo return nil } -func awsRestxml_deserializeDocumentConflictingDomainExists(v **types.ConflictingDomainExists, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentErrorMessagesUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { + var sv []string + if *v == nil { + sv = make([]string, 0) + } else { + sv = *v + } + + switch { + default: + var mv string + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = xtv + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsRestxml_deserializeDocumentGeoLocation(v **types.GeoLocation, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.ConflictingDomainExists + var sv *types.GeoLocation if *v == nil { - sv = &types.ConflictingDomainExists{} + sv = &types.GeoLocation{} } else { sv = *v } @@ -11703,7 +14207,7 @@ func awsRestxml_deserializeDocumentConflictingDomainExists(v **types.Conflicting originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("message", t.Name.Local): + case strings.EqualFold("ContinentCode", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11713,7 +14217,33 @@ func awsRestxml_deserializeDocumentConflictingDomainExists(v **types.Conflicting } { xtv := string(val) - sv.Message = ptr.String(xtv) + sv.ContinentCode = ptr.String(xtv) + } + + case strings.EqualFold("CountryCode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CountryCode = ptr.String(xtv) + } + + case strings.EqualFold("SubdivisionCode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SubdivisionCode = ptr.String(xtv) } default: @@ -11730,13 +14260,13 @@ func awsRestxml_deserializeDocumentConflictingDomainExists(v **types.Conflicting return nil } -func awsRestxml_deserializeDocumentConflictingTypes(v **types.ConflictingTypes, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentGeoLocationDetails(v **types.GeoLocationDetails, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.ConflictingTypes + var sv *types.GeoLocationDetails if *v == nil { - sv = &types.ConflictingTypes{} + sv = &types.GeoLocationDetails{} } else { sv = *v } @@ -11752,7 +14282,7 @@ func awsRestxml_deserializeDocumentConflictingTypes(v **types.ConflictingTypes, originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("message", t.Name.Local): + case strings.EqualFold("ContinentCode", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11762,46 +14292,36 @@ func awsRestxml_deserializeDocumentConflictingTypes(v **types.ConflictingTypes, } { xtv := string(val) - sv.Message = ptr.String(xtv) + sv.ContinentCode = ptr.String(xtv) } - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() + case strings.EqualFold("ContinentName", t.Name.Local): + val, err := decoder.Value() if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.ContinentName = ptr.String(xtv) + } - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsRestxml_deserializeDocumentDelegationSet(v **types.DelegationSet, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DelegationSet - if *v == nil { - sv = &types.DelegationSet{} - } else { - sv = *v - } + case strings.EqualFold("CountryCode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CountryCode = ptr.String(xtv) + } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("CallerReference", t.Name.Local): + case strings.EqualFold("CountryName", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11811,10 +14331,10 @@ func awsRestxml_deserializeDocumentDelegationSet(v **types.DelegationSet, decode } { xtv := string(val) - sv.CallerReference = ptr.String(xtv) + sv.CountryName = ptr.String(xtv) } - case strings.EqualFold("Id", t.Name.Local): + case strings.EqualFold("SubdivisionCode", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11824,14 +14344,21 @@ func awsRestxml_deserializeDocumentDelegationSet(v **types.DelegationSet, decode } { xtv := string(val) - sv.Id = ptr.String(xtv) + sv.SubdivisionCode = ptr.String(xtv) } - case strings.EqualFold("NameServers", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentDelegationSetNameServers(&sv.NameServers, nodeDecoder); err != nil { + case strings.EqualFold("SubdivisionName", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.SubdivisionName = ptr.String(xtv) + } default: // Do nothing and ignore the unexpected tag element @@ -11847,17 +14374,18 @@ func awsRestxml_deserializeDocumentDelegationSet(v **types.DelegationSet, decode return nil } -func awsRestxml_deserializeDocumentDelegationSetAlreadyCreated(v **types.DelegationSetAlreadyCreated, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentGeoLocationDetailsList(v *[]types.GeoLocationDetails, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.DelegationSetAlreadyCreated + var sv []types.GeoLocationDetails if *v == nil { - sv = &types.DelegationSetAlreadyCreated{} + sv = make([]types.GeoLocationDetails, 0) } else { sv = *v } + originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -11866,24 +14394,18 @@ func awsRestxml_deserializeDocumentDelegationSetAlreadyCreated(v **types.Delegat if done { break } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("GeoLocationDetails", t.Name.Local): + var col types.GeoLocationDetails + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsRestxml_deserializeDocumentGeoLocationDetails(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } + col = *destAddr + sv = append(sv, col) default: - // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -11896,13 +14418,37 @@ func awsRestxml_deserializeDocumentDelegationSetAlreadyCreated(v **types.Delegat return nil } -func awsRestxml_deserializeDocumentDelegationSetAlreadyReusable(v **types.DelegationSetAlreadyReusable, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentGeoLocationDetailsListUnwrapped(v *[]types.GeoLocationDetails, decoder smithyxml.NodeDecoder) error { + var sv []types.GeoLocationDetails + if *v == nil { + sv = make([]types.GeoLocationDetails, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.GeoLocationDetails + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsRestxml_deserializeDocumentGeoLocationDetails(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsRestxml_deserializeDocumentHealthCheck(v **types.HealthCheck, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.DelegationSetAlreadyReusable + var sv *types.HealthCheck if *v == nil { - sv = &types.DelegationSetAlreadyReusable{} + sv = &types.HealthCheck{} } else { sv = *v } @@ -11918,7 +14464,7 @@ func awsRestxml_deserializeDocumentDelegationSetAlreadyReusable(v **types.Delega originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("message", t.Name.Local): + case strings.EqualFold("CallerReference", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11928,46 +14474,39 @@ func awsRestxml_deserializeDocumentDelegationSetAlreadyReusable(v **types.Delega } { xtv := string(val) - sv.Message = ptr.String(xtv) + sv.CallerReference = ptr.String(xtv) } - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { + case strings.EqualFold("CloudWatchAlarmConfiguration", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentCloudWatchAlarmConfiguration(&sv.CloudWatchAlarmConfiguration, nodeDecoder); err != nil { return err } - } - decoder = originalDecoder - } - *v = sv - return nil -} + case strings.EqualFold("HealthCheckConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentHealthCheckConfig(&sv.HealthCheckConfig, nodeDecoder); err != nil { + return err + } -func awsRestxml_deserializeDocumentDelegationSetInUse(v **types.DelegationSetInUse, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DelegationSetInUse - if *v == nil { - sv = &types.DelegationSetInUse{} - } else { - sv = *v - } + case strings.EqualFold("HealthCheckVersion", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.HealthCheckVersion = ptr.Int64(i64) + } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("message", t.Name.Local): + case strings.EqualFold("Id", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -11977,7 +14516,13 @@ func awsRestxml_deserializeDocumentDelegationSetInUse(v **types.DelegationSetInU } { xtv := string(val) - sv.Message = ptr.String(xtv) + sv.Id = ptr.String(xtv) + } + + case strings.EqualFold("LinkedService", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentLinkedService(&sv.LinkedService, nodeDecoder); err != nil { + return err } default: @@ -11994,18 +14539,17 @@ func awsRestxml_deserializeDocumentDelegationSetInUse(v **types.DelegationSetInU return nil } -func awsRestxml_deserializeDocumentDelegationSetNameServers(v *[]string, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentHealthCheckAlreadyExists(v **types.HealthCheckAlreadyExists, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []string + var sv *types.HealthCheckAlreadyExists if *v == nil { - sv = make([]string, 0) + sv = &types.HealthCheckAlreadyExists{} } else { sv = *v } - originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -12014,11 +14558,10 @@ func awsRestxml_deserializeDocumentDelegationSetNameServers(v *[]string, decoder if done { break } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("NameServer", t.Name.Local): - var col string + case strings.EqualFold("message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12028,11 +14571,11 @@ func awsRestxml_deserializeDocumentDelegationSetNameServers(v *[]string, decoder } { xtv := string(val) - col = xtv + sv.Message = ptr.String(xtv) } - sv = append(sv, col) default: + // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -12045,42 +14588,13 @@ func awsRestxml_deserializeDocumentDelegationSetNameServers(v *[]string, decoder return nil } -func awsRestxml_deserializeDocumentDelegationSetNameServersUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsRestxml_deserializeDocumentDelegationSetNotAvailable(v **types.DelegationSetNotAvailable, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentHealthCheckConfig(v **types.HealthCheckConfig, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.DelegationSetNotAvailable + var sv *types.HealthCheckConfig if *v == nil { - sv = &types.DelegationSetNotAvailable{} + sv = &types.HealthCheckConfig{} } else { sv = *v } @@ -12096,7 +14610,51 @@ func awsRestxml_deserializeDocumentDelegationSetNotAvailable(v **types.Delegatio originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("message", t.Name.Local): + case strings.EqualFold("AlarmIdentifier", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentAlarmIdentifier(&sv.AlarmIdentifier, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("ChildHealthChecks", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentChildHealthCheckList(&sv.ChildHealthChecks, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Disabled", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Disabled to be of type *bool, got %T instead", val) + } + sv.Disabled = ptr.Bool(xtv) + } + + case strings.EqualFold("EnableSNI", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected EnableSNI to be of type *bool, got %T instead", val) + } + sv.EnableSNI = ptr.Bool(xtv) + } + + case strings.EqualFold("FailureThreshold", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12106,46 +14664,27 @@ func awsRestxml_deserializeDocumentDelegationSetNotAvailable(v **types.Delegatio } { xtv := string(val) - sv.Message = ptr.String(xtv) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.FailureThreshold = ptr.Int32(int32(i64)) } - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() + case strings.EqualFold("FullyQualifiedDomainName", t.Name.Local): + val, err := decoder.Value() if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.FullyQualifiedDomainName = ptr.String(xtv) + } - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsRestxml_deserializeDocumentDelegationSetNotReusable(v **types.DelegationSetNotReusable, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.DelegationSetNotReusable - if *v == nil { - sv = &types.DelegationSetNotReusable{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("message", t.Name.Local): + case strings.EqualFold("HealthThreshold", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12155,114 +14694,95 @@ func awsRestxml_deserializeDocumentDelegationSetNotReusable(v **types.Delegation } { xtv := string(val) - sv.Message = ptr.String(xtv) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.HealthThreshold = ptr.Int32(int32(i64)) } - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() + case strings.EqualFold("InsufficientDataHealthStatus", t.Name.Local): + val, err := decoder.Value() if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.InsufficientDataHealthStatus = types.InsufficientDataHealthStatus(xtv) + } - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsRestxml_deserializeDocumentDelegationSets(v *[]types.DelegationSet, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.DelegationSet - if *v == nil { - sv = make([]types.DelegationSet, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("DelegationSet", t.Name.Local): - var col types.DelegationSet - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsRestxml_deserializeDocumentDelegationSet(&destAddr, nodeDecoder); err != nil { + case strings.EqualFold("Inverted", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } - col = *destAddr - sv = append(sv, col) + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected Inverted to be of type *bool, got %T instead", val) + } + sv.Inverted = ptr.Bool(xtv) + } - default: - err = decoder.Decoder.Skip() + case strings.EqualFold("IPAddress", t.Name.Local): + val, err := decoder.Value() if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.IPAddress = ptr.String(xtv) + } - } - decoder = originalDecoder - } - *v = sv - return nil -} + case strings.EqualFold("MeasureLatency", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv, err := strconv.ParseBool(string(val)) + if err != nil { + return fmt.Errorf("expected MeasureLatency to be of type *bool, got %T instead", val) + } + sv.MeasureLatency = ptr.Bool(xtv) + } -func awsRestxml_deserializeDocumentDelegationSetsUnwrapped(v *[]types.DelegationSet, decoder smithyxml.NodeDecoder) error { - var sv []types.DelegationSet - if *v == nil { - sv = make([]types.DelegationSet, 0) - } else { - sv = *v - } + case strings.EqualFold("Port", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } - switch { - default: - var mv types.DelegationSet - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsRestxml_deserializeDocumentDelegationSet(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsRestxml_deserializeDocumentDimension(v **types.Dimension, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.Dimension - if *v == nil { - sv = &types.Dimension{} - } else { - sv = *v - } + case strings.EqualFold("Regions", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentHealthCheckRegionList(&sv.Regions, nodeDecoder); err != nil { + return err + } - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Name", t.Name.Local): + case strings.EqualFold("RequestInterval", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12272,10 +14792,14 @@ func awsRestxml_deserializeDocumentDimension(v **types.Dimension, decoder smithy } { xtv := string(val) - sv.Name = ptr.String(xtv) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.RequestInterval = ptr.Int32(int32(i64)) } - case strings.EqualFold("Value", t.Name.Local): + case strings.EqualFold("ResourcePath", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12285,55 +14809,37 @@ func awsRestxml_deserializeDocumentDimension(v **types.Dimension, decoder smithy } { xtv := string(val) - sv.Value = ptr.String(xtv) + sv.ResourcePath = ptr.String(xtv) } - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() + case strings.EqualFold("SearchString", t.Name.Local): + val, err := decoder.Value() if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.SearchString = ptr.String(xtv) + } - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsRestxml_deserializeDocumentDimensionList(v *[]types.Dimension, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv []types.Dimension - if *v == nil { - sv = make([]types.Dimension, 0) - } else { - sv = *v - } - - originalDecoder := decoder - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - switch { - case strings.EqualFold("Dimension", t.Name.Local): - var col types.Dimension - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsRestxml_deserializeDocumentDimension(&destAddr, nodeDecoder); err != nil { + case strings.EqualFold("Type", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } - col = *destAddr - sv = append(sv, col) + if val == nil { + break + } + { + xtv := string(val) + sv.Type = types.HealthCheckType(xtv) + } default: + // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -12346,42 +14852,17 @@ func awsRestxml_deserializeDocumentDimensionList(v *[]types.Dimension, decoder s return nil } -func awsRestxml_deserializeDocumentDimensionListUnwrapped(v *[]types.Dimension, decoder smithyxml.NodeDecoder) error { - var sv []types.Dimension - if *v == nil { - sv = make([]types.Dimension, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.Dimension - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsRestxml_deserializeDocumentDimension(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsRestxml_deserializeDocumentErrorMessages(v *[]string, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentHealthCheckInUse(v **types.HealthCheckInUse, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []string + var sv *types.HealthCheckInUse if *v == nil { - sv = make([]string, 0) + sv = &types.HealthCheckInUse{} } else { sv = *v } - originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -12390,11 +14871,10 @@ func awsRestxml_deserializeDocumentErrorMessages(v *[]string, decoder smithyxml. if done { break } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Message", t.Name.Local): - var col string + case strings.EqualFold("message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12404,11 +14884,11 @@ func awsRestxml_deserializeDocumentErrorMessages(v *[]string, decoder smithyxml. } { xtv := string(val) - col = xtv + sv.Message = ptr.String(xtv) } - sv = append(sv, col) default: + // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -12421,42 +14901,13 @@ func awsRestxml_deserializeDocumentErrorMessages(v *[]string, decoder smithyxml. return nil } -func awsRestxml_deserializeDocumentErrorMessagesUnwrapped(v *[]string, decoder smithyxml.NodeDecoder) error { - var sv []string - if *v == nil { - sv = make([]string, 0) - } else { - sv = *v - } - - switch { - default: - var mv string - t := decoder.StartEl - _ = t - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - mv = xtv - } - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsRestxml_deserializeDocumentGeoLocation(v **types.GeoLocation, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentHealthCheckObservation(v **types.HealthCheckObservation, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.GeoLocation + var sv *types.HealthCheckObservation if *v == nil { - sv = &types.GeoLocation{} + sv = &types.HealthCheckObservation{} } else { sv = *v } @@ -12472,7 +14923,7 @@ func awsRestxml_deserializeDocumentGeoLocation(v **types.GeoLocation, decoder sm originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("ContinentCode", t.Name.Local): + case strings.EqualFold("IPAddress", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12482,10 +14933,10 @@ func awsRestxml_deserializeDocumentGeoLocation(v **types.GeoLocation, decoder sm } { xtv := string(val) - sv.ContinentCode = ptr.String(xtv) + sv.IPAddress = ptr.String(xtv) } - case strings.EqualFold("CountryCode", t.Name.Local): + case strings.EqualFold("Region", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12495,21 +14946,14 @@ func awsRestxml_deserializeDocumentGeoLocation(v **types.GeoLocation, decoder sm } { xtv := string(val) - sv.CountryCode = ptr.String(xtv) + sv.Region = types.HealthCheckRegion(xtv) } - case strings.EqualFold("SubdivisionCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("StatusReport", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentStatusReport(&sv.StatusReport, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.SubdivisionCode = ptr.String(xtv) - } default: // Do nothing and ignore the unexpected tag element @@ -12525,17 +14969,18 @@ func awsRestxml_deserializeDocumentGeoLocation(v **types.GeoLocation, decoder sm return nil } -func awsRestxml_deserializeDocumentGeoLocationDetails(v **types.GeoLocationDetails, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentHealthCheckObservations(v *[]types.HealthCheckObservation, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.GeoLocationDetails + var sv []types.HealthCheckObservation if *v == nil { - sv = &types.GeoLocationDetails{} + sv = make([]types.HealthCheckObservation, 0) } else { sv = *v } + originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -12544,75 +14989,79 @@ func awsRestxml_deserializeDocumentGeoLocationDetails(v **types.GeoLocationDetai if done { break } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("ContinentCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("HealthCheckObservation", t.Name.Local): + var col types.HealthCheckObservation + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsRestxml_deserializeDocumentHealthCheckObservation(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.ContinentCode = ptr.String(xtv) - } + col = *destAddr + sv = append(sv, col) - case strings.EqualFold("ContinentName", t.Name.Local): - val, err := decoder.Value() + default: + err = decoder.Decoder.Skip() if err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.ContinentName = ptr.String(xtv) - } - case strings.EqualFold("CountryCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CountryCode = ptr.String(xtv) - } + } + decoder = originalDecoder + } + *v = sv + return nil +} - case strings.EqualFold("CountryName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.CountryName = ptr.String(xtv) - } +func awsRestxml_deserializeDocumentHealthCheckObservationsUnwrapped(v *[]types.HealthCheckObservation, decoder smithyxml.NodeDecoder) error { + var sv []types.HealthCheckObservation + if *v == nil { + sv = make([]types.HealthCheckObservation, 0) + } else { + sv = *v + } - case strings.EqualFold("SubdivisionCode", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.SubdivisionCode = ptr.String(xtv) - } + switch { + default: + var mv types.HealthCheckObservation + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsRestxml_deserializeDocumentHealthCheckObservation(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsRestxml_deserializeDocumentHealthCheckRegionList(v *[]types.HealthCheckRegion, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.HealthCheckRegion + if *v == nil { + sv = make([]types.HealthCheckRegion, 0) + } else { + sv = *v + } - case strings.EqualFold("SubdivisionName", t.Name.Local): + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + decoder = memberDecoder + switch { + case strings.EqualFold("Region", t.Name.Local): + var col types.HealthCheckRegion val, err := decoder.Value() if err != nil { return err @@ -12622,11 +15071,11 @@ func awsRestxml_deserializeDocumentGeoLocationDetails(v **types.GeoLocationDetai } { xtv := string(val) - sv.SubdivisionName = ptr.String(xtv) + col = types.HealthCheckRegion(xtv) } + sv = append(sv, col) default: - // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -12639,13 +15088,42 @@ func awsRestxml_deserializeDocumentGeoLocationDetails(v **types.GeoLocationDetai return nil } -func awsRestxml_deserializeDocumentGeoLocationDetailsList(v *[]types.GeoLocationDetails, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentHealthCheckRegionListUnwrapped(v *[]types.HealthCheckRegion, decoder smithyxml.NodeDecoder) error { + var sv []types.HealthCheckRegion + if *v == nil { + sv = make([]types.HealthCheckRegion, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.HealthCheckRegion + t := decoder.StartEl + _ = t + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + mv = types.HealthCheckRegion(xtv) + } + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsRestxml_deserializeDocumentHealthChecks(v *[]types.HealthCheck, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.GeoLocationDetails + var sv []types.HealthCheck if *v == nil { - sv = make([]types.GeoLocationDetails, 0) + sv = make([]types.HealthCheck, 0) } else { sv = *v } @@ -12660,11 +15138,11 @@ func awsRestxml_deserializeDocumentGeoLocationDetailsList(v *[]types.GeoLocation break } switch { - case strings.EqualFold("GeoLocationDetails", t.Name.Local): - var col types.GeoLocationDetails + case strings.EqualFold("HealthCheck", t.Name.Local): + var col types.HealthCheck nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &col - if err := awsRestxml_deserializeDocumentGeoLocationDetails(&destAddr, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentHealthCheck(&destAddr, nodeDecoder); err != nil { return err } col = *destAddr @@ -12683,22 +15161,22 @@ func awsRestxml_deserializeDocumentGeoLocationDetailsList(v *[]types.GeoLocation return nil } -func awsRestxml_deserializeDocumentGeoLocationDetailsListUnwrapped(v *[]types.GeoLocationDetails, decoder smithyxml.NodeDecoder) error { - var sv []types.GeoLocationDetails +func awsRestxml_deserializeDocumentHealthChecksUnwrapped(v *[]types.HealthCheck, decoder smithyxml.NodeDecoder) error { + var sv []types.HealthCheck if *v == nil { - sv = make([]types.GeoLocationDetails, 0) + sv = make([]types.HealthCheck, 0) } else { sv = *v } switch { default: - var mv types.GeoLocationDetails + var mv types.HealthCheck t := decoder.StartEl _ = t nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &mv - if err := awsRestxml_deserializeDocumentGeoLocationDetails(&destAddr, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentHealthCheck(&destAddr, nodeDecoder); err != nil { return err } mv = *destAddr @@ -12707,13 +15185,13 @@ func awsRestxml_deserializeDocumentGeoLocationDetailsListUnwrapped(v *[]types.Ge *v = sv return nil } -func awsRestxml_deserializeDocumentHealthCheck(v **types.HealthCheck, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentHealthCheckVersionMismatch(v **types.HealthCheckVersionMismatch, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.HealthCheck + var sv *types.HealthCheckVersionMismatch if *v == nil { - sv = &types.HealthCheck{} + sv = &types.HealthCheckVersionMismatch{} } else { sv = *v } @@ -12729,7 +15207,7 @@ func awsRestxml_deserializeDocumentHealthCheck(v **types.HealthCheck, decoder sm originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("CallerReference", t.Name.Local): + case strings.EqualFold("message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12739,22 +15217,46 @@ func awsRestxml_deserializeDocumentHealthCheck(v **types.HealthCheck, decoder sm } { xtv := string(val) - sv.CallerReference = ptr.String(xtv) + sv.Message = ptr.String(xtv) } - case strings.EqualFold("CloudWatchAlarmConfiguration", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentCloudWatchAlarmConfiguration(&sv.CloudWatchAlarmConfiguration, nodeDecoder); err != nil { + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { return err } - case strings.EqualFold("HealthCheckConfig", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentHealthCheckConfig(&sv.HealthCheckConfig, nodeDecoder); err != nil { - return err - } + } + decoder = originalDecoder + } + *v = sv + return nil +} - case strings.EqualFold("HealthCheckVersion", t.Name.Local): +func awsRestxml_deserializeDocumentHostedZone(v **types.HostedZone, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.HostedZone + if *v == nil { + sv = &types.HostedZone{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CallerReference", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12764,11 +15266,13 @@ func awsRestxml_deserializeDocumentHealthCheck(v **types.HealthCheck, decoder sm } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.HealthCheckVersion = ptr.Int64(i64) + sv.CallerReference = ptr.String(xtv) + } + + case strings.EqualFold("Config", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentHostedZoneConfig(&sv.Config, nodeDecoder); err != nil { + return err } case strings.EqualFold("Id", t.Name.Local): @@ -12790,6 +15294,36 @@ func awsRestxml_deserializeDocumentHealthCheck(v **types.HealthCheck, decoder sm return err } + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + case strings.EqualFold("ResourceRecordSetCount", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.ResourceRecordSetCount = ptr.Int64(i64) + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -12804,13 +15338,13 @@ func awsRestxml_deserializeDocumentHealthCheck(v **types.HealthCheck, decoder sm return nil } -func awsRestxml_deserializeDocumentHealthCheckAlreadyExists(v **types.HealthCheckAlreadyExists, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentHostedZoneAlreadyExists(v **types.HostedZoneAlreadyExists, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.HealthCheckAlreadyExists + var sv *types.HostedZoneAlreadyExists if *v == nil { - sv = &types.HealthCheckAlreadyExists{} + sv = &types.HostedZoneAlreadyExists{} } else { sv = *v } @@ -12853,13 +15387,13 @@ func awsRestxml_deserializeDocumentHealthCheckAlreadyExists(v **types.HealthChec return nil } -func awsRestxml_deserializeDocumentHealthCheckConfig(v **types.HealthCheckConfig, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentHostedZoneConfig(v **types.HostedZoneConfig, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.HealthCheckConfig + var sv *types.HostedZoneConfig if *v == nil { - sv = &types.HealthCheckConfig{} + sv = &types.HostedZoneConfig{} } else { sv = *v } @@ -12871,102 +15405,11 @@ func awsRestxml_deserializeDocumentHealthCheckConfig(v **types.HealthCheckConfig } if done { break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("AlarmIdentifier", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentAlarmIdentifier(&sv.AlarmIdentifier, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("ChildHealthChecks", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentChildHealthCheckList(&sv.ChildHealthChecks, nodeDecoder); err != nil { - return err - } - - case strings.EqualFold("Disabled", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected Disabled to be of type *bool, got %T instead", val) - } - sv.Disabled = ptr.Bool(xtv) - } - - case strings.EqualFold("EnableSNI", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected EnableSNI to be of type *bool, got %T instead", val) - } - sv.EnableSNI = ptr.Bool(xtv) - } - - case strings.EqualFold("FailureThreshold", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.FailureThreshold = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("FullyQualifiedDomainName", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.FullyQualifiedDomainName = ptr.String(xtv) - } - - case strings.EqualFold("HealthThreshold", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.HealthThreshold = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("InsufficientDataHealthStatus", t.Name.Local): + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Comment", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12976,10 +15419,10 @@ func awsRestxml_deserializeDocumentHealthCheckConfig(v **types.HealthCheckConfig } { xtv := string(val) - sv.InsufficientDataHealthStatus = types.InsufficientDataHealthStatus(xtv) + sv.Comment = ptr.String(xtv) } - case strings.EqualFold("Inverted", t.Name.Local): + case strings.EqualFold("PrivateZone", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -12990,25 +15433,48 @@ func awsRestxml_deserializeDocumentHealthCheckConfig(v **types.HealthCheckConfig { xtv, err := strconv.ParseBool(string(val)) if err != nil { - return fmt.Errorf("expected Inverted to be of type *bool, got %T instead", val) + return fmt.Errorf("expected IsPrivateZone to be of type *bool, got %T instead", val) } - sv.Inverted = ptr.Bool(xtv) + sv.PrivateZone = xtv } - case strings.EqualFold("IPAddress", t.Name.Local): - val, err := decoder.Value() + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() if err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.IPAddress = ptr.String(xtv) - } - case strings.EqualFold("MeasureLatency", t.Name.Local): + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentHostedZoneLimit(v **types.HostedZoneLimit, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.HostedZoneLimit + if *v == nil { + sv = &types.HostedZoneLimit{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Type", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -13017,14 +15483,11 @@ func awsRestxml_deserializeDocumentHealthCheckConfig(v **types.HealthCheckConfig break } { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected MeasureLatency to be of type *bool, got %T instead", val) - } - sv.MeasureLatency = ptr.Bool(xtv) + xtv := string(val) + sv.Type = types.HostedZoneLimitType(xtv) } - case strings.EqualFold("Port", t.Name.Local): + case strings.EqualFold("Value", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -13038,33 +15501,46 @@ func awsRestxml_deserializeDocumentHealthCheckConfig(v **types.HealthCheckConfig if err != nil { return err } - sv.Port = ptr.Int32(int32(i64)) - } - - case strings.EqualFold("Regions", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentHealthCheckRegionList(&sv.Regions, nodeDecoder); err != nil { - return err + sv.Value = i64 } - case strings.EqualFold("RequestInterval", t.Name.Local): - val, err := decoder.Value() + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() if err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.RequestInterval = ptr.Int32(int32(i64)) - } - case strings.EqualFold("ResourcePath", t.Name.Local): + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentHostedZoneNotEmpty(v **types.HostedZoneNotEmpty, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.HostedZoneNotEmpty + if *v == nil { + sv = &types.HostedZoneNotEmpty{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -13074,23 +15550,46 @@ func awsRestxml_deserializeDocumentHealthCheckConfig(v **types.HealthCheckConfig } { xtv := string(val) - sv.ResourcePath = ptr.String(xtv) + sv.Message = ptr.String(xtv) } - case strings.EqualFold("SearchString", t.Name.Local): - val, err := decoder.Value() + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() if err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.SearchString = ptr.String(xtv) - } - case strings.EqualFold("Type", t.Name.Local): + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentHostedZoneNotFound(v **types.HostedZoneNotFound, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.HostedZoneNotFound + if *v == nil { + sv = &types.HostedZoneNotFound{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -13100,7 +15599,7 @@ func awsRestxml_deserializeDocumentHealthCheckConfig(v **types.HealthCheckConfig } { xtv := string(val) - sv.Type = types.HealthCheckType(xtv) + sv.Message = ptr.String(xtv) } default: @@ -13117,13 +15616,13 @@ func awsRestxml_deserializeDocumentHealthCheckConfig(v **types.HealthCheckConfig return nil } -func awsRestxml_deserializeDocumentHealthCheckInUse(v **types.HealthCheckInUse, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentHostedZoneNotPrivate(v **types.HostedZoneNotPrivate, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.HealthCheckInUse + var sv *types.HostedZoneNotPrivate if *v == nil { - sv = &types.HealthCheckInUse{} + sv = &types.HostedZoneNotPrivate{} } else { sv = *v } @@ -13166,13 +15665,13 @@ func awsRestxml_deserializeDocumentHealthCheckInUse(v **types.HealthCheckInUse, return nil } -func awsRestxml_deserializeDocumentHealthCheckObservation(v **types.HealthCheckObservation, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentHostedZoneOwner(v **types.HostedZoneOwner, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.HealthCheckObservation + var sv *types.HostedZoneOwner if *v == nil { - sv = &types.HealthCheckObservation{} + sv = &types.HostedZoneOwner{} } else { sv = *v } @@ -13188,7 +15687,7 @@ func awsRestxml_deserializeDocumentHealthCheckObservation(v **types.HealthCheckO originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("IPAddress", t.Name.Local): + case strings.EqualFold("OwningAccount", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -13198,10 +15697,10 @@ func awsRestxml_deserializeDocumentHealthCheckObservation(v **types.HealthCheckO } { xtv := string(val) - sv.IPAddress = ptr.String(xtv) + sv.OwningAccount = ptr.String(xtv) } - case strings.EqualFold("Region", t.Name.Local): + case strings.EqualFold("OwningService", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -13211,13 +15710,7 @@ func awsRestxml_deserializeDocumentHealthCheckObservation(v **types.HealthCheckO } { xtv := string(val) - sv.Region = types.HealthCheckRegion(xtv) - } - - case strings.EqualFold("StatusReport", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentStatusReport(&sv.StatusReport, nodeDecoder); err != nil { - return err + sv.OwningService = ptr.String(xtv) } default: @@ -13234,18 +15727,17 @@ func awsRestxml_deserializeDocumentHealthCheckObservation(v **types.HealthCheckO return nil } -func awsRestxml_deserializeDocumentHealthCheckObservations(v *[]types.HealthCheckObservation, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentHostedZonePartiallyDelegated(v **types.HostedZonePartiallyDelegated, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.HealthCheckObservation + var sv *types.HostedZonePartiallyDelegated if *v == nil { - sv = make([]types.HealthCheckObservation, 0) + sv = &types.HostedZonePartiallyDelegated{} } else { sv = *v } - originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -13254,18 +15746,24 @@ func awsRestxml_deserializeDocumentHealthCheckObservations(v *[]types.HealthChec if done { break } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("HealthCheckObservation", t.Name.Local): - var col types.HealthCheckObservation - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsRestxml_deserializeDocumentHealthCheckObservation(&destAddr, nodeDecoder); err != nil { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } - col = *destAddr - sv = append(sv, col) + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } default: + // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -13278,37 +15776,13 @@ func awsRestxml_deserializeDocumentHealthCheckObservations(v *[]types.HealthChec return nil } -func awsRestxml_deserializeDocumentHealthCheckObservationsUnwrapped(v *[]types.HealthCheckObservation, decoder smithyxml.NodeDecoder) error { - var sv []types.HealthCheckObservation - if *v == nil { - sv = make([]types.HealthCheckObservation, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.HealthCheckObservation - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsRestxml_deserializeDocumentHealthCheckObservation(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsRestxml_deserializeDocumentHealthCheckRegionList(v *[]types.HealthCheckRegion, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentHostedZones(v *[]types.HostedZone, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.HealthCheckRegion + var sv []types.HostedZone if *v == nil { - sv = make([]types.HealthCheckRegion, 0) + sv = make([]types.HostedZone, 0) } else { sv = *v } @@ -13322,22 +15796,15 @@ func awsRestxml_deserializeDocumentHealthCheckRegionList(v *[]types.HealthCheckR if done { break } - memberDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - decoder = memberDecoder switch { - case strings.EqualFold("Region", t.Name.Local): - var col types.HealthCheckRegion - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("HostedZone", t.Name.Local): + var col types.HostedZone + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsRestxml_deserializeDocumentHostedZone(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - col = types.HealthCheckRegion(xtv) - } + col = *destAddr sv = append(sv, col) default: @@ -13353,42 +15820,37 @@ func awsRestxml_deserializeDocumentHealthCheckRegionList(v *[]types.HealthCheckR return nil } -func awsRestxml_deserializeDocumentHealthCheckRegionListUnwrapped(v *[]types.HealthCheckRegion, decoder smithyxml.NodeDecoder) error { - var sv []types.HealthCheckRegion +func awsRestxml_deserializeDocumentHostedZonesUnwrapped(v *[]types.HostedZone, decoder smithyxml.NodeDecoder) error { + var sv []types.HostedZone if *v == nil { - sv = make([]types.HealthCheckRegion, 0) + sv = make([]types.HostedZone, 0) } else { sv = *v } switch { default: - var mv types.HealthCheckRegion + var mv types.HostedZone t := decoder.StartEl _ = t - val, err := decoder.Value() - if err != nil { + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsRestxml_deserializeDocumentHostedZone(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - mv = types.HealthCheckRegion(xtv) - } + mv = *destAddr sv = append(sv, mv) } *v = sv return nil } -func awsRestxml_deserializeDocumentHealthChecks(v *[]types.HealthCheck, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentHostedZoneSummaries(v *[]types.HostedZoneSummary, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.HealthCheck + var sv []types.HostedZoneSummary if *v == nil { - sv = make([]types.HealthCheck, 0) + sv = make([]types.HostedZoneSummary, 0) } else { sv = *v } @@ -13403,11 +15865,11 @@ func awsRestxml_deserializeDocumentHealthChecks(v *[]types.HealthCheck, decoder break } switch { - case strings.EqualFold("HealthCheck", t.Name.Local): - var col types.HealthCheck + case strings.EqualFold("HostedZoneSummary", t.Name.Local): + var col types.HostedZoneSummary nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &col - if err := awsRestxml_deserializeDocumentHealthCheck(&destAddr, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentHostedZoneSummary(&destAddr, nodeDecoder); err != nil { return err } col = *destAddr @@ -13426,22 +15888,22 @@ func awsRestxml_deserializeDocumentHealthChecks(v *[]types.HealthCheck, decoder return nil } -func awsRestxml_deserializeDocumentHealthChecksUnwrapped(v *[]types.HealthCheck, decoder smithyxml.NodeDecoder) error { - var sv []types.HealthCheck +func awsRestxml_deserializeDocumentHostedZoneSummariesUnwrapped(v *[]types.HostedZoneSummary, decoder smithyxml.NodeDecoder) error { + var sv []types.HostedZoneSummary if *v == nil { - sv = make([]types.HealthCheck, 0) + sv = make([]types.HostedZoneSummary, 0) } else { sv = *v } switch { default: - var mv types.HealthCheck + var mv types.HostedZoneSummary t := decoder.StartEl _ = t nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) destAddr := &mv - if err := awsRestxml_deserializeDocumentHealthCheck(&destAddr, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentHostedZoneSummary(&destAddr, nodeDecoder); err != nil { return err } mv = *destAddr @@ -13450,13 +15912,13 @@ func awsRestxml_deserializeDocumentHealthChecksUnwrapped(v *[]types.HealthCheck, *v = sv return nil } -func awsRestxml_deserializeDocumentHealthCheckVersionMismatch(v **types.HealthCheckVersionMismatch, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentHostedZoneSummary(v **types.HostedZoneSummary, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.HealthCheckVersionMismatch + var sv *types.HostedZoneSummary if *v == nil { - sv = &types.HealthCheckVersionMismatch{} + sv = &types.HostedZoneSummary{} } else { sv = *v } @@ -13472,7 +15934,7 @@ func awsRestxml_deserializeDocumentHealthCheckVersionMismatch(v **types.HealthCh originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("message", t.Name.Local): + case strings.EqualFold("HostedZoneId", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -13482,7 +15944,26 @@ func awsRestxml_deserializeDocumentHealthCheckVersionMismatch(v **types.HealthCh } { xtv := string(val) - sv.Message = ptr.String(xtv) + sv.HostedZoneId = ptr.String(xtv) + } + + case strings.EqualFold("Name", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Name = ptr.String(xtv) + } + + case strings.EqualFold("Owner", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentHostedZoneOwner(&sv.Owner, nodeDecoder); err != nil { + return err } default: @@ -13499,13 +15980,13 @@ func awsRestxml_deserializeDocumentHealthCheckVersionMismatch(v **types.HealthCh return nil } -func awsRestxml_deserializeDocumentHostedZone(v **types.HostedZone, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentIncompatibleVersion(v **types.IncompatibleVersion, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.HostedZone + var sv *types.IncompatibleVersion if *v == nil { - sv = &types.HostedZone{} + sv = &types.IncompatibleVersion{} } else { sv = *v } @@ -13521,7 +16002,7 @@ func awsRestxml_deserializeDocumentHostedZone(v **types.HostedZone, decoder smit originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("CallerReference", t.Name.Local): + case strings.EqualFold("message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -13531,48 +16012,46 @@ func awsRestxml_deserializeDocumentHostedZone(v **types.HostedZone, decoder smit } { xtv := string(val) - sv.CallerReference = ptr.String(xtv) - } - - case strings.EqualFold("Config", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentHostedZoneConfig(&sv.Config, nodeDecoder); err != nil { - return err + sv.Message = ptr.String(xtv) } - case strings.EqualFold("Id", t.Name.Local): - val, err := decoder.Value() + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() if err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.Id = ptr.String(xtv) - } - case strings.EqualFold("LinkedService", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentLinkedService(&sv.LinkedService, nodeDecoder); err != nil { - return err - } + } + decoder = originalDecoder + } + *v = sv + return nil +} - case strings.EqualFold("Name", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Name = ptr.String(xtv) - } +func awsRestxml_deserializeDocumentInsufficientCloudWatchLogsResourcePolicy(v **types.InsufficientCloudWatchLogsResourcePolicy, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InsufficientCloudWatchLogsResourcePolicy + if *v == nil { + sv = &types.InsufficientCloudWatchLogsResourcePolicy{} + } else { + sv = *v + } - case strings.EqualFold("ResourceRecordSetCount", t.Name.Local): + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -13582,11 +16061,7 @@ func awsRestxml_deserializeDocumentHostedZone(v **types.HostedZone, decoder smit } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.ResourceRecordSetCount = ptr.Int64(i64) + sv.Message = ptr.String(xtv) } default: @@ -13603,13 +16078,13 @@ func awsRestxml_deserializeDocumentHostedZone(v **types.HostedZone, decoder smit return nil } -func awsRestxml_deserializeDocumentHostedZoneAlreadyExists(v **types.HostedZoneAlreadyExists, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentInvalidArgument(v **types.InvalidArgument, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.HostedZoneAlreadyExists + var sv *types.InvalidArgument if *v == nil { - sv = &types.HostedZoneAlreadyExists{} + sv = &types.InvalidArgument{} } else { sv = *v } @@ -13652,13 +16127,13 @@ func awsRestxml_deserializeDocumentHostedZoneAlreadyExists(v **types.HostedZoneA return nil } -func awsRestxml_deserializeDocumentHostedZoneConfig(v **types.HostedZoneConfig, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentInvalidChangeBatch(v **types.InvalidChangeBatch, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.HostedZoneConfig + var sv *types.InvalidChangeBatch if *v == nil { - sv = &types.HostedZoneConfig{} + sv = &types.InvalidChangeBatch{} } else { sv = *v } @@ -13674,7 +16149,7 @@ func awsRestxml_deserializeDocumentHostedZoneConfig(v **types.HostedZoneConfig, originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Comment", t.Name.Local): + case strings.EqualFold("message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -13684,24 +16159,14 @@ func awsRestxml_deserializeDocumentHostedZoneConfig(v **types.HostedZoneConfig, } { xtv := string(val) - sv.Comment = ptr.String(xtv) + sv.Message = ptr.String(xtv) } - case strings.EqualFold("PrivateZone", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("messages", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentErrorMessages(&sv.Messages, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv, err := strconv.ParseBool(string(val)) - if err != nil { - return fmt.Errorf("expected IsPrivateZone to be of type *bool, got %T instead", val) - } - sv.PrivateZone = xtv - } default: // Do nothing and ignore the unexpected tag element @@ -13717,13 +16182,13 @@ func awsRestxml_deserializeDocumentHostedZoneConfig(v **types.HostedZoneConfig, return nil } -func awsRestxml_deserializeDocumentHostedZoneLimit(v **types.HostedZoneLimit, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentInvalidDomainName(v **types.InvalidDomainName, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.HostedZoneLimit + var sv *types.InvalidDomainName if *v == nil { - sv = &types.HostedZoneLimit{} + sv = &types.InvalidDomainName{} } else { sv = *v } @@ -13739,20 +16204,7 @@ func awsRestxml_deserializeDocumentHostedZoneLimit(v **types.HostedZoneLimit, de originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Type", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.Type = types.HostedZoneLimitType(xtv) - } - - case strings.EqualFold("Value", t.Name.Local): + case strings.EqualFold("message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -13762,11 +16214,7 @@ func awsRestxml_deserializeDocumentHostedZoneLimit(v **types.HostedZoneLimit, de } { xtv := string(val) - i64, err := strconv.ParseInt(xtv, 10, 64) - if err != nil { - return err - } - sv.Value = i64 + sv.Message = ptr.String(xtv) } default: @@ -13783,13 +16231,13 @@ func awsRestxml_deserializeDocumentHostedZoneLimit(v **types.HostedZoneLimit, de return nil } -func awsRestxml_deserializeDocumentHostedZoneNotEmpty(v **types.HostedZoneNotEmpty, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentInvalidInput(v **types.InvalidInput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.HostedZoneNotEmpty + var sv *types.InvalidInput if *v == nil { - sv = &types.HostedZoneNotEmpty{} + sv = &types.InvalidInput{} } else { sv = *v } @@ -13832,13 +16280,13 @@ func awsRestxml_deserializeDocumentHostedZoneNotEmpty(v **types.HostedZoneNotEmp return nil } -func awsRestxml_deserializeDocumentHostedZoneNotFound(v **types.HostedZoneNotFound, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentInvalidKeySigningKeyName(v **types.InvalidKeySigningKeyName, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.HostedZoneNotFound + var sv *types.InvalidKeySigningKeyName if *v == nil { - sv = &types.HostedZoneNotFound{} + sv = &types.InvalidKeySigningKeyName{} } else { sv = *v } @@ -13881,13 +16329,13 @@ func awsRestxml_deserializeDocumentHostedZoneNotFound(v **types.HostedZoneNotFou return nil } -func awsRestxml_deserializeDocumentHostedZoneNotPrivate(v **types.HostedZoneNotPrivate, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentInvalidKeySigningKeyStatus(v **types.InvalidKeySigningKeyStatus, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.HostedZoneNotPrivate + var sv *types.InvalidKeySigningKeyStatus if *v == nil { - sv = &types.HostedZoneNotPrivate{} + sv = &types.InvalidKeySigningKeyStatus{} } else { sv = *v } @@ -13930,13 +16378,13 @@ func awsRestxml_deserializeDocumentHostedZoneNotPrivate(v **types.HostedZoneNotP return nil } -func awsRestxml_deserializeDocumentHostedZoneOwner(v **types.HostedZoneOwner, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentInvalidKMSArn(v **types.InvalidKMSArn, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.HostedZoneOwner + var sv *types.InvalidKMSArn if *v == nil { - sv = &types.HostedZoneOwner{} + sv = &types.InvalidKMSArn{} } else { sv = *v } @@ -13952,20 +16400,7 @@ func awsRestxml_deserializeDocumentHostedZoneOwner(v **types.HostedZoneOwner, de originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("OwningAccount", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.OwningAccount = ptr.String(xtv) - } - - case strings.EqualFold("OwningService", t.Name.Local): + case strings.EqualFold("message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -13975,7 +16410,7 @@ func awsRestxml_deserializeDocumentHostedZoneOwner(v **types.HostedZoneOwner, de } { xtv := string(val) - sv.OwningService = ptr.String(xtv) + sv.Message = ptr.String(xtv) } default: @@ -13992,18 +16427,17 @@ func awsRestxml_deserializeDocumentHostedZoneOwner(v **types.HostedZoneOwner, de return nil } -func awsRestxml_deserializeDocumentHostedZones(v *[]types.HostedZone, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentInvalidPaginationToken(v **types.InvalidPaginationToken, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.HostedZone + var sv *types.InvalidPaginationToken if *v == nil { - sv = make([]types.HostedZone, 0) + sv = &types.InvalidPaginationToken{} } else { sv = *v } - originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -14012,18 +16446,24 @@ func awsRestxml_deserializeDocumentHostedZones(v *[]types.HostedZone, decoder sm if done { break } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("HostedZone", t.Name.Local): - var col types.HostedZone - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsRestxml_deserializeDocumentHostedZone(&destAddr, nodeDecoder); err != nil { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } - col = *destAddr - sv = append(sv, col) + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } default: + // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -14036,42 +16476,17 @@ func awsRestxml_deserializeDocumentHostedZones(v *[]types.HostedZone, decoder sm return nil } -func awsRestxml_deserializeDocumentHostedZonesUnwrapped(v *[]types.HostedZone, decoder smithyxml.NodeDecoder) error { - var sv []types.HostedZone - if *v == nil { - sv = make([]types.HostedZone, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.HostedZone - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsRestxml_deserializeDocumentHostedZone(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsRestxml_deserializeDocumentHostedZoneSummaries(v *[]types.HostedZoneSummary, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentInvalidSigningStatus(v **types.InvalidSigningStatus, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv []types.HostedZoneSummary + var sv *types.InvalidSigningStatus if *v == nil { - sv = make([]types.HostedZoneSummary, 0) + sv = &types.InvalidSigningStatus{} } else { sv = *v } - originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -14080,18 +16495,24 @@ func awsRestxml_deserializeDocumentHostedZoneSummaries(v *[]types.HostedZoneSumm if done { break } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("HostedZoneSummary", t.Name.Local): - var col types.HostedZoneSummary - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &col - if err := awsRestxml_deserializeDocumentHostedZoneSummary(&destAddr, nodeDecoder); err != nil { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } - col = *destAddr - sv = append(sv, col) + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } default: + // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -14104,37 +16525,13 @@ func awsRestxml_deserializeDocumentHostedZoneSummaries(v *[]types.HostedZoneSumm return nil } -func awsRestxml_deserializeDocumentHostedZoneSummariesUnwrapped(v *[]types.HostedZoneSummary, decoder smithyxml.NodeDecoder) error { - var sv []types.HostedZoneSummary - if *v == nil { - sv = make([]types.HostedZoneSummary, 0) - } else { - sv = *v - } - - switch { - default: - var mv types.HostedZoneSummary - t := decoder.StartEl - _ = t - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - destAddr := &mv - if err := awsRestxml_deserializeDocumentHostedZoneSummary(&destAddr, nodeDecoder); err != nil { - return err - } - mv = *destAddr - sv = append(sv, mv) - } - *v = sv - return nil -} -func awsRestxml_deserializeDocumentHostedZoneSummary(v **types.HostedZoneSummary, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentInvalidTrafficPolicyDocument(v **types.InvalidTrafficPolicyDocument, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.HostedZoneSummary + var sv *types.InvalidTrafficPolicyDocument if *v == nil { - sv = &types.HostedZoneSummary{} + sv = &types.InvalidTrafficPolicyDocument{} } else { sv = *v } @@ -14150,20 +16547,7 @@ func awsRestxml_deserializeDocumentHostedZoneSummary(v **types.HostedZoneSummary originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("HostedZoneId", t.Name.Local): - val, err := decoder.Value() - if err != nil { - return err - } - if val == nil { - break - } - { - xtv := string(val) - sv.HostedZoneId = ptr.String(xtv) - } - - case strings.EqualFold("Name", t.Name.Local): + case strings.EqualFold("message", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -14173,13 +16557,7 @@ func awsRestxml_deserializeDocumentHostedZoneSummary(v **types.HostedZoneSummary } { xtv := string(val) - sv.Name = ptr.String(xtv) - } - - case strings.EqualFold("Owner", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentHostedZoneOwner(&sv.Owner, nodeDecoder); err != nil { - return err + sv.Message = ptr.String(xtv) } default: @@ -14196,13 +16574,13 @@ func awsRestxml_deserializeDocumentHostedZoneSummary(v **types.HostedZoneSummary return nil } -func awsRestxml_deserializeDocumentIncompatibleVersion(v **types.IncompatibleVersion, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentInvalidVPCId(v **types.InvalidVPCId, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.IncompatibleVersion + var sv *types.InvalidVPCId if *v == nil { - sv = &types.IncompatibleVersion{} + sv = &types.InvalidVPCId{} } else { sv = *v } @@ -14245,13 +16623,13 @@ func awsRestxml_deserializeDocumentIncompatibleVersion(v **types.IncompatibleVer return nil } -func awsRestxml_deserializeDocumentInsufficientCloudWatchLogsResourcePolicy(v **types.InsufficientCloudWatchLogsResourcePolicy, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentKeySigningKey(v **types.KeySigningKey, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.InsufficientCloudWatchLogsResourcePolicy + var sv *types.KeySigningKey if *v == nil { - sv = &types.InsufficientCloudWatchLogsResourcePolicy{} + sv = &types.KeySigningKey{} } else { sv = *v } @@ -14267,7 +16645,157 @@ func awsRestxml_deserializeDocumentInsufficientCloudWatchLogsResourcePolicy(v ** originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("message", t.Name.Local): + case strings.EqualFold("CreatedDate", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CreatedDate = ptr.Time(t) + } + + case strings.EqualFold("DigestAlgorithmMnemonic", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DigestAlgorithmMnemonic = ptr.String(xtv) + } + + case strings.EqualFold("DigestAlgorithmType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.DigestAlgorithmType = int32(i64) + } + + case strings.EqualFold("DigestValue", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DigestValue = ptr.String(xtv) + } + + case strings.EqualFold("DNSKEYRecord", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DNSKEYRecord = ptr.String(xtv) + } + + case strings.EqualFold("DSRecord", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DSRecord = ptr.String(xtv) + } + + case strings.EqualFold("Flag", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Flag = int32(i64) + } + + case strings.EqualFold("KeyTag", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.KeyTag = int32(i64) + } + + case strings.EqualFold("KmsArn", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.KmsArn = ptr.String(xtv) + } + + case strings.EqualFold("LastModifiedDate", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.LastModifiedDate = ptr.Time(t) + } + + case strings.EqualFold("Name", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -14277,46 +16805,23 @@ func awsRestxml_deserializeDocumentInsufficientCloudWatchLogsResourcePolicy(v ** } { xtv := string(val) - sv.Message = ptr.String(xtv) + sv.Name = ptr.String(xtv) } - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() + case strings.EqualFold("PublicKey", t.Name.Local): + val, err := decoder.Value() if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.PublicKey = ptr.String(xtv) + } - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsRestxml_deserializeDocumentInvalidArgument(v **types.InvalidArgument, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InvalidArgument - if *v == nil { - sv = &types.InvalidArgument{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("message", t.Name.Local): + case strings.EqualFold("SigningAlgorithmMnemonic", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -14326,46 +16831,27 @@ func awsRestxml_deserializeDocumentInvalidArgument(v **types.InvalidArgument, de } { xtv := string(val) - sv.Message = ptr.String(xtv) + sv.SigningAlgorithmMnemonic = ptr.String(xtv) } - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() + case strings.EqualFold("SigningAlgorithmType", t.Name.Local): + val, err := decoder.Value() if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.SigningAlgorithmType = int32(i64) + } - } - decoder = originalDecoder - } - *v = sv - return nil -} - -func awsRestxml_deserializeDocumentInvalidChangeBatch(v **types.InvalidChangeBatch, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *types.InvalidChangeBatch - if *v == nil { - sv = &types.InvalidChangeBatch{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("message", t.Name.Local): + case strings.EqualFold("Status", t.Name.Local): val, err := decoder.Value() if err != nil { return err @@ -14375,14 +16861,21 @@ func awsRestxml_deserializeDocumentInvalidChangeBatch(v **types.InvalidChangeBat } { xtv := string(val) - sv.Message = ptr.String(xtv) + sv.Status = ptr.String(xtv) } - case strings.EqualFold("messages", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentErrorMessages(&sv.Messages, nodeDecoder); err != nil { + case strings.EqualFold("StatusMessage", t.Name.Local): + val, err := decoder.Value() + if err != nil { return err } + if val == nil { + break + } + { + xtv := string(val) + sv.StatusMessage = ptr.String(xtv) + } default: // Do nothing and ignore the unexpected tag element @@ -14398,13 +16891,13 @@ func awsRestxml_deserializeDocumentInvalidChangeBatch(v **types.InvalidChangeBat return nil } -func awsRestxml_deserializeDocumentInvalidDomainName(v **types.InvalidDomainName, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentKeySigningKeyAlreadyExists(v **types.KeySigningKeyAlreadyExists, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.InvalidDomainName + var sv *types.KeySigningKeyAlreadyExists if *v == nil { - sv = &types.InvalidDomainName{} + sv = &types.KeySigningKeyAlreadyExists{} } else { sv = *v } @@ -14447,13 +16940,13 @@ func awsRestxml_deserializeDocumentInvalidDomainName(v **types.InvalidDomainName return nil } -func awsRestxml_deserializeDocumentInvalidInput(v **types.InvalidInput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentKeySigningKeyInParentDSRecord(v **types.KeySigningKeyInParentDSRecord, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.InvalidInput + var sv *types.KeySigningKeyInParentDSRecord if *v == nil { - sv = &types.InvalidInput{} + sv = &types.KeySigningKeyInParentDSRecord{} } else { sv = *v } @@ -14496,13 +16989,13 @@ func awsRestxml_deserializeDocumentInvalidInput(v **types.InvalidInput, decoder return nil } -func awsRestxml_deserializeDocumentInvalidPaginationToken(v **types.InvalidPaginationToken, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentKeySigningKeyInUse(v **types.KeySigningKeyInUse, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.InvalidPaginationToken + var sv *types.KeySigningKeyInUse if *v == nil { - sv = &types.InvalidPaginationToken{} + sv = &types.KeySigningKeyInUse{} } else { sv = *v } @@ -14545,17 +17038,18 @@ func awsRestxml_deserializeDocumentInvalidPaginationToken(v **types.InvalidPagin return nil } -func awsRestxml_deserializeDocumentInvalidTrafficPolicyDocument(v **types.InvalidTrafficPolicyDocument, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentKeySigningKeys(v *[]types.KeySigningKey, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.InvalidTrafficPolicyDocument + var sv []types.KeySigningKey if *v == nil { - sv = &types.InvalidTrafficPolicyDocument{} + sv = make([]types.KeySigningKey, 0) } else { sv = *v } + originalDecoder := decoder for { t, done, err := decoder.Token() if err != nil { @@ -14564,24 +17058,18 @@ func awsRestxml_deserializeDocumentInvalidTrafficPolicyDocument(v **types.Invali if done { break } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("message", t.Name.Local): - val, err := decoder.Value() - if err != nil { + case strings.EqualFold("member", t.Name.Local): + var col types.KeySigningKey + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsRestxml_deserializeDocumentKeySigningKey(&destAddr, nodeDecoder); err != nil { return err } - if val == nil { - break - } - { - xtv := string(val) - sv.Message = ptr.String(xtv) - } + col = *destAddr + sv = append(sv, col) default: - // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() if err != nil { return err @@ -14594,13 +17082,37 @@ func awsRestxml_deserializeDocumentInvalidTrafficPolicyDocument(v **types.Invali return nil } -func awsRestxml_deserializeDocumentInvalidVPCId(v **types.InvalidVPCId, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeDocumentKeySigningKeysUnwrapped(v *[]types.KeySigningKey, decoder smithyxml.NodeDecoder) error { + var sv []types.KeySigningKey + if *v == nil { + sv = make([]types.KeySigningKey, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.KeySigningKey + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsRestxml_deserializeDocumentKeySigningKey(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsRestxml_deserializeDocumentKeySigningKeyWithActiveStatusNotFound(v **types.KeySigningKeyWithActiveStatusNotFound, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *types.InvalidVPCId + var sv *types.KeySigningKeyWithActiveStatusNotFound if *v == nil { - sv = &types.InvalidVPCId{} + sv = &types.KeySigningKeyWithActiveStatusNotFound{} } else { sv = *v } @@ -15097,6 +17609,55 @@ func awsRestxml_deserializeDocumentNoSuchHostedZone(v **types.NoSuchHostedZone, return nil } +func awsRestxml_deserializeDocumentNoSuchKeySigningKey(v **types.NoSuchKeySigningKey, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.NoSuchKeySigningKey + if *v == nil { + sv = &types.NoSuchKeySigningKey{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsRestxml_deserializeDocumentNoSuchQueryLoggingConfig(v **types.NoSuchQueryLoggingConfig, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16588,6 +19149,55 @@ func awsRestxml_deserializeDocumentTooManyHostedZones(v **types.TooManyHostedZon return nil } +func awsRestxml_deserializeDocumentTooManyKeySigningKeys(v **types.TooManyKeySigningKeys, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TooManyKeySigningKeys + if *v == nil { + sv = &types.TooManyKeySigningKeys{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("message", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Message = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsRestxml_deserializeDocumentTooManyTrafficPolicies(v **types.TooManyTrafficPolicies, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/route53/serializers.go b/service/route53/serializers.go index 09ada0d36bb..c932088adf9 100644 --- a/service/route53/serializers.go +++ b/service/route53/serializers.go @@ -14,6 +14,78 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +type awsRestxml_serializeOpActivateKeySigningKey struct { +} + +func (*awsRestxml_serializeOpActivateKeySigningKey) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpActivateKeySigningKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ActivateKeySigningKeyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2013-04-01/keysigningkey/{HostedZoneId}/{Name}/activate") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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 := awsRestxml_serializeOpHttpBindingsActivateKeySigningKeyInput(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 awsRestxml_serializeOpHttpBindingsActivateKeySigningKeyInput(v *ActivateKeySigningKeyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.HostedZoneId == nil || len(*v.HostedZoneId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member HostedZoneId must not be empty")} + } + if v.HostedZoneId != nil { + if err := encoder.SetURI("HostedZoneId").String(*v.HostedZoneId); err != nil { + return err + } + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + type awsRestxml_serializeOpAssociateVPCWithHostedZone struct { } @@ -573,6 +645,134 @@ func awsRestxml_serializeOpDocumentCreateHostedZoneInput(v *CreateHostedZoneInpu return nil } +type awsRestxml_serializeOpCreateKeySigningKey struct { +} + +func (*awsRestxml_serializeOpCreateKeySigningKey) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpCreateKeySigningKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateKeySigningKeyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2013-04-01/keysigningkey") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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/xml") + + xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "CreateKeySigningKeyRequest", + }, + Attr: rootAttr, + } + root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "https://route53.amazonaws.com/doc/2013-04-01/")) + if err := awsRestxml_serializeOpDocumentCreateKeySigningKeyInput(input, xmlEncoder.RootElement(root)); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + if request, err = request.SetStream(bytes.NewReader(xmlEncoder.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 awsRestxml_serializeOpHttpBindingsCreateKeySigningKeyInput(v *CreateKeySigningKeyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestxml_serializeOpDocumentCreateKeySigningKeyInput(v *CreateKeySigningKeyInput, value smithyxml.Value) error { + defer value.Close() + if v.CallerReference != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "CallerReference", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.CallerReference) + } + if v.HostedZoneId != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "HostedZoneId", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.HostedZoneId) + } + if v.KeyManagementServiceArn != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "KeyManagementServiceArn", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.KeyManagementServiceArn) + } + if v.Name != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Name", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.Name) + } + if v.Status != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Status", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.Status) + } + return nil +} + type awsRestxml_serializeOpCreateQueryLoggingConfig struct { } @@ -1204,6 +1404,78 @@ func awsRestxml_serializeOpDocumentCreateVPCAssociationAuthorizationInput(v *Cre return nil } +type awsRestxml_serializeOpDeactivateKeySigningKey struct { +} + +func (*awsRestxml_serializeOpDeactivateKeySigningKey) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDeactivateKeySigningKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeactivateKeySigningKeyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2013-04-01/keysigningkey/{HostedZoneId}/{Name}/deactivate") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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 := awsRestxml_serializeOpHttpBindingsDeactivateKeySigningKeyInput(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 awsRestxml_serializeOpHttpBindingsDeactivateKeySigningKeyInput(v *DeactivateKeySigningKeyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.HostedZoneId == nil || len(*v.HostedZoneId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member HostedZoneId must not be empty")} + } + if v.HostedZoneId != nil { + if err := encoder.SetURI("HostedZoneId").String(*v.HostedZoneId); err != nil { + return err + } + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + type awsRestxml_serializeOpDeleteHealthCheck struct { } @@ -1330,6 +1602,78 @@ func awsRestxml_serializeOpHttpBindingsDeleteHostedZoneInput(v *DeleteHostedZone return nil } +type awsRestxml_serializeOpDeleteKeySigningKey struct { +} + +func (*awsRestxml_serializeOpDeleteKeySigningKey) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDeleteKeySigningKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteKeySigningKeyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2013-04-01/keysigningkey/{HostedZoneId}/{Name}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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 := awsRestxml_serializeOpHttpBindingsDeleteKeySigningKeyInput(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 awsRestxml_serializeOpHttpBindingsDeleteKeySigningKeyInput(v *DeleteKeySigningKeyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.HostedZoneId == nil || len(*v.HostedZoneId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member HostedZoneId must not be empty")} + } + if v.HostedZoneId != nil { + if err := encoder.SetURI("HostedZoneId").String(*v.HostedZoneId); err != nil { + return err + } + } + + if v.Name == nil || len(*v.Name) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Name must not be empty")} + } + if v.Name != nil { + if err := encoder.SetURI("Name").String(*v.Name); err != nil { + return err + } + } + + return nil +} + type awsRestxml_serializeOpDeleteQueryLoggingConfig struct { } @@ -1690,6 +2034,69 @@ func awsRestxml_serializeOpDocumentDeleteVPCAssociationAuthorizationInput(v *Del return nil } +type awsRestxml_serializeOpDisableHostedZoneDNSSEC struct { +} + +func (*awsRestxml_serializeOpDisableHostedZoneDNSSEC) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDisableHostedZoneDNSSEC) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DisableHostedZoneDNSSECInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2013-04-01/hostedzone/{HostedZoneId}/disable-dnssec") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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 := awsRestxml_serializeOpHttpBindingsDisableHostedZoneDNSSECInput(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 awsRestxml_serializeOpHttpBindingsDisableHostedZoneDNSSECInput(v *DisableHostedZoneDNSSECInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.HostedZoneId == nil || len(*v.HostedZoneId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member HostedZoneId must not be empty")} + } + if v.HostedZoneId != nil { + if err := encoder.SetURI("HostedZoneId").String(*v.HostedZoneId); err != nil { + return err + } + } + + return nil +} + type awsRestxml_serializeOpDisassociateVPCFromHostedZone struct { } @@ -1800,6 +2207,69 @@ func awsRestxml_serializeOpDocumentDisassociateVPCFromHostedZoneInput(v *Disasso return nil } +type awsRestxml_serializeOpEnableHostedZoneDNSSEC struct { +} + +func (*awsRestxml_serializeOpEnableHostedZoneDNSSEC) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpEnableHostedZoneDNSSEC) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*EnableHostedZoneDNSSECInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2013-04-01/hostedzone/{HostedZoneId}/enable-dnssec") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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 := awsRestxml_serializeOpHttpBindingsEnableHostedZoneDNSSECInput(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 awsRestxml_serializeOpHttpBindingsEnableHostedZoneDNSSECInput(v *EnableHostedZoneDNSSECInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.HostedZoneId == nil || len(*v.HostedZoneId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member HostedZoneId must not be empty")} + } + if v.HostedZoneId != nil { + if err := encoder.SetURI("HostedZoneId").String(*v.HostedZoneId); err != nil { + return err + } + } + + return nil +} + type awsRestxml_serializeOpGetAccountLimit struct { } @@ -1976,6 +2446,69 @@ func awsRestxml_serializeOpHttpBindingsGetCheckerIpRangesInput(v *GetCheckerIpRa return nil } +type awsRestxml_serializeOpGetDNSSEC struct { +} + +func (*awsRestxml_serializeOpGetDNSSEC) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpGetDNSSEC) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetDNSSECInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2013-04-01/hostedzone/{HostedZoneId}/dnssec") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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 := awsRestxml_serializeOpHttpBindingsGetDNSSECInput(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 awsRestxml_serializeOpHttpBindingsGetDNSSECInput(v *GetDNSSECInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.HostedZoneId == nil || len(*v.HostedZoneId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member HostedZoneId must not be empty")} + } + if v.HostedZoneId != nil { + if err := encoder.SetURI("HostedZoneId").String(*v.HostedZoneId); err != nil { + return err + } + } + + return nil +} + type awsRestxml_serializeOpGetGeoLocation struct { } diff --git a/service/route53/types/enums.go b/service/route53/types/enums.go index 36269474ce1..a2abdf916cf 100644 --- a/service/route53/types/enums.go +++ b/service/route53/types/enums.go @@ -4,6 +4,15 @@ package types type AccountLimitType string +// Enum values for AccountLimitType +const ( + AccountLimitTypeMaxHealthChecksByOwner AccountLimitType = "MAX_HEALTH_CHECKS_BY_OWNER" + AccountLimitTypeMaxHostedZonesByOwner AccountLimitType = "MAX_HOSTED_ZONES_BY_OWNER" + AccountLimitTypeMaxTrafficPolicyInstancesByOwner AccountLimitType = "MAX_TRAFFIC_POLICY_INSTANCES_BY_OWNER" + AccountLimitTypeMaxReusableDelegationSetsByOwner AccountLimitType = "MAX_REUSABLE_DELEGATION_SETS_BY_OWNER" + AccountLimitTypeMaxTrafficPoliciesByOwner AccountLimitType = "MAX_TRAFFIC_POLICIES_BY_OWNER" +) + // Values returns all known values for AccountLimitType. 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. @@ -19,6 +28,13 @@ func (AccountLimitType) Values() []AccountLimitType { type ChangeAction string +// Enum values for ChangeAction +const ( + ChangeActionCreate ChangeAction = "CREATE" + ChangeActionDelete ChangeAction = "DELETE" + ChangeActionUpsert ChangeAction = "UPSERT" +) + // Values returns all known values for ChangeAction. 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. @@ -32,6 +48,12 @@ func (ChangeAction) Values() []ChangeAction { type ChangeStatus string +// Enum values for ChangeStatus +const ( + ChangeStatusPending ChangeStatus = "PENDING" + ChangeStatusInsync ChangeStatus = "INSYNC" +) + // Values returns all known values for ChangeStatus. 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. @@ -44,6 +66,37 @@ func (ChangeStatus) Values() []ChangeStatus { type CloudWatchRegion string +// Enum values for CloudWatchRegion +const ( + CloudWatchRegionUsEast1 CloudWatchRegion = "us-east-1" + CloudWatchRegionUsEast2 CloudWatchRegion = "us-east-2" + CloudWatchRegionUsWest1 CloudWatchRegion = "us-west-1" + CloudWatchRegionUsWest2 CloudWatchRegion = "us-west-2" + CloudWatchRegionCaCentral1 CloudWatchRegion = "ca-central-1" + CloudWatchRegionEuCentral1 CloudWatchRegion = "eu-central-1" + CloudWatchRegionEuWest1 CloudWatchRegion = "eu-west-1" + CloudWatchRegionEuWest2 CloudWatchRegion = "eu-west-2" + CloudWatchRegionEuWest3 CloudWatchRegion = "eu-west-3" + CloudWatchRegionApEast1 CloudWatchRegion = "ap-east-1" + CloudWatchRegionMeSouth1 CloudWatchRegion = "me-south-1" + CloudWatchRegionApSouth1 CloudWatchRegion = "ap-south-1" + CloudWatchRegionApSoutheast1 CloudWatchRegion = "ap-southeast-1" + CloudWatchRegionApSoutheast2 CloudWatchRegion = "ap-southeast-2" + CloudWatchRegionApNortheast1 CloudWatchRegion = "ap-northeast-1" + CloudWatchRegionApNortheast2 CloudWatchRegion = "ap-northeast-2" + CloudWatchRegionApNortheast3 CloudWatchRegion = "ap-northeast-3" + CloudWatchRegionEuNorth1 CloudWatchRegion = "eu-north-1" + CloudWatchRegionSaEast1 CloudWatchRegion = "sa-east-1" + CloudWatchRegionCnNorthwest1 CloudWatchRegion = "cn-northwest-1" + CloudWatchRegionCnNorth1 CloudWatchRegion = "cn-north-1" + CloudWatchRegionAfSouth1 CloudWatchRegion = "af-south-1" + CloudWatchRegionEuSouth1 CloudWatchRegion = "eu-south-1" + CloudWatchRegionUsGovWest1 CloudWatchRegion = "us-gov-west-1" + CloudWatchRegionUsGovEast1 CloudWatchRegion = "us-gov-east-1" + CloudWatchRegionUsIsoEast1 CloudWatchRegion = "us-iso-east-1" + CloudWatchRegionUsIsobEast1 CloudWatchRegion = "us-isob-east-1" +) + // Values returns all known values for CloudWatchRegion. 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. @@ -81,6 +134,14 @@ func (CloudWatchRegion) Values() []CloudWatchRegion { type ComparisonOperator string +// Enum values for ComparisonOperator +const ( + ComparisonOperatorGreaterthanorequaltothreshold ComparisonOperator = "GreaterThanOrEqualToThreshold" + ComparisonOperatorGreaterthanthreshold ComparisonOperator = "GreaterThanThreshold" + ComparisonOperatorLessthanthreshold ComparisonOperator = "LessThanThreshold" + ComparisonOperatorLessthanorequaltothreshold ComparisonOperator = "LessThanOrEqualToThreshold" +) + // Values returns all known values for ComparisonOperator. 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. @@ -95,6 +156,18 @@ func (ComparisonOperator) Values() []ComparisonOperator { type HealthCheckRegion string +// Enum values for HealthCheckRegion +const ( + HealthCheckRegionUsEast1 HealthCheckRegion = "us-east-1" + HealthCheckRegionUsWest1 HealthCheckRegion = "us-west-1" + HealthCheckRegionUsWest2 HealthCheckRegion = "us-west-2" + HealthCheckRegionEuWest1 HealthCheckRegion = "eu-west-1" + HealthCheckRegionApSoutheast1 HealthCheckRegion = "ap-southeast-1" + HealthCheckRegionApSoutheast2 HealthCheckRegion = "ap-southeast-2" + HealthCheckRegionApNortheast1 HealthCheckRegion = "ap-northeast-1" + HealthCheckRegionSaEast1 HealthCheckRegion = "sa-east-1" +) + // Values returns all known values for HealthCheckRegion. 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. @@ -141,6 +214,12 @@ func (HealthCheckType) Values() []HealthCheckType { type HostedZoneLimitType string +// Enum values for HostedZoneLimitType +const ( + HostedZoneLimitTypeMaxRrsetsByZone HostedZoneLimitType = "MAX_RRSETS_BY_ZONE" + HostedZoneLimitTypeMaxVpcsAssociatedByZone HostedZoneLimitType = "MAX_VPCS_ASSOCIATED_BY_ZONE" +) + // Values returns all known values for HostedZoneLimitType. 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. @@ -153,6 +232,13 @@ func (HostedZoneLimitType) Values() []HostedZoneLimitType { type InsufficientDataHealthStatus string +// Enum values for InsufficientDataHealthStatus +const ( + InsufficientDataHealthStatusHealthy InsufficientDataHealthStatus = "Healthy" + InsufficientDataHealthStatusUnhealthy InsufficientDataHealthStatus = "Unhealthy" + InsufficientDataHealthStatusLastknownstatus InsufficientDataHealthStatus = "LastKnownStatus" +) + // Values returns all known values for InsufficientDataHealthStatus. 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. @@ -166,6 +252,14 @@ func (InsufficientDataHealthStatus) Values() []InsufficientDataHealthStatus { type ResettableElementName string +// Enum values for ResettableElementName +const ( + ResettableElementNameFullyqualifieddomainname ResettableElementName = "FullyQualifiedDomainName" + ResettableElementNameRegions ResettableElementName = "Regions" + ResettableElementNameResourcepath ResettableElementName = "ResourcePath" + ResettableElementNameChildhealthchecks ResettableElementName = "ChildHealthChecks" +) + // Values returns all known values for ResettableElementName. 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. @@ -180,6 +274,12 @@ func (ResettableElementName) Values() []ResettableElementName { type ResourceRecordSetFailover string +// Enum values for ResourceRecordSetFailover +const ( + ResourceRecordSetFailoverPrimary ResourceRecordSetFailover = "PRIMARY" + ResourceRecordSetFailoverSecondary ResourceRecordSetFailover = "SECONDARY" +) + // Values returns all known values for ResourceRecordSetFailover. 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. @@ -192,6 +292,33 @@ func (ResourceRecordSetFailover) Values() []ResourceRecordSetFailover { type ResourceRecordSetRegion string +// Enum values for ResourceRecordSetRegion +const ( + ResourceRecordSetRegionUsEast1 ResourceRecordSetRegion = "us-east-1" + ResourceRecordSetRegionUsEast2 ResourceRecordSetRegion = "us-east-2" + ResourceRecordSetRegionUsWest1 ResourceRecordSetRegion = "us-west-1" + ResourceRecordSetRegionUsWest2 ResourceRecordSetRegion = "us-west-2" + ResourceRecordSetRegionCaCentral1 ResourceRecordSetRegion = "ca-central-1" + ResourceRecordSetRegionEuWest1 ResourceRecordSetRegion = "eu-west-1" + ResourceRecordSetRegionEuWest2 ResourceRecordSetRegion = "eu-west-2" + ResourceRecordSetRegionEuWest3 ResourceRecordSetRegion = "eu-west-3" + ResourceRecordSetRegionEuCentral1 ResourceRecordSetRegion = "eu-central-1" + ResourceRecordSetRegionApSoutheast1 ResourceRecordSetRegion = "ap-southeast-1" + ResourceRecordSetRegionApSoutheast2 ResourceRecordSetRegion = "ap-southeast-2" + ResourceRecordSetRegionApNortheast1 ResourceRecordSetRegion = "ap-northeast-1" + ResourceRecordSetRegionApNortheast2 ResourceRecordSetRegion = "ap-northeast-2" + ResourceRecordSetRegionApNortheast3 ResourceRecordSetRegion = "ap-northeast-3" + ResourceRecordSetRegionEuNorth1 ResourceRecordSetRegion = "eu-north-1" + ResourceRecordSetRegionSaEast1 ResourceRecordSetRegion = "sa-east-1" + ResourceRecordSetRegionCnNorth1 ResourceRecordSetRegion = "cn-north-1" + ResourceRecordSetRegionCnNorthwest1 ResourceRecordSetRegion = "cn-northwest-1" + ResourceRecordSetRegionApEast1 ResourceRecordSetRegion = "ap-east-1" + ResourceRecordSetRegionMeSouth1 ResourceRecordSetRegion = "me-south-1" + ResourceRecordSetRegionApSouth1 ResourceRecordSetRegion = "ap-south-1" + ResourceRecordSetRegionAfSouth1 ResourceRecordSetRegion = "af-south-1" + ResourceRecordSetRegionEuSouth1 ResourceRecordSetRegion = "eu-south-1" +) + // Values returns all known values for ResourceRecordSetRegion. 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. @@ -225,6 +352,11 @@ func (ResourceRecordSetRegion) Values() []ResourceRecordSetRegion { type ReusableDelegationSetLimitType string +// Enum values for ReusableDelegationSetLimitType +const ( + ReusableDelegationSetLimitTypeMaxZonesByReusableDelegationSet ReusableDelegationSetLimitType = "MAX_ZONES_BY_REUSABLE_DELEGATION_SET" +) + // Values returns all known values for ReusableDelegationSetLimitType. 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 @@ -237,6 +369,23 @@ func (ReusableDelegationSetLimitType) Values() []ReusableDelegationSetLimitType type RRType string +// Enum values for RRType +const ( + RRTypeSoa RRType = "SOA" + RRTypeA RRType = "A" + RRTypeTxt RRType = "TXT" + RRTypeNs RRType = "NS" + RRTypeCname RRType = "CNAME" + RRTypeMx RRType = "MX" + RRTypeNaptr RRType = "NAPTR" + RRTypePtr RRType = "PTR" + RRTypeSrv RRType = "SRV" + RRTypeSpf RRType = "SPF" + RRTypeAaaa RRType = "AAAA" + RRTypeCaa RRType = "CAA" + RRTypeDs RRType = "DS" +) + // Values returns all known values for RRType. 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. @@ -254,11 +403,21 @@ func (RRType) Values() []RRType { "SPF", "AAAA", "CAA", + "DS", } } type Statistic string +// Enum values for Statistic +const ( + StatisticAverage Statistic = "Average" + StatisticSum Statistic = "Sum" + StatisticSamplecount Statistic = "SampleCount" + StatisticMaximum Statistic = "Maximum" + StatisticMinimum Statistic = "Minimum" +) + // Values returns all known values for Statistic. 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. @@ -274,6 +433,12 @@ func (Statistic) Values() []Statistic { type TagResourceType string +// Enum values for TagResourceType +const ( + TagResourceTypeHealthcheck TagResourceType = "healthcheck" + TagResourceTypeHostedzone TagResourceType = "hostedzone" +) + // Values returns all known values for TagResourceType. 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. @@ -286,6 +451,36 @@ func (TagResourceType) Values() []TagResourceType { type VPCRegion string +// Enum values for VPCRegion +const ( + VPCRegionUsEast1 VPCRegion = "us-east-1" + VPCRegionUsEast2 VPCRegion = "us-east-2" + VPCRegionUsWest1 VPCRegion = "us-west-1" + VPCRegionUsWest2 VPCRegion = "us-west-2" + VPCRegionEuWest1 VPCRegion = "eu-west-1" + VPCRegionEuWest2 VPCRegion = "eu-west-2" + VPCRegionEuWest3 VPCRegion = "eu-west-3" + VPCRegionEuCentral1 VPCRegion = "eu-central-1" + VPCRegionApEast1 VPCRegion = "ap-east-1" + VPCRegionMeSouth1 VPCRegion = "me-south-1" + VPCRegionUsGovWest1 VPCRegion = "us-gov-west-1" + VPCRegionUsGovEast1 VPCRegion = "us-gov-east-1" + VPCRegionUsIsoEast1 VPCRegion = "us-iso-east-1" + VPCRegionUsIsobEast1 VPCRegion = "us-isob-east-1" + VPCRegionApSoutheast1 VPCRegion = "ap-southeast-1" + VPCRegionApSoutheast2 VPCRegion = "ap-southeast-2" + VPCRegionApSouth1 VPCRegion = "ap-south-1" + VPCRegionApNortheast1 VPCRegion = "ap-northeast-1" + VPCRegionApNortheast2 VPCRegion = "ap-northeast-2" + VPCRegionApNortheast3 VPCRegion = "ap-northeast-3" + VPCRegionEuNorth1 VPCRegion = "eu-north-1" + VPCRegionSaEast1 VPCRegion = "sa-east-1" + VPCRegionCaCentral1 VPCRegion = "ca-central-1" + VPCRegionCnNorth1 VPCRegion = "cn-north-1" + VPCRegionAfSouth1 VPCRegion = "af-south-1" + VPCRegionEuSouth1 VPCRegion = "eu-south-1" +) + // Values returns all known values for VPCRegion. 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. diff --git a/service/route53/types/errors.go b/service/route53/types/errors.go index 1d8446fa219..b731fb87b50 100644 --- a/service/route53/types/errors.go +++ b/service/route53/types/errors.go @@ -171,6 +171,23 @@ func (e *DelegationSetNotReusable) ErrorMessage() string { func (e *DelegationSetNotReusable) ErrorCode() string { return "DelegationSetNotReusable" } func (e *DelegationSetNotReusable) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The hosted zone doesn't have any DNSSEC resources. +type DNSSECNotFound struct { + Message *string +} + +func (e *DNSSECNotFound) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DNSSECNotFound) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DNSSECNotFound) ErrorCode() string { return "DNSSECNotFound" } +func (e *DNSSECNotFound) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The health check you're attempting to create already exists. Amazon Route 53 // returns this error when you submit a request that has the following values: // @@ -302,6 +319,24 @@ func (e *HostedZoneNotPrivate) ErrorMessage() string { func (e *HostedZoneNotPrivate) ErrorCode() string { return "HostedZoneNotPrivate" } func (e *HostedZoneNotPrivate) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The hosted zone nameservers don't match the parent nameservers. The hosted zone +// and parent must have the same nameservers. +type HostedZonePartiallyDelegated struct { + Message *string +} + +func (e *HostedZonePartiallyDelegated) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *HostedZonePartiallyDelegated) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *HostedZonePartiallyDelegated) ErrorCode() string { return "HostedZonePartiallyDelegated" } +func (e *HostedZonePartiallyDelegated) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The resource you're trying to access is unsupported on this Amazon Route 53 // endpoint. type IncompatibleVersion struct { @@ -352,7 +387,7 @@ func (e *InsufficientCloudWatchLogsResourcePolicy) ErrorFault() smithy.ErrorFaul return smithy.FaultClient } -// Parameter name is invalid. +// Parameter name is not valid. type InvalidArgument struct { Message *string } @@ -423,6 +458,59 @@ func (e *InvalidInput) ErrorMessage() string { func (e *InvalidInput) ErrorCode() string { return "InvalidInput" } func (e *InvalidInput) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The key signing key (KSK) name that you specified isn't a valid name. +type InvalidKeySigningKeyName struct { + Message *string +} + +func (e *InvalidKeySigningKeyName) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidKeySigningKeyName) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidKeySigningKeyName) ErrorCode() string { return "InvalidKeySigningKeyName" } +func (e *InvalidKeySigningKeyName) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The key signing key (KSK) status isn't valid or another KSK has the status +// INTERNAL_FAILURE. +type InvalidKeySigningKeyStatus struct { + Message *string +} + +func (e *InvalidKeySigningKeyStatus) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidKeySigningKeyStatus) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidKeySigningKeyStatus) ErrorCode() string { return "InvalidKeySigningKeyStatus" } +func (e *InvalidKeySigningKeyStatus) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The KeyManagementServiceArn that you specified isn't valid to use with DNSSEC +// signing. +type InvalidKMSArn struct { + Message *string +} + +func (e *InvalidKMSArn) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidKMSArn) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidKMSArn) ErrorCode() string { return "InvalidKMSArn" } +func (e *InvalidKMSArn) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The value that you specified to get the second or subsequent page of results is // invalid. type InvalidPaginationToken struct { @@ -441,8 +529,26 @@ func (e *InvalidPaginationToken) ErrorMessage() string { func (e *InvalidPaginationToken) ErrorCode() string { return "InvalidPaginationToken" } func (e *InvalidPaginationToken) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// Your hosted zone status isn't valid for this operation. In the hosted zone, +// change the status to enable DNSSEC or disable DNSSEC. +type InvalidSigningStatus struct { + Message *string +} + +func (e *InvalidSigningStatus) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidSigningStatus) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidSigningStatus) ErrorCode() string { return "InvalidSigningStatus" } +func (e *InvalidSigningStatus) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The format of the traffic policy document that you specified in the Document -// element is invalid. +// element is not valid. type InvalidTrafficPolicyDocument struct { Message *string } @@ -477,6 +583,81 @@ func (e *InvalidVPCId) ErrorMessage() string { func (e *InvalidVPCId) ErrorCode() string { return "InvalidVPCId" } func (e *InvalidVPCId) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// You've already created a key signing key (KSK) with this name or with the same +// customer managed key (CMK) ARN. +type KeySigningKeyAlreadyExists struct { + Message *string +} + +func (e *KeySigningKeyAlreadyExists) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *KeySigningKeyAlreadyExists) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *KeySigningKeyAlreadyExists) ErrorCode() string { return "KeySigningKeyAlreadyExists" } +func (e *KeySigningKeyAlreadyExists) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The key signing key (KSK) is specified in a parent DS record. +type KeySigningKeyInParentDSRecord struct { + Message *string +} + +func (e *KeySigningKeyInParentDSRecord) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *KeySigningKeyInParentDSRecord) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *KeySigningKeyInParentDSRecord) ErrorCode() string { return "KeySigningKeyInParentDSRecord" } +func (e *KeySigningKeyInParentDSRecord) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The key signing key (KSK) that you specified can't be deactivated because it's +// the only KSK for a currently-enabled DNSSEC. Disable DNSSEC signing, or add or +// enable another KSK. +type KeySigningKeyInUse struct { + Message *string +} + +func (e *KeySigningKeyInUse) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *KeySigningKeyInUse) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *KeySigningKeyInUse) ErrorCode() string { return "KeySigningKeyInUse" } +func (e *KeySigningKeyInUse) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// A key signing key (KSK) with ACTIVE status wasn't found. +type KeySigningKeyWithActiveStatusNotFound struct { + Message *string +} + +func (e *KeySigningKeyWithActiveStatusNotFound) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *KeySigningKeyWithActiveStatusNotFound) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *KeySigningKeyWithActiveStatusNotFound) ErrorCode() string { + return "KeySigningKeyWithActiveStatusNotFound" +} +func (e *KeySigningKeyWithActiveStatusNotFound) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + // The VPC that you're trying to disassociate from the private hosted zone is the // last VPC that is associated with the hosted zone. Amazon Route 53 doesn't // support disassociating the last VPC from a hosted zone. @@ -628,6 +809,23 @@ func (e *NoSuchHostedZone) ErrorMessage() string { func (e *NoSuchHostedZone) ErrorCode() string { return "NoSuchHostedZone" } func (e *NoSuchHostedZone) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The specified key signing key (KSK) doesn't exist. +type NoSuchKeySigningKey struct { + Message *string +} + +func (e *NoSuchKeySigningKey) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *NoSuchKeySigningKey) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *NoSuchKeySigningKey) ErrorCode() string { return "NoSuchKeySigningKey" } +func (e *NoSuchKeySigningKey) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // There is no DNS query logging configuration with the specified ID. type NoSuchQueryLoggingConfig struct { Message *string @@ -829,6 +1027,24 @@ func (e *TooManyHostedZones) ErrorMessage() string { func (e *TooManyHostedZones) ErrorCode() string { return "TooManyHostedZones" } func (e *TooManyHostedZones) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// You've reached the limit for the number of key signing keys (KSKs). Remove at +// least one KSK, and then try again. +type TooManyKeySigningKeys struct { + Message *string +} + +func (e *TooManyKeySigningKeys) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TooManyKeySigningKeys) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TooManyKeySigningKeys) ErrorCode() string { return "TooManyKeySigningKeys" } +func (e *TooManyKeySigningKeys) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // This traffic policy can't be created because the current account has reached the // limit on the number of traffic policies. For information about default limits, // see Limits diff --git a/service/route53/types/types.go b/service/route53/types/types.go index 56623645dff..997914a8259 100644 --- a/service/route53/types/types.go +++ b/service/route53/types/types.go @@ -524,6 +524,24 @@ type Dimension struct { Value *string } +// A string repesenting the status of DNSSEC signing. +type DNSSECStatus struct { + + // Indicates your hosted zone signging status: SIGNING, NOT_SIGNING, or + // INTERNAL_FAILURE. If the status is INTERNAL_FAILURE, see StatusMessage for + // information about steps that you can take to correct the problem. A status + // INTERNAL_FAILURE means there was an error during a request. Before you can + // continue to work with DNSSEC signing, including working with key signing keys + // (KSKs), you must correct the problem by enabling or disabling DNSSEC signing for + // the hosted zone. + ServeSignature *string + + // The status message provided for the following DNSSEC signing status: + // INTERNAL_FAILURE. The status message includes information about what the problem + // might be and steps that you can take to correct the issue. + StatusMessage *string +} + // A complex type that contains information about a geographic location. type GeoLocation struct { @@ -1037,6 +1055,107 @@ type HostedZoneSummary struct { Owner *HostedZoneOwner } +// A key signing key (KSK) is a complex type that represents a public/private key +// pair. The private key is used to generate a digital signature for the zone +// signing key (ZSK). The public key is stored in the DNS and is used to +// authenticate the ZSK. A KSK is always associated with a hosted zone; it cannot +// exist by itself. +type KeySigningKey struct { + + // The date when the key signing key (KSK) was created. + CreatedDate *time.Time + + // A string that represents a DNSKEY record. + DNSKEYRecord *string + + // A string that represents a delegation signer (DS) record. + DSRecord *string + + // A string used to represent the delegation signer digest algorithm. This value + // must follow the guidelines provided by RFC-8624 Section 3.3 + // (https://tools.ietf.org/html/rfc8624#section-3.3). + DigestAlgorithmMnemonic *string + + // An integer used to represent the delegation signer digest algorithm. This value + // must follow the guidelines provided by RFC-8624 Section 3.3 + // (https://tools.ietf.org/html/rfc8624#section-3.3). + DigestAlgorithmType int32 + + // A cryptographic digest of a DNSKEY resource record (RR). DNSKEY records are used + // to publish the public key that resolvers can use to verify DNSSEC signatures + // that are used to secure certain kinds of information provided by the DNS system. + DigestValue *string + + // An integer that specifies how the key is used. For key signing key (KSK), this + // value is always 257. + Flag int32 + + // An integer used to identify the DNSSEC record for the domain name. The process + // used to calculate the value is described in RFC-4034 Appendix B + // (https://tools.ietf.org/rfc/rfc4034.txt). + KeyTag int32 + + // The Amazon resource name (ARN) used to identify the customer managed key (CMK) + // in AWS Key Management Service (KMS). The KmsArn must be unique for each key + // signing key (KSK) in a single hosted zone. You must configure the CMK 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": "api-service.dnssec.route53.aws.internal" + // + // For more information about + // working with the customer managed key (CMK) in KMS, see AWS Key Management + // Service concepts + // (https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html). + KmsArn *string + + // The last time that the key signing key (KSK) was changed. + LastModifiedDate *time.Time + + // An alphanumeric string used to identify a key signing key (KSK). Name must be + // unique for each key signing key in the same hosted zone. + Name *string + + // The public key, represented as a Base64 encoding, as required by RFC-4034 Page + // 5 (https://tools.ietf.org/rfc/rfc4034.txt). + PublicKey *string + + // A string used to represent the signing algorithm. This value must follow the + // guidelines provided by RFC-8624 Section 3.1 + // (https://tools.ietf.org/html/rfc8624#section-3.1). + SigningAlgorithmMnemonic *string + + // An integer used to represent the signing algorithm. This value must follow the + // guidelines provided by RFC-8624 Section 3.1 + // (https://tools.ietf.org/html/rfc8624#section-3.1). + SigningAlgorithmType int32 + + // A string that represents the current key signing key (KSK) status. Status can + // have one of the following values: ACTIVE The KSK is being used for signing. + // INACTIVE The KSK is not being used for signing. ACTION_NEEDED There is an error + // in the KSK that requires you to take action to resolve. INTERNAL_FAILURE There + // was an error during a request. Before you can continue to work with DNSSEC + // signing, including actions that involve this KSK, you must correct the problem. + // For example, you may need to activate or deactivate the KSK. + Status *string + + // The status message provided for the following key signing key (KSK) statuses: + // ACTION_NEEDED or INTERNAL_FAILURE. The status message includes information about + // what the problem might be and steps that you can take to correct the issue. + StatusMessage *string +} + // If a health check or hosted zone was created by another service, LinkedService // is a complex type that describes the service that created the resource. When a // resource is created by another service, you can't edit or delete it using Amazon diff --git a/service/route53/validators.go b/service/route53/validators.go index 6dbecda75fb..c6ba9ff3c2a 100644 --- a/service/route53/validators.go +++ b/service/route53/validators.go @@ -10,6 +10,26 @@ import ( "github.com/aws/smithy-go/middleware" ) +type validateOpActivateKeySigningKey struct { +} + +func (*validateOpActivateKeySigningKey) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpActivateKeySigningKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ActivateKeySigningKeyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpActivateKeySigningKeyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpAssociateVPCWithHostedZone struct { } @@ -110,6 +130,26 @@ func (m *validateOpCreateHostedZone) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpCreateKeySigningKey struct { +} + +func (*validateOpCreateKeySigningKey) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateKeySigningKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateKeySigningKeyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateKeySigningKeyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateQueryLoggingConfig struct { } @@ -230,6 +270,26 @@ func (m *validateOpCreateVPCAssociationAuthorization) HandleInitialize(ctx conte return next.HandleInitialize(ctx, in) } +type validateOpDeactivateKeySigningKey struct { +} + +func (*validateOpDeactivateKeySigningKey) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeactivateKeySigningKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeactivateKeySigningKeyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeactivateKeySigningKeyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteHealthCheck struct { } @@ -270,6 +330,26 @@ func (m *validateOpDeleteHostedZone) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpDeleteKeySigningKey struct { +} + +func (*validateOpDeleteKeySigningKey) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteKeySigningKey) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteKeySigningKeyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteKeySigningKeyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteQueryLoggingConfig struct { } @@ -370,6 +450,26 @@ func (m *validateOpDeleteVPCAssociationAuthorization) HandleInitialize(ctx conte return next.HandleInitialize(ctx, in) } +type validateOpDisableHostedZoneDNSSEC struct { +} + +func (*validateOpDisableHostedZoneDNSSEC) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDisableHostedZoneDNSSEC) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DisableHostedZoneDNSSECInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDisableHostedZoneDNSSECInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDisassociateVPCFromHostedZone struct { } @@ -390,6 +490,26 @@ func (m *validateOpDisassociateVPCFromHostedZone) HandleInitialize(ctx context.C return next.HandleInitialize(ctx, in) } +type validateOpEnableHostedZoneDNSSEC struct { +} + +func (*validateOpEnableHostedZoneDNSSEC) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpEnableHostedZoneDNSSEC) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*EnableHostedZoneDNSSECInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpEnableHostedZoneDNSSECInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetAccountLimit struct { } @@ -430,6 +550,26 @@ func (m *validateOpGetChange) HandleInitialize(ctx context.Context, in middlewar return next.HandleInitialize(ctx, in) } +type validateOpGetDNSSEC struct { +} + +func (*validateOpGetDNSSEC) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetDNSSEC) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetDNSSECInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetDNSSECInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetHealthCheck struct { } @@ -890,6 +1030,10 @@ func (m *validateOpUpdateTrafficPolicyInstance) HandleInitialize(ctx context.Con return next.HandleInitialize(ctx, in) } +func addOpActivateKeySigningKeyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpActivateKeySigningKey{}, middleware.After) +} + func addOpAssociateVPCWithHostedZoneValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociateVPCWithHostedZone{}, middleware.After) } @@ -910,6 +1054,10 @@ func addOpCreateHostedZoneValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateHostedZone{}, middleware.After) } +func addOpCreateKeySigningKeyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateKeySigningKey{}, middleware.After) +} + func addOpCreateQueryLoggingConfigValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateQueryLoggingConfig{}, middleware.After) } @@ -934,6 +1082,10 @@ func addOpCreateVPCAssociationAuthorizationValidationMiddleware(stack *middlewar return stack.Initialize.Add(&validateOpCreateVPCAssociationAuthorization{}, middleware.After) } +func addOpDeactivateKeySigningKeyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeactivateKeySigningKey{}, middleware.After) +} + func addOpDeleteHealthCheckValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteHealthCheck{}, middleware.After) } @@ -942,6 +1094,10 @@ func addOpDeleteHostedZoneValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteHostedZone{}, middleware.After) } +func addOpDeleteKeySigningKeyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteKeySigningKey{}, middleware.After) +} + func addOpDeleteQueryLoggingConfigValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteQueryLoggingConfig{}, middleware.After) } @@ -962,10 +1118,18 @@ func addOpDeleteVPCAssociationAuthorizationValidationMiddleware(stack *middlewar return stack.Initialize.Add(&validateOpDeleteVPCAssociationAuthorization{}, middleware.After) } +func addOpDisableHostedZoneDNSSECValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDisableHostedZoneDNSSEC{}, middleware.After) +} + func addOpDisassociateVPCFromHostedZoneValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDisassociateVPCFromHostedZone{}, middleware.After) } +func addOpEnableHostedZoneDNSSECValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpEnableHostedZoneDNSSEC{}, middleware.After) +} + func addOpGetAccountLimitValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetAccountLimit{}, middleware.After) } @@ -974,6 +1138,10 @@ func addOpGetChangeValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetChange{}, middleware.After) } +func addOpGetDNSSECValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetDNSSEC{}, middleware.After) +} + func addOpGetHealthCheckValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetHealthCheck{}, middleware.After) } @@ -1240,6 +1408,24 @@ func validateResourceRecordSet(v *types.ResourceRecordSet) error { } } +func validateOpActivateKeySigningKeyInput(v *ActivateKeySigningKeyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ActivateKeySigningKeyInput"} + if v.HostedZoneId == nil { + invalidParams.Add(smithy.NewErrParamRequired("HostedZoneId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpAssociateVPCWithHostedZoneInput(v *AssociateVPCWithHostedZoneInput) error { if v == nil { return nil @@ -1338,6 +1524,33 @@ func validateOpCreateHostedZoneInput(v *CreateHostedZoneInput) error { } } +func validateOpCreateKeySigningKeyInput(v *CreateKeySigningKeyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateKeySigningKeyInput"} + if v.CallerReference == nil { + invalidParams.Add(smithy.NewErrParamRequired("CallerReference")) + } + if v.HostedZoneId == nil { + invalidParams.Add(smithy.NewErrParamRequired("HostedZoneId")) + } + if v.KeyManagementServiceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("KeyManagementServiceArn")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Status == nil { + invalidParams.Add(smithy.NewErrParamRequired("Status")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateQueryLoggingConfigInput(v *CreateQueryLoggingConfigInput) error { if v == nil { return nil @@ -1452,6 +1665,24 @@ func validateOpCreateVPCAssociationAuthorizationInput(v *CreateVPCAssociationAut } } +func validateOpDeactivateKeySigningKeyInput(v *DeactivateKeySigningKeyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeactivateKeySigningKeyInput"} + if v.HostedZoneId == nil { + invalidParams.Add(smithy.NewErrParamRequired("HostedZoneId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteHealthCheckInput(v *DeleteHealthCheckInput) error { if v == nil { return nil @@ -1482,6 +1713,24 @@ func validateOpDeleteHostedZoneInput(v *DeleteHostedZoneInput) error { } } +func validateOpDeleteKeySigningKeyInput(v *DeleteKeySigningKeyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteKeySigningKeyInput"} + if v.HostedZoneId == nil { + invalidParams.Add(smithy.NewErrParamRequired("HostedZoneId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteQueryLoggingConfigInput(v *DeleteQueryLoggingConfigInput) error { if v == nil { return nil @@ -1563,6 +1812,21 @@ func validateOpDeleteVPCAssociationAuthorizationInput(v *DeleteVPCAssociationAut } } +func validateOpDisableHostedZoneDNSSECInput(v *DisableHostedZoneDNSSECInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DisableHostedZoneDNSSECInput"} + if v.HostedZoneId == nil { + invalidParams.Add(smithy.NewErrParamRequired("HostedZoneId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDisassociateVPCFromHostedZoneInput(v *DisassociateVPCFromHostedZoneInput) error { if v == nil { return nil @@ -1581,6 +1845,21 @@ func validateOpDisassociateVPCFromHostedZoneInput(v *DisassociateVPCFromHostedZo } } +func validateOpEnableHostedZoneDNSSECInput(v *EnableHostedZoneDNSSECInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EnableHostedZoneDNSSECInput"} + if v.HostedZoneId == nil { + invalidParams.Add(smithy.NewErrParamRequired("HostedZoneId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetAccountLimitInput(v *GetAccountLimitInput) error { if v == nil { return nil @@ -1611,6 +1890,21 @@ func validateOpGetChangeInput(v *GetChangeInput) error { } } +func validateOpGetDNSSECInput(v *GetDNSSECInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetDNSSECInput"} + if v.HostedZoneId == nil { + invalidParams.Add(smithy.NewErrParamRequired("HostedZoneId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetHealthCheckInput(v *GetHealthCheckInput) error { if v == nil { return nil diff --git a/service/route53domains/types/enums.go b/service/route53domains/types/enums.go index 197778e10c1..9c8742645de 100644 --- a/service/route53domains/types/enums.go +++ b/service/route53domains/types/enums.go @@ -4,6 +4,15 @@ package types type ContactType string +// Enum values for ContactType +const ( + ContactTypePerson ContactType = "PERSON" + ContactTypeCompany ContactType = "COMPANY" + ContactTypeAssociation ContactType = "ASSOCIATION" + ContactTypePublicBody ContactType = "PUBLIC_BODY" + ContactTypeReseller ContactType = "RESELLER" +) + // Values returns all known values for ContactType. 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. @@ -19,6 +28,239 @@ func (ContactType) Values() []ContactType { type CountryCode string +// Enum values for CountryCode +const ( + CountryCodeAd CountryCode = "AD" + CountryCodeAe CountryCode = "AE" + CountryCodeAf CountryCode = "AF" + CountryCodeAg CountryCode = "AG" + CountryCodeAi CountryCode = "AI" + CountryCodeAl CountryCode = "AL" + CountryCodeAm CountryCode = "AM" + CountryCodeAn CountryCode = "AN" + CountryCodeAo CountryCode = "AO" + CountryCodeAq CountryCode = "AQ" + CountryCodeAr CountryCode = "AR" + CountryCodeAs CountryCode = "AS" + CountryCodeAt CountryCode = "AT" + CountryCodeAu CountryCode = "AU" + CountryCodeAw CountryCode = "AW" + CountryCodeAz CountryCode = "AZ" + CountryCodeBa CountryCode = "BA" + CountryCodeBb CountryCode = "BB" + CountryCodeBd CountryCode = "BD" + CountryCodeBe CountryCode = "BE" + CountryCodeBf CountryCode = "BF" + CountryCodeBg CountryCode = "BG" + CountryCodeBh CountryCode = "BH" + CountryCodeBi CountryCode = "BI" + CountryCodeBj CountryCode = "BJ" + CountryCodeBl CountryCode = "BL" + CountryCodeBm CountryCode = "BM" + CountryCodeBn CountryCode = "BN" + CountryCodeBo CountryCode = "BO" + CountryCodeBr CountryCode = "BR" + CountryCodeBs CountryCode = "BS" + CountryCodeBt CountryCode = "BT" + CountryCodeBw CountryCode = "BW" + CountryCodeBy CountryCode = "BY" + CountryCodeBz CountryCode = "BZ" + CountryCodeCa CountryCode = "CA" + CountryCodeCc CountryCode = "CC" + CountryCodeCd CountryCode = "CD" + CountryCodeCf CountryCode = "CF" + CountryCodeCg CountryCode = "CG" + CountryCodeCh CountryCode = "CH" + CountryCodeCi CountryCode = "CI" + CountryCodeCk CountryCode = "CK" + CountryCodeCl CountryCode = "CL" + CountryCodeCm CountryCode = "CM" + CountryCodeCn CountryCode = "CN" + CountryCodeCo CountryCode = "CO" + CountryCodeCr CountryCode = "CR" + CountryCodeCu CountryCode = "CU" + CountryCodeCv CountryCode = "CV" + CountryCodeCx CountryCode = "CX" + CountryCodeCy CountryCode = "CY" + CountryCodeCz CountryCode = "CZ" + CountryCodeDe CountryCode = "DE" + CountryCodeDj CountryCode = "DJ" + CountryCodeDk CountryCode = "DK" + CountryCodeDm CountryCode = "DM" + CountryCodeDo CountryCode = "DO" + CountryCodeDz CountryCode = "DZ" + CountryCodeEc CountryCode = "EC" + CountryCodeEe CountryCode = "EE" + CountryCodeEg CountryCode = "EG" + CountryCodeEr CountryCode = "ER" + CountryCodeEs CountryCode = "ES" + CountryCodeEt CountryCode = "ET" + CountryCodeFi CountryCode = "FI" + CountryCodeFj CountryCode = "FJ" + CountryCodeFk CountryCode = "FK" + CountryCodeFm CountryCode = "FM" + CountryCodeFo CountryCode = "FO" + CountryCodeFr CountryCode = "FR" + CountryCodeGa CountryCode = "GA" + CountryCodeGb CountryCode = "GB" + CountryCodeGd CountryCode = "GD" + CountryCodeGe CountryCode = "GE" + CountryCodeGh CountryCode = "GH" + CountryCodeGi CountryCode = "GI" + CountryCodeGl CountryCode = "GL" + CountryCodeGm CountryCode = "GM" + CountryCodeGn CountryCode = "GN" + CountryCodeGq CountryCode = "GQ" + CountryCodeGr CountryCode = "GR" + CountryCodeGt CountryCode = "GT" + CountryCodeGu CountryCode = "GU" + CountryCodeGw CountryCode = "GW" + CountryCodeGy CountryCode = "GY" + CountryCodeHk CountryCode = "HK" + CountryCodeHn CountryCode = "HN" + CountryCodeHr CountryCode = "HR" + CountryCodeHt CountryCode = "HT" + CountryCodeHu CountryCode = "HU" + CountryCodeId CountryCode = "ID" + CountryCodeIe CountryCode = "IE" + CountryCodeIl CountryCode = "IL" + CountryCodeIm CountryCode = "IM" + CountryCodeIn CountryCode = "IN" + CountryCodeIq CountryCode = "IQ" + CountryCodeIr CountryCode = "IR" + CountryCodeIs CountryCode = "IS" + CountryCodeIt CountryCode = "IT" + CountryCodeJm CountryCode = "JM" + CountryCodeJo CountryCode = "JO" + CountryCodeJp CountryCode = "JP" + CountryCodeKe CountryCode = "KE" + CountryCodeKg CountryCode = "KG" + CountryCodeKh CountryCode = "KH" + CountryCodeKi CountryCode = "KI" + CountryCodeKm CountryCode = "KM" + CountryCodeKn CountryCode = "KN" + CountryCodeKp CountryCode = "KP" + CountryCodeKr CountryCode = "KR" + CountryCodeKw CountryCode = "KW" + CountryCodeKy CountryCode = "KY" + CountryCodeKz CountryCode = "KZ" + CountryCodeLa CountryCode = "LA" + CountryCodeLb CountryCode = "LB" + CountryCodeLc CountryCode = "LC" + CountryCodeLi CountryCode = "LI" + CountryCodeLk CountryCode = "LK" + CountryCodeLr CountryCode = "LR" + CountryCodeLs CountryCode = "LS" + CountryCodeLt CountryCode = "LT" + CountryCodeLu CountryCode = "LU" + CountryCodeLv CountryCode = "LV" + CountryCodeLy CountryCode = "LY" + CountryCodeMa CountryCode = "MA" + CountryCodeMc CountryCode = "MC" + CountryCodeMd CountryCode = "MD" + CountryCodeMe CountryCode = "ME" + CountryCodeMf CountryCode = "MF" + CountryCodeMg CountryCode = "MG" + CountryCodeMh CountryCode = "MH" + CountryCodeMk CountryCode = "MK" + CountryCodeMl CountryCode = "ML" + CountryCodeMm CountryCode = "MM" + CountryCodeMn CountryCode = "MN" + CountryCodeMo CountryCode = "MO" + CountryCodeMp CountryCode = "MP" + CountryCodeMr CountryCode = "MR" + CountryCodeMs CountryCode = "MS" + CountryCodeMt CountryCode = "MT" + CountryCodeMu CountryCode = "MU" + CountryCodeMv CountryCode = "MV" + CountryCodeMw CountryCode = "MW" + CountryCodeMx CountryCode = "MX" + CountryCodeMy CountryCode = "MY" + CountryCodeMz CountryCode = "MZ" + CountryCodeNa CountryCode = "NA" + CountryCodeNc CountryCode = "NC" + CountryCodeNe CountryCode = "NE" + CountryCodeNg CountryCode = "NG" + CountryCodeNi CountryCode = "NI" + CountryCodeNl CountryCode = "NL" + CountryCodeNo CountryCode = "NO" + CountryCodeNp CountryCode = "NP" + CountryCodeNr CountryCode = "NR" + CountryCodeNu CountryCode = "NU" + CountryCodeNz CountryCode = "NZ" + CountryCodeOm CountryCode = "OM" + CountryCodePa CountryCode = "PA" + CountryCodePe CountryCode = "PE" + CountryCodePf CountryCode = "PF" + CountryCodePg CountryCode = "PG" + CountryCodePh CountryCode = "PH" + CountryCodePk CountryCode = "PK" + CountryCodePl CountryCode = "PL" + CountryCodePm CountryCode = "PM" + CountryCodePn CountryCode = "PN" + CountryCodePr CountryCode = "PR" + CountryCodePt CountryCode = "PT" + CountryCodePw CountryCode = "PW" + CountryCodePy CountryCode = "PY" + CountryCodeQa CountryCode = "QA" + CountryCodeRo CountryCode = "RO" + CountryCodeRs CountryCode = "RS" + CountryCodeRu CountryCode = "RU" + CountryCodeRw CountryCode = "RW" + CountryCodeSa CountryCode = "SA" + CountryCodeSb CountryCode = "SB" + CountryCodeSc CountryCode = "SC" + CountryCodeSd CountryCode = "SD" + CountryCodeSe CountryCode = "SE" + CountryCodeSg CountryCode = "SG" + CountryCodeSh CountryCode = "SH" + CountryCodeSi CountryCode = "SI" + CountryCodeSk CountryCode = "SK" + CountryCodeSl CountryCode = "SL" + CountryCodeSm CountryCode = "SM" + CountryCodeSn CountryCode = "SN" + CountryCodeSo CountryCode = "SO" + CountryCodeSr CountryCode = "SR" + CountryCodeSt CountryCode = "ST" + CountryCodeSv CountryCode = "SV" + CountryCodeSy CountryCode = "SY" + CountryCodeSz CountryCode = "SZ" + CountryCodeTc CountryCode = "TC" + CountryCodeTd CountryCode = "TD" + CountryCodeTg CountryCode = "TG" + CountryCodeTh CountryCode = "TH" + CountryCodeTj CountryCode = "TJ" + CountryCodeTk CountryCode = "TK" + CountryCodeTl CountryCode = "TL" + CountryCodeTm CountryCode = "TM" + CountryCodeTn CountryCode = "TN" + CountryCodeTo CountryCode = "TO" + CountryCodeTr CountryCode = "TR" + CountryCodeTt CountryCode = "TT" + CountryCodeTv CountryCode = "TV" + CountryCodeTw CountryCode = "TW" + CountryCodeTz CountryCode = "TZ" + CountryCodeUa CountryCode = "UA" + CountryCodeUg CountryCode = "UG" + CountryCodeUs CountryCode = "US" + CountryCodeUy CountryCode = "UY" + CountryCodeUz CountryCode = "UZ" + CountryCodeVa CountryCode = "VA" + CountryCodeVc CountryCode = "VC" + CountryCodeVe CountryCode = "VE" + CountryCodeVg CountryCode = "VG" + CountryCodeVi CountryCode = "VI" + CountryCodeVn CountryCode = "VN" + CountryCodeVu CountryCode = "VU" + CountryCodeWf CountryCode = "WF" + CountryCodeWs CountryCode = "WS" + CountryCodeYe CountryCode = "YE" + CountryCodeYt CountryCode = "YT" + CountryCodeZa CountryCode = "ZA" + CountryCodeZm CountryCode = "ZM" + CountryCodeZw CountryCode = "ZW" +) + // Values returns all known values for CountryCode. 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. @@ -258,6 +500,18 @@ func (CountryCode) Values() []CountryCode { type DomainAvailability string +// Enum values for DomainAvailability +const ( + DomainAvailabilityAvailable DomainAvailability = "AVAILABLE" + DomainAvailabilityAvailableReserved DomainAvailability = "AVAILABLE_RESERVED" + DomainAvailabilityAvailablePreorder DomainAvailability = "AVAILABLE_PREORDER" + DomainAvailabilityUnavailable DomainAvailability = "UNAVAILABLE" + DomainAvailabilityUnavailablePremium DomainAvailability = "UNAVAILABLE_PREMIUM" + DomainAvailabilityUnavailableRestricted DomainAvailability = "UNAVAILABLE_RESTRICTED" + DomainAvailabilityReserved DomainAvailability = "RESERVED" + DomainAvailabilityDontKnow DomainAvailability = "DONT_KNOW" +) + // Values returns all known values for DomainAvailability. 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. @@ -348,6 +602,15 @@ func (ExtraParamName) Values() []ExtraParamName { type OperationStatus string +// Enum values for OperationStatus +const ( + OperationStatusSubmitted OperationStatus = "SUBMITTED" + OperationStatusInProgress OperationStatus = "IN_PROGRESS" + OperationStatusError OperationStatus = "ERROR" + OperationStatusSuccessful OperationStatus = "SUCCESSFUL" + OperationStatusFailed OperationStatus = "FAILED" +) + // Values returns all known values for OperationStatus. 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. diff --git a/service/s3/serializers.go b/service/s3/serializers.go index bd67c23f347..0544acc1994 100644 --- a/service/s3/serializers.go +++ b/service/s3/serializers.go @@ -3556,7 +3556,7 @@ func awsRestxml_serializeOpHttpBindingsGetObjectInput(v *GetObjectInput, encoder } if v.ResponseExpires != nil { - encoder.SetQuery("response-expires").String(smithytime.FormatDateTime(*v.ResponseExpires)) + encoder.SetQuery("response-expires").String(smithytime.FormatHTTPDate(*v.ResponseExpires)) } if v.SSECustomerAlgorithm != nil && len(*v.SSECustomerAlgorithm) > 0 { diff --git a/service/s3/types/enums.go b/service/s3/types/enums.go index 08474590815..e27d8d45a01 100644 --- a/service/s3/types/enums.go +++ b/service/s3/types/enums.go @@ -4,6 +4,11 @@ package types type AnalyticsS3ExportFileFormat string +// Enum values for AnalyticsS3ExportFileFormat +const ( + AnalyticsS3ExportFileFormatCsv AnalyticsS3ExportFileFormat = "CSV" +) + // Values returns all known values for AnalyticsS3ExportFileFormat. 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. @@ -15,6 +20,12 @@ func (AnalyticsS3ExportFileFormat) Values() []AnalyticsS3ExportFileFormat { type ArchiveStatus string +// Enum values for ArchiveStatus +const ( + ArchiveStatusArchiveAccess ArchiveStatus = "ARCHIVE_ACCESS" + ArchiveStatusDeepArchiveAccess ArchiveStatus = "DEEP_ARCHIVE_ACCESS" +) + // Values returns all known values for ArchiveStatus. 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. @@ -27,6 +38,12 @@ func (ArchiveStatus) Values() []ArchiveStatus { type BucketAccelerateStatus string +// Enum values for BucketAccelerateStatus +const ( + BucketAccelerateStatusEnabled BucketAccelerateStatus = "Enabled" + BucketAccelerateStatusSuspended BucketAccelerateStatus = "Suspended" +) + // Values returns all known values for BucketAccelerateStatus. 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. @@ -39,6 +56,14 @@ func (BucketAccelerateStatus) Values() []BucketAccelerateStatus { type BucketCannedACL string +// Enum values for BucketCannedACL +const ( + BucketCannedACLPrivate BucketCannedACL = "private" + BucketCannedACLPublicRead BucketCannedACL = "public-read" + BucketCannedACLPublicReadWrite BucketCannedACL = "public-read-write" + BucketCannedACLAuthenticatedRead BucketCannedACL = "authenticated-read" +) + // Values returns all known values for BucketCannedACL. 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. @@ -53,6 +78,35 @@ func (BucketCannedACL) Values() []BucketCannedACL { type BucketLocationConstraint string +// Enum values for BucketLocationConstraint +const ( + BucketLocationConstraintAfSouth1 BucketLocationConstraint = "af-south-1" + BucketLocationConstraintApEast1 BucketLocationConstraint = "ap-east-1" + BucketLocationConstraintApNortheast1 BucketLocationConstraint = "ap-northeast-1" + BucketLocationConstraintApNortheast2 BucketLocationConstraint = "ap-northeast-2" + BucketLocationConstraintApNortheast3 BucketLocationConstraint = "ap-northeast-3" + BucketLocationConstraintApSouth1 BucketLocationConstraint = "ap-south-1" + BucketLocationConstraintApSoutheast1 BucketLocationConstraint = "ap-southeast-1" + BucketLocationConstraintApSoutheast2 BucketLocationConstraint = "ap-southeast-2" + BucketLocationConstraintCaCentral1 BucketLocationConstraint = "ca-central-1" + BucketLocationConstraintCnNorth1 BucketLocationConstraint = "cn-north-1" + BucketLocationConstraintCnNorthwest1 BucketLocationConstraint = "cn-northwest-1" + BucketLocationConstraintEu BucketLocationConstraint = "EU" + BucketLocationConstraintEuCentral1 BucketLocationConstraint = "eu-central-1" + BucketLocationConstraintEuNorth1 BucketLocationConstraint = "eu-north-1" + BucketLocationConstraintEuSouth1 BucketLocationConstraint = "eu-south-1" + BucketLocationConstraintEuWest1 BucketLocationConstraint = "eu-west-1" + BucketLocationConstraintEuWest2 BucketLocationConstraint = "eu-west-2" + BucketLocationConstraintEuWest3 BucketLocationConstraint = "eu-west-3" + BucketLocationConstraintMeSouth1 BucketLocationConstraint = "me-south-1" + BucketLocationConstraintSaEast1 BucketLocationConstraint = "sa-east-1" + BucketLocationConstraintUsEast2 BucketLocationConstraint = "us-east-2" + BucketLocationConstraintUsGovEast1 BucketLocationConstraint = "us-gov-east-1" + BucketLocationConstraintUsGovWest1 BucketLocationConstraint = "us-gov-west-1" + BucketLocationConstraintUsWest1 BucketLocationConstraint = "us-west-1" + BucketLocationConstraintUsWest2 BucketLocationConstraint = "us-west-2" +) + // Values returns all known values for BucketLocationConstraint. 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. @@ -88,6 +142,13 @@ func (BucketLocationConstraint) Values() []BucketLocationConstraint { type BucketLogsPermission string +// Enum values for BucketLogsPermission +const ( + BucketLogsPermissionFullControl BucketLogsPermission = "FULL_CONTROL" + BucketLogsPermissionRead BucketLogsPermission = "READ" + BucketLogsPermissionWrite BucketLogsPermission = "WRITE" +) + // Values returns all known values for BucketLogsPermission. 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. @@ -101,6 +162,12 @@ func (BucketLogsPermission) Values() []BucketLogsPermission { type BucketVersioningStatus string +// Enum values for BucketVersioningStatus +const ( + BucketVersioningStatusEnabled BucketVersioningStatus = "Enabled" + BucketVersioningStatusSuspended BucketVersioningStatus = "Suspended" +) + // Values returns all known values for BucketVersioningStatus. 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. @@ -113,6 +180,13 @@ func (BucketVersioningStatus) Values() []BucketVersioningStatus { type CompressionType string +// Enum values for CompressionType +const ( + CompressionTypeNone CompressionType = "NONE" + CompressionTypeGzip CompressionType = "GZIP" + CompressionTypeBzip2 CompressionType = "BZIP2" +) + // Values returns all known values for CompressionType. 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. @@ -126,6 +200,12 @@ func (CompressionType) Values() []CompressionType { type DeleteMarkerReplicationStatus string +// Enum values for DeleteMarkerReplicationStatus +const ( + DeleteMarkerReplicationStatusEnabled DeleteMarkerReplicationStatus = "Enabled" + DeleteMarkerReplicationStatusDisabled DeleteMarkerReplicationStatus = "Disabled" +) + // Values returns all known values for DeleteMarkerReplicationStatus. 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 @@ -139,6 +219,11 @@ func (DeleteMarkerReplicationStatus) Values() []DeleteMarkerReplicationStatus { type EncodingType string +// Enum values for EncodingType +const ( + EncodingTypeUrl EncodingType = "url" +) + // Values returns all known values for EncodingType. 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. @@ -177,6 +262,12 @@ func (Event) Values() []Event { type ExistingObjectReplicationStatus string +// Enum values for ExistingObjectReplicationStatus +const ( + ExistingObjectReplicationStatusEnabled ExistingObjectReplicationStatus = "Enabled" + ExistingObjectReplicationStatusDisabled ExistingObjectReplicationStatus = "Disabled" +) + // Values returns all known values for ExistingObjectReplicationStatus. 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 @@ -190,6 +281,12 @@ func (ExistingObjectReplicationStatus) Values() []ExistingObjectReplicationStatu type ExpirationStatus string +// Enum values for ExpirationStatus +const ( + ExpirationStatusEnabled ExpirationStatus = "Enabled" + ExpirationStatusDisabled ExpirationStatus = "Disabled" +) + // Values returns all known values for ExpirationStatus. 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. @@ -202,6 +299,11 @@ func (ExpirationStatus) Values() []ExpirationStatus { type ExpressionType string +// Enum values for ExpressionType +const ( + ExpressionTypeSql ExpressionType = "SQL" +) + // Values returns all known values for ExpressionType. 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. @@ -233,6 +335,12 @@ func (FileHeaderInfo) Values() []FileHeaderInfo { type FilterRuleName string +// Enum values for FilterRuleName +const ( + FilterRuleNamePrefix FilterRuleName = "prefix" + FilterRuleNameSuffix FilterRuleName = "suffix" +) + // Values returns all known values for FilterRuleName. 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. @@ -245,6 +353,12 @@ func (FilterRuleName) Values() []FilterRuleName { type IntelligentTieringAccessTier string +// Enum values for IntelligentTieringAccessTier +const ( + IntelligentTieringAccessTierArchiveAccess IntelligentTieringAccessTier = "ARCHIVE_ACCESS" + IntelligentTieringAccessTierDeepArchiveAccess IntelligentTieringAccessTier = "DEEP_ARCHIVE_ACCESS" +) + // Values returns all known values for IntelligentTieringAccessTier. 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. @@ -257,6 +371,12 @@ func (IntelligentTieringAccessTier) Values() []IntelligentTieringAccessTier { type IntelligentTieringStatus string +// Enum values for IntelligentTieringStatus +const ( + IntelligentTieringStatusEnabled IntelligentTieringStatus = "Enabled" + IntelligentTieringStatusDisabled IntelligentTieringStatus = "Disabled" +) + // Values returns all known values for IntelligentTieringStatus. 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. @@ -269,6 +389,13 @@ func (IntelligentTieringStatus) Values() []IntelligentTieringStatus { type InventoryFormat string +// Enum values for InventoryFormat +const ( + InventoryFormatCsv InventoryFormat = "CSV" + InventoryFormatOrc InventoryFormat = "ORC" + InventoryFormatParquet InventoryFormat = "Parquet" +) + // Values returns all known values for InventoryFormat. 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. @@ -282,6 +409,12 @@ func (InventoryFormat) Values() []InventoryFormat { type InventoryFrequency string +// Enum values for InventoryFrequency +const ( + InventoryFrequencyDaily InventoryFrequency = "Daily" + InventoryFrequencyWeekly InventoryFrequency = "Weekly" +) + // Values returns all known values for InventoryFrequency. 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. @@ -294,6 +427,12 @@ func (InventoryFrequency) Values() []InventoryFrequency { type InventoryIncludedObjectVersions string +// Enum values for InventoryIncludedObjectVersions +const ( + InventoryIncludedObjectVersionsAll InventoryIncludedObjectVersions = "All" + InventoryIncludedObjectVersionsCurrent InventoryIncludedObjectVersions = "Current" +) + // Values returns all known values for InventoryIncludedObjectVersions. 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 @@ -307,6 +446,21 @@ func (InventoryIncludedObjectVersions) Values() []InventoryIncludedObjectVersion type InventoryOptionalField string +// Enum values for InventoryOptionalField +const ( + InventoryOptionalFieldSize InventoryOptionalField = "Size" + InventoryOptionalFieldLastmodifieddate InventoryOptionalField = "LastModifiedDate" + InventoryOptionalFieldStorageclass InventoryOptionalField = "StorageClass" + InventoryOptionalFieldEtag InventoryOptionalField = "ETag" + InventoryOptionalFieldIsmultipartuploaded InventoryOptionalField = "IsMultipartUploaded" + InventoryOptionalFieldReplicationstatus InventoryOptionalField = "ReplicationStatus" + InventoryOptionalFieldEncryptionstatus InventoryOptionalField = "EncryptionStatus" + InventoryOptionalFieldObjectlockretainuntildate InventoryOptionalField = "ObjectLockRetainUntilDate" + InventoryOptionalFieldObjectlockmode InventoryOptionalField = "ObjectLockMode" + InventoryOptionalFieldObjectlocklegalholdstatus InventoryOptionalField = "ObjectLockLegalHoldStatus" + InventoryOptionalFieldIntelligenttieringaccesstier InventoryOptionalField = "IntelligentTieringAccessTier" +) + // Values returns all known values for InventoryOptionalField. 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. @@ -346,6 +500,12 @@ func (JSONType) Values() []JSONType { type MetadataDirective string +// Enum values for MetadataDirective +const ( + MetadataDirectiveCopy MetadataDirective = "COPY" + MetadataDirectiveReplace MetadataDirective = "REPLACE" +) + // Values returns all known values for MetadataDirective. 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. @@ -358,6 +518,12 @@ func (MetadataDirective) Values() []MetadataDirective { type MetricsStatus string +// Enum values for MetricsStatus +const ( + MetricsStatusEnabled MetricsStatus = "Enabled" + MetricsStatusDisabled MetricsStatus = "Disabled" +) + // Values returns all known values for MetricsStatus. 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. @@ -370,6 +536,12 @@ func (MetricsStatus) Values() []MetricsStatus { type MFADelete string +// Enum values for MFADelete +const ( + MFADeleteEnabled MFADelete = "Enabled" + MFADeleteDisabled MFADelete = "Disabled" +) + // Values returns all known values for MFADelete. 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. @@ -382,6 +554,12 @@ func (MFADelete) Values() []MFADelete { type MFADeleteStatus string +// Enum values for MFADeleteStatus +const ( + MFADeleteStatusEnabled MFADeleteStatus = "Enabled" + MFADeleteStatusDisabled MFADeleteStatus = "Disabled" +) + // Values returns all known values for MFADeleteStatus. 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. @@ -394,6 +572,17 @@ func (MFADeleteStatus) Values() []MFADeleteStatus { type ObjectCannedACL string +// Enum values for ObjectCannedACL +const ( + ObjectCannedACLPrivate ObjectCannedACL = "private" + ObjectCannedACLPublicRead ObjectCannedACL = "public-read" + ObjectCannedACLPublicReadWrite ObjectCannedACL = "public-read-write" + ObjectCannedACLAuthenticatedRead ObjectCannedACL = "authenticated-read" + ObjectCannedACLAwsExecRead ObjectCannedACL = "aws-exec-read" + ObjectCannedACLBucketOwnerRead ObjectCannedACL = "bucket-owner-read" + ObjectCannedACLBucketOwnerFullControl ObjectCannedACL = "bucket-owner-full-control" +) + // Values returns all known values for ObjectCannedACL. 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. @@ -411,6 +600,11 @@ func (ObjectCannedACL) Values() []ObjectCannedACL { type ObjectLockEnabled string +// Enum values for ObjectLockEnabled +const ( + ObjectLockEnabledEnabled ObjectLockEnabled = "Enabled" +) + // Values returns all known values for ObjectLockEnabled. 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. @@ -422,6 +616,12 @@ func (ObjectLockEnabled) Values() []ObjectLockEnabled { type ObjectLockLegalHoldStatus string +// Enum values for ObjectLockLegalHoldStatus +const ( + ObjectLockLegalHoldStatusOn ObjectLockLegalHoldStatus = "ON" + ObjectLockLegalHoldStatusOff ObjectLockLegalHoldStatus = "OFF" +) + // Values returns all known values for ObjectLockLegalHoldStatus. 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. @@ -434,6 +634,12 @@ func (ObjectLockLegalHoldStatus) Values() []ObjectLockLegalHoldStatus { type ObjectLockMode string +// Enum values for ObjectLockMode +const ( + ObjectLockModeGovernance ObjectLockMode = "GOVERNANCE" + ObjectLockModeCompliance ObjectLockMode = "COMPLIANCE" +) + // Values returns all known values for ObjectLockMode. 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. @@ -446,6 +652,12 @@ func (ObjectLockMode) Values() []ObjectLockMode { type ObjectLockRetentionMode string +// Enum values for ObjectLockRetentionMode +const ( + ObjectLockRetentionModeGovernance ObjectLockRetentionMode = "GOVERNANCE" + ObjectLockRetentionModeCompliance ObjectLockRetentionMode = "COMPLIANCE" +) + // Values returns all known values for ObjectLockRetentionMode. 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. @@ -458,6 +670,12 @@ func (ObjectLockRetentionMode) Values() []ObjectLockRetentionMode { type ObjectOwnership string +// Enum values for ObjectOwnership +const ( + ObjectOwnershipBucketownerpreferred ObjectOwnership = "BucketOwnerPreferred" + ObjectOwnershipObjectwriter ObjectOwnership = "ObjectWriter" +) + // Values returns all known values for ObjectOwnership. 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. @@ -470,6 +688,18 @@ func (ObjectOwnership) Values() []ObjectOwnership { type ObjectStorageClass string +// Enum values for ObjectStorageClass +const ( + ObjectStorageClassStandard ObjectStorageClass = "STANDARD" + ObjectStorageClassReducedRedundancy ObjectStorageClass = "REDUCED_REDUNDANCY" + ObjectStorageClassGlacier ObjectStorageClass = "GLACIER" + ObjectStorageClassStandardIa ObjectStorageClass = "STANDARD_IA" + ObjectStorageClassOnezoneIa ObjectStorageClass = "ONEZONE_IA" + ObjectStorageClassIntelligentTiering ObjectStorageClass = "INTELLIGENT_TIERING" + ObjectStorageClassDeepArchive ObjectStorageClass = "DEEP_ARCHIVE" + ObjectStorageClassOutposts ObjectStorageClass = "OUTPOSTS" +) + // Values returns all known values for ObjectStorageClass. 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. @@ -488,6 +718,11 @@ func (ObjectStorageClass) Values() []ObjectStorageClass { type ObjectVersionStorageClass string +// Enum values for ObjectVersionStorageClass +const ( + ObjectVersionStorageClassStandard ObjectVersionStorageClass = "STANDARD" +) + // Values returns all known values for ObjectVersionStorageClass. 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. @@ -499,6 +734,11 @@ func (ObjectVersionStorageClass) Values() []ObjectVersionStorageClass { type OwnerOverride string +// Enum values for OwnerOverride +const ( + OwnerOverrideDestination OwnerOverride = "Destination" +) + // Values returns all known values for OwnerOverride. 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. @@ -510,6 +750,12 @@ func (OwnerOverride) Values() []OwnerOverride { type Payer string +// Enum values for Payer +const ( + PayerRequester Payer = "Requester" + PayerBucketowner Payer = "BucketOwner" +) + // Values returns all known values for Payer. 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. @@ -522,6 +768,15 @@ func (Payer) Values() []Payer { type Permission string +// Enum values for Permission +const ( + PermissionFullControl Permission = "FULL_CONTROL" + PermissionWrite Permission = "WRITE" + PermissionWriteAcp Permission = "WRITE_ACP" + PermissionRead Permission = "READ" + PermissionReadAcp Permission = "READ_ACP" +) + // Values returns all known values for Permission. 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. @@ -537,6 +792,12 @@ func (Permission) Values() []Permission { type Protocol string +// Enum values for Protocol +const ( + ProtocolHttp Protocol = "http" + ProtocolHttps Protocol = "https" +) + // Values returns all known values for Protocol. Note that this can be expanded in // the future, and so it is only as up to date as the client. The ordering of this // slice is not guaranteed to be stable across updates. @@ -567,6 +828,12 @@ func (QuoteFields) Values() []QuoteFields { type ReplicaModificationsStatus string +// Enum values for ReplicaModificationsStatus +const ( + ReplicaModificationsStatusEnabled ReplicaModificationsStatus = "Enabled" + ReplicaModificationsStatusDisabled ReplicaModificationsStatus = "Disabled" +) + // Values returns all known values for ReplicaModificationsStatus. 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. @@ -579,6 +846,12 @@ func (ReplicaModificationsStatus) Values() []ReplicaModificationsStatus { type ReplicationRuleStatus string +// Enum values for ReplicationRuleStatus +const ( + ReplicationRuleStatusEnabled ReplicationRuleStatus = "Enabled" + ReplicationRuleStatusDisabled ReplicationRuleStatus = "Disabled" +) + // Values returns all known values for ReplicationRuleStatus. 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. @@ -591,6 +864,14 @@ func (ReplicationRuleStatus) Values() []ReplicationRuleStatus { type ReplicationStatus string +// Enum values for ReplicationStatus +const ( + ReplicationStatusComplete ReplicationStatus = "COMPLETE" + ReplicationStatusPending ReplicationStatus = "PENDING" + ReplicationStatusFailed ReplicationStatus = "FAILED" + ReplicationStatusReplica ReplicationStatus = "REPLICA" +) + // Values returns all known values for ReplicationStatus. 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. @@ -605,6 +886,12 @@ func (ReplicationStatus) Values() []ReplicationStatus { type ReplicationTimeStatus string +// Enum values for ReplicationTimeStatus +const ( + ReplicationTimeStatusEnabled ReplicationTimeStatus = "Enabled" + ReplicationTimeStatusDisabled ReplicationTimeStatus = "Disabled" +) + // Values returns all known values for ReplicationTimeStatus. 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. @@ -617,6 +904,11 @@ func (ReplicationTimeStatus) Values() []ReplicationTimeStatus { type RequestCharged string +// Enum values for RequestCharged +const ( + RequestChargedRequester RequestCharged = "requester" +) + // Values returns all known values for RequestCharged. 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. @@ -628,6 +920,11 @@ func (RequestCharged) Values() []RequestCharged { type RequestPayer string +// Enum values for RequestPayer +const ( + RequestPayerRequester RequestPayer = "requester" +) + // Values returns all known values for RequestPayer. 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. @@ -655,6 +952,12 @@ func (RestoreRequestType) Values() []RestoreRequestType { type ServerSideEncryption string +// Enum values for ServerSideEncryption +const ( + ServerSideEncryptionAes256 ServerSideEncryption = "AES256" + ServerSideEncryptionAwsKms ServerSideEncryption = "aws:kms" +) + // Values returns all known values for ServerSideEncryption. 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. @@ -667,6 +970,12 @@ func (ServerSideEncryption) Values() []ServerSideEncryption { type SseKmsEncryptedObjectsStatus string +// Enum values for SseKmsEncryptedObjectsStatus +const ( + SseKmsEncryptedObjectsStatusEnabled SseKmsEncryptedObjectsStatus = "Enabled" + SseKmsEncryptedObjectsStatusDisabled SseKmsEncryptedObjectsStatus = "Disabled" +) + // Values returns all known values for SseKmsEncryptedObjectsStatus. 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. @@ -679,6 +988,18 @@ func (SseKmsEncryptedObjectsStatus) Values() []SseKmsEncryptedObjectsStatus { type StorageClass string +// Enum values for StorageClass +const ( + StorageClassStandard StorageClass = "STANDARD" + StorageClassReducedRedundancy StorageClass = "REDUCED_REDUNDANCY" + StorageClassStandardIa StorageClass = "STANDARD_IA" + StorageClassOnezoneIa StorageClass = "ONEZONE_IA" + StorageClassIntelligentTiering StorageClass = "INTELLIGENT_TIERING" + StorageClassGlacier StorageClass = "GLACIER" + StorageClassDeepArchive StorageClass = "DEEP_ARCHIVE" + StorageClassOutposts StorageClass = "OUTPOSTS" +) + // Values returns all known values for StorageClass. 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. @@ -697,6 +1018,11 @@ func (StorageClass) Values() []StorageClass { type StorageClassAnalysisSchemaVersion string +// Enum values for StorageClassAnalysisSchemaVersion +const ( + StorageClassAnalysisSchemaVersionV1 StorageClassAnalysisSchemaVersion = "V_1" +) + // Values returns all known values for StorageClassAnalysisSchemaVersion. 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 @@ -709,6 +1035,12 @@ func (StorageClassAnalysisSchemaVersion) Values() []StorageClassAnalysisSchemaVe type TaggingDirective string +// Enum values for TaggingDirective +const ( + TaggingDirectiveCopy TaggingDirective = "COPY" + TaggingDirectiveReplace TaggingDirective = "REPLACE" +) + // Values returns all known values for TaggingDirective. 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. @@ -721,6 +1053,13 @@ func (TaggingDirective) Values() []TaggingDirective { type Tier string +// Enum values for Tier +const ( + TierStandard Tier = "Standard" + TierBulk Tier = "Bulk" + TierExpedited Tier = "Expedited" +) + // Values returns all known values for Tier. 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. @@ -734,6 +1073,15 @@ func (Tier) Values() []Tier { type TransitionStorageClass string +// Enum values for TransitionStorageClass +const ( + TransitionStorageClassGlacier TransitionStorageClass = "GLACIER" + TransitionStorageClassStandardIa TransitionStorageClass = "STANDARD_IA" + TransitionStorageClassOnezoneIa TransitionStorageClass = "ONEZONE_IA" + TransitionStorageClassIntelligentTiering TransitionStorageClass = "INTELLIGENT_TIERING" + TransitionStorageClassDeepArchive TransitionStorageClass = "DEEP_ARCHIVE" +) + // Values returns all known values for TransitionStorageClass. 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. @@ -749,6 +1097,13 @@ func (TransitionStorageClass) Values() []TransitionStorageClass { type Type string +// Enum values for Type +const ( + TypeCanonicaluser Type = "CanonicalUser" + TypeAmazoncustomerbyemail Type = "AmazonCustomerByEmail" + TypeGroup Type = "Group" +) + // Values returns all known values for Type. 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. diff --git a/service/s3control/types/enums.go b/service/s3control/types/enums.go index d3506168087..088a0ca7b0c 100644 --- a/service/s3control/types/enums.go +++ b/service/s3control/types/enums.go @@ -4,6 +4,14 @@ package types type BucketCannedACL string +// Enum values for BucketCannedACL +const ( + BucketCannedACLPrivate BucketCannedACL = "private" + BucketCannedACLPublicRead BucketCannedACL = "public-read" + BucketCannedACLPublicReadWrite BucketCannedACL = "public-read-write" + BucketCannedACLAuthenticatedRead BucketCannedACL = "authenticated-read" +) + // Values returns all known values for BucketCannedACL. 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. @@ -18,6 +26,21 @@ func (BucketCannedACL) Values() []BucketCannedACL { type BucketLocationConstraint string +// Enum values for BucketLocationConstraint +const ( + BucketLocationConstraintEu BucketLocationConstraint = "EU" + BucketLocationConstraintEuWest1 BucketLocationConstraint = "eu-west-1" + BucketLocationConstraintUsWest1 BucketLocationConstraint = "us-west-1" + BucketLocationConstraintUsWest2 BucketLocationConstraint = "us-west-2" + BucketLocationConstraintApSouth1 BucketLocationConstraint = "ap-south-1" + BucketLocationConstraintApSoutheast1 BucketLocationConstraint = "ap-southeast-1" + BucketLocationConstraintApSoutheast2 BucketLocationConstraint = "ap-southeast-2" + BucketLocationConstraintApNortheast1 BucketLocationConstraint = "ap-northeast-1" + BucketLocationConstraintSaEast1 BucketLocationConstraint = "sa-east-1" + BucketLocationConstraintCnNorth1 BucketLocationConstraint = "cn-north-1" + BucketLocationConstraintEuCentral1 BucketLocationConstraint = "eu-central-1" +) + // Values returns all known values for BucketLocationConstraint. 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. @@ -39,6 +62,12 @@ func (BucketLocationConstraint) Values() []BucketLocationConstraint { type ExpirationStatus string +// Enum values for ExpirationStatus +const ( + ExpirationStatusEnabled ExpirationStatus = "Enabled" + ExpirationStatusDisabled ExpirationStatus = "Disabled" +) + // Values returns all known values for ExpirationStatus. 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. @@ -51,6 +80,12 @@ func (ExpirationStatus) Values() []ExpirationStatus { type Format string +// Enum values for Format +const ( + FormatCsv Format = "CSV" + FormatParquet Format = "Parquet" +) + // Values returns all known values for Format. 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. @@ -223,6 +258,11 @@ func (OperationName) Values() []OperationName { type OutputSchemaVersion string +// Enum values for OutputSchemaVersion +const ( + OutputSchemaVersionV1 OutputSchemaVersion = "V_1" +) + // Values returns all known values for OutputSchemaVersion. 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. @@ -458,6 +498,15 @@ func (S3StorageClass) Values() []S3StorageClass { type TransitionStorageClass string +// Enum values for TransitionStorageClass +const ( + TransitionStorageClassGlacier TransitionStorageClass = "GLACIER" + TransitionStorageClassStandardIa TransitionStorageClass = "STANDARD_IA" + TransitionStorageClassOnezoneIa TransitionStorageClass = "ONEZONE_IA" + TransitionStorageClassIntelligentTiering TransitionStorageClass = "INTELLIGENT_TIERING" + TransitionStorageClassDeepArchive TransitionStorageClass = "DEEP_ARCHIVE" +) + // Values returns all known values for TransitionStorageClass. 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. diff --git a/service/savingsplans/types/enums.go b/service/savingsplans/types/enums.go index cd1370fc4c3..a5b48393b87 100644 --- a/service/savingsplans/types/enums.go +++ b/service/savingsplans/types/enums.go @@ -4,6 +4,12 @@ package types type CurrencyCode string +// Enum values for CurrencyCode +const ( + CurrencyCodeCny CurrencyCode = "CNY" + CurrencyCodeUsd CurrencyCode = "USD" +) + // Values returns all known values for CurrencyCode. 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. diff --git a/service/secretsmanager/types/enums.go b/service/secretsmanager/types/enums.go index a42ef666429..8b957cfd2c1 100644 --- a/service/secretsmanager/types/enums.go +++ b/service/secretsmanager/types/enums.go @@ -4,6 +4,15 @@ package types type FilterNameStringType string +// Enum values for FilterNameStringType +const ( + FilterNameStringTypeDescription FilterNameStringType = "description" + FilterNameStringTypeName FilterNameStringType = "name" + FilterNameStringTypeTagKey FilterNameStringType = "tag-key" + FilterNameStringTypeTagValue FilterNameStringType = "tag-value" + FilterNameStringTypeAll FilterNameStringType = "all" +) + // Values returns all known values for FilterNameStringType. 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. diff --git a/service/securityhub/api_op_BatchImportFindings.go b/service/securityhub/api_op_BatchImportFindings.go index c82d55e8edf..5ffa0a22ca5 100644 --- a/service/securityhub/api_op_BatchImportFindings.go +++ b/service/securityhub/api_op_BatchImportFindings.go @@ -19,25 +19,30 @@ import ( // fields and objects, which Security Hub customers use to manage their // investigation workflow. // -// * Confidence +// * Note // -// * Criticality +// * UserDefinedFields // -// * Note +// * VerificationState // // * -// RelatedFindings +// Workflow // -// * Severity +// BatchImportFindings can be used to update the following finding fields +// and objects only if they have not been updated using BatchUpdateFindings. After +// they are updated using BatchUpdateFindings, these fields cannot be updated using +// BatchImportFindings. // -// * Types +// * Confidence // -// * UserDefinedFields +// * Criticality +// +// * RelatedFindings // // * -// VerificationState +// Severity // -// * Workflow +// * Types func (c *Client) BatchImportFindings(ctx context.Context, params *BatchImportFindingsInput, optFns ...func(*Options)) (*BatchImportFindingsOutput, error) { if params == nil { params = &BatchImportFindingsInput{} diff --git a/service/securityhub/types/types.go b/service/securityhub/types/types.go index cedb7aba193..1904e96c2c4 100644 --- a/service/securityhub/types/types.go +++ b/service/securityhub/types/types.go @@ -5218,12 +5218,11 @@ type Result struct { } // The severity of the finding. The finding provider can provide the initial -// severity, but cannot update it after that. The severity can only be updated by a -// master account. It cannot be updated by a member account. The finding must have -// either Label or Normalized populated. If only one of these attributes is -// populated, then Security Hub automatically populates the other one. If neither -// attribute is populated, then the finding is invalid. Label is the preferred -// attribute. +// severity. The finding provider can only update the severity if it has not been +// updated using BatchUpdateFindings. The finding must have either Label or +// Normalized populated. If only one of these attributes is populated, then +// Security Hub automatically populates the other one. If neither attribute is +// populated, then the finding is invalid. Label is the preferred attribute. type Severity struct { // The severity value of the finding. The allowed values are the following. diff --git a/service/servicecatalog/api_op_CreatePortfolioShare.go b/service/servicecatalog/api_op_CreatePortfolioShare.go index fa28b611036..0ac400df36f 100644 --- a/service/servicecatalog/api_op_CreatePortfolioShare.go +++ b/service/servicecatalog/api_op_CreatePortfolioShare.go @@ -17,8 +17,11 @@ import ( // organization, an organizational unit, or a specific account. Note that if a // delegated admin is de-registered, they can no longer create portfolio shares. // AWSOrganizationsAccess must be enabled in order to create a portfolio share to -// an organization node. You can't share a shared resource. This includes -// portfolios that contain a shared product. +// an organization node. You can't share a shared resource, including portfolios +// that contain a shared product. If the portfolio share with the specified account +// or organization node already exists, this action will have no effect and will +// not return an error. To update an existing share, you must use the +// UpdatePortfolioShare API instead. func (c *Client) CreatePortfolioShare(ctx context.Context, params *CreatePortfolioShareInput, optFns ...func(*Options)) (*CreatePortfolioShareOutput, error) { if params == nil { params = &CreatePortfolioShareInput{} @@ -59,6 +62,10 @@ type CreatePortfolioShareInput struct { // PortfolioShareToken will be returned in the output in order for the // administrator to monitor the status of the PortfolioShare creation process. OrganizationNode *types.OrganizationNode + + // Enables or disables TagOptions sharing when creating the portfolio share. If + // this flag is not provided, TagOptions sharing is disabled. + ShareTagOptions bool } type CreatePortfolioShareOutput struct { diff --git a/service/servicecatalog/api_op_CreateProduct.go b/service/servicecatalog/api_op_CreateProduct.go index 2b1f3ec2e93..ad1224f513f 100644 --- a/service/servicecatalog/api_op_CreateProduct.go +++ b/service/servicecatalog/api_op_CreateProduct.go @@ -12,7 +12,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a product. A delegated admin is authorized to invoke this command. +// Creates a product. A delegated admin is authorized to invoke this command. The +// user or role that performs this operation must have the +// cloudformation:GetTemplate IAM policy permission. This policy permission is +// required when using the ImportFromPhysicalId template source in the information +// data section. func (c *Client) CreateProduct(ctx context.Context, params *CreateProductInput, optFns ...func(*Options)) (*CreateProductOutput, error) { if params == nil { params = &CreateProductInput{} @@ -52,8 +56,7 @@ type CreateProductInput struct { // This member is required. ProductType types.ProductType - // The configuration of the provisioning artifact. The info field accepts - // ImportFromPhysicalID. + // The configuration of the provisioning artifact. // // This member is required. ProvisioningArtifactParameters *types.ProvisioningArtifactProperties @@ -79,7 +82,8 @@ type CreateProductInput struct { // The contact email for product support. SupportEmail *string - // The contact URL for product support. + // The contact URL for product support. ^https?:\/\// / is the pattern used to + // validate SupportUrl. SupportUrl *string // One or more tags. diff --git a/service/servicecatalog/api_op_CreateProvisioningArtifact.go b/service/servicecatalog/api_op_CreateProvisioningArtifact.go index 09753575065..c8494110d7d 100644 --- a/service/servicecatalog/api_op_CreateProvisioningArtifact.go +++ b/service/servicecatalog/api_op_CreateProvisioningArtifact.go @@ -14,7 +14,10 @@ import ( // Creates a provisioning artifact (also known as a version) for the specified // product. You cannot create a provisioning artifact for a product that was shared -// with you. +// with you. The user or role that performs this operation must have the +// cloudformation:GetTemplate IAM policy permission. This policy permission is +// required when using the ImportFromPhysicalId template source in the information +// data section. func (c *Client) CreateProvisioningArtifact(ctx context.Context, params *CreateProvisioningArtifactInput, optFns ...func(*Options)) (*CreateProvisioningArtifactOutput, error) { if params == nil { params = &CreateProvisioningArtifactInput{} @@ -39,8 +42,7 @@ type CreateProvisioningArtifactInput struct { // This member is required. IdempotencyToken *string - // The configuration for the provisioning artifact. The info field accepts - // ImportFromPhysicalID. + // The configuration for the provisioning artifact. // // This member is required. Parameters *types.ProvisioningArtifactProperties @@ -62,7 +64,12 @@ type CreateProvisioningArtifactInput struct { type CreateProvisioningArtifactOutput struct { - // The URL of the CloudFormation template in Amazon S3, in JSON format. + // Specify the template source with one of the following options, but not both. + // Keys accepted: [ LoadTemplateFromURL, ImportFromPhysicalId ]. The URL of the + // CloudFormation template in Amazon S3, in JSON format. LoadTemplateFromURL Use + // the URL of the CloudFormation template in Amazon S3 in JSON format. + // ImportFromPhysicalId Use the physical id of the resource that contains the + // template; currently supports CloudFormation stack ARN. Info map[string]string // Information about the provisioning artifact. diff --git a/service/servicecatalog/api_op_DescribePortfolioShares.go b/service/servicecatalog/api_op_DescribePortfolioShares.go new file mode 100644 index 00000000000..5b3072494a1 --- /dev/null +++ b/service/servicecatalog/api_op_DescribePortfolioShares.go @@ -0,0 +1,225 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package servicecatalog + +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/servicecatalog/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a summary of each of the portfolio shares that were created for the +// specified portfolio. You can use this API to determine which accounts or +// organizational nodes this portfolio have been shared, whether the recipient +// entity has imported the share, and whether TagOptions are included with the +// share. The PortfolioId and Type parameters are both required. +func (c *Client) DescribePortfolioShares(ctx context.Context, params *DescribePortfolioSharesInput, optFns ...func(*Options)) (*DescribePortfolioSharesOutput, error) { + if params == nil { + params = &DescribePortfolioSharesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribePortfolioShares", params, optFns, addOperationDescribePortfolioSharesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribePortfolioSharesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribePortfolioSharesInput struct { + + // The unique identifier of the portfolio for which shares will be retrieved. + // + // This member is required. + PortfolioId *string + + // The type of portfolio share to summarize. This field acts as a filter on the + // type of portfolio share, which can be one of the following: 1. ACCOUNT - + // Represents an external account to account share. 2. ORGANIZATION - Represents a + // share to an organization. This share is available to every account in the + // organization. 3. ORGANIZATIONAL_UNIT - Represents a share to an organizational + // unit. 4. ORGANIZATION_MEMBER_ACCOUNT - Represents a share to an account in the + // organization. + // + // This member is required. + Type types.DescribePortfolioShareType + + // The maximum number of items to return with this call. + PageSize int32 + + // The page token for the next set of results. To retrieve the first set of + // results, use null. + PageToken *string +} + +type DescribePortfolioSharesOutput struct { + + // The page token to use to retrieve the next set of results. If there are no + // additional results, this value is null. + NextPageToken *string + + // Summaries about each of the portfolio shares. + PortfolioShareDetails []types.PortfolioShareDetail + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDescribePortfolioSharesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribePortfolioShares{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribePortfolioShares{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDescribePortfolioSharesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribePortfolioShares(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// DescribePortfolioSharesAPIClient is a client that implements the +// DescribePortfolioShares operation. +type DescribePortfolioSharesAPIClient interface { + DescribePortfolioShares(context.Context, *DescribePortfolioSharesInput, ...func(*Options)) (*DescribePortfolioSharesOutput, error) +} + +var _ DescribePortfolioSharesAPIClient = (*Client)(nil) + +// DescribePortfolioSharesPaginatorOptions is the paginator options for +// DescribePortfolioShares +type DescribePortfolioSharesPaginatorOptions struct { + // The maximum number of items to return with this call. + 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 +} + +// DescribePortfolioSharesPaginator is a paginator for DescribePortfolioShares +type DescribePortfolioSharesPaginator struct { + options DescribePortfolioSharesPaginatorOptions + client DescribePortfolioSharesAPIClient + params *DescribePortfolioSharesInput + nextToken *string + firstPage bool +} + +// NewDescribePortfolioSharesPaginator returns a new +// DescribePortfolioSharesPaginator +func NewDescribePortfolioSharesPaginator(client DescribePortfolioSharesAPIClient, params *DescribePortfolioSharesInput, optFns ...func(*DescribePortfolioSharesPaginatorOptions)) *DescribePortfolioSharesPaginator { + options := DescribePortfolioSharesPaginatorOptions{} + if params.PageSize != 0 { + options.Limit = params.PageSize + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &DescribePortfolioSharesInput{} + } + + return &DescribePortfolioSharesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribePortfolioSharesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next DescribePortfolioShares page. +func (p *DescribePortfolioSharesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribePortfolioSharesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.PageToken = p.nextToken + + params.PageSize = p.options.Limit + + result, err := p.client.DescribePortfolioShares(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextPageToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opDescribePortfolioShares(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "servicecatalog", + OperationName: "DescribePortfolioShares", + } +} diff --git a/service/servicecatalog/api_op_DescribeProductAsAdmin.go b/service/servicecatalog/api_op_DescribeProductAsAdmin.go index 4880ff79997..21bfafc0461 100644 --- a/service/servicecatalog/api_op_DescribeProductAsAdmin.go +++ b/service/servicecatalog/api_op_DescribeProductAsAdmin.go @@ -44,6 +44,14 @@ type DescribeProductAsAdminInput struct { // The product name. Name *string + + // The unique identifier of the shared portfolio that the specified product is + // associated with. You can provide this parameter to retrieve the shared + // TagOptions associated with the product. If this parameter is provided and if + // TagOptions sharing is enabled in the portfolio share, the API returns both local + // and shared TagOptions associated with the product. Otherwise only local + // TagOptions will be returned. + SourcePortfolioId *string } type DescribeProductAsAdminOutput struct { diff --git a/service/servicecatalog/api_op_ImportAsProvisionedProduct.go b/service/servicecatalog/api_op_ImportAsProvisionedProduct.go index 9109e2ba160..4e33f453b1d 100644 --- a/service/servicecatalog/api_op_ImportAsProvisionedProduct.go +++ b/service/servicecatalog/api_op_ImportAsProvisionedProduct.go @@ -14,14 +14,16 @@ import ( // Requests the import of a resource as a Service Catalog provisioned product that // is associated to a Service Catalog product and provisioning artifact. Once -// imported all supported Service Catalog governance actions are supported on the +// imported, all supported Service Catalog governance actions are supported on the // provisioned product. Resource import only supports CloudFormation stack ARNs. // CloudFormation StackSets and non-root nested stacks are not supported. The // CloudFormation stack must have one of the following statuses to be imported: // CREATE_COMPLETE, UPDATE_COMPLETE, UPDATE_ROLLBACK_COMPLETE, IMPORT_COMPLETE, // IMPORT_ROLLBACK_COMPLETE. Import of the resource requires that the // CloudFormation stack template matches the associated Service Catalog product -// provisioning artifact. +// provisioning artifact. The user or role that performs this operation must have +// the cloudformation:GetTemplate and cloudformation:DescribeStacks IAM policy +// permissions. func (c *Client) ImportAsProvisionedProduct(ctx context.Context, params *ImportAsProvisionedProductInput, optFns ...func(*Options)) (*ImportAsProvisionedProductOutput, error) { if params == nil { params = &ImportAsProvisionedProductInput{} diff --git a/service/servicecatalog/api_op_UpdatePortfolioShare.go b/service/servicecatalog/api_op_UpdatePortfolioShare.go new file mode 100644 index 00000000000..7836018c863 --- /dev/null +++ b/service/servicecatalog/api_op_UpdatePortfolioShare.go @@ -0,0 +1,149 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package servicecatalog + +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/servicecatalog/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates the specified portfolio share. You can use this API to enable or disable +// TagOptions sharing for an existing portfolio share. The portfolio share cannot +// be updated if the CreatePortfolioShare operation is IN_PROGRESS, as the share +// is not available to recipient entities. In this case, you must wait for the +// portfolio share to be COMPLETED. You must provide the accountId or organization +// node in the input, but not both. If the portfolio is shared to both an external +// account and an organization node, and both shares need to be updated, you must +// invoke UpdatePortfolioShare separately for each share type. This API cannot be +// used for removing the portfolio share. You must use DeletePortfolioShare API for +// that action. +func (c *Client) UpdatePortfolioShare(ctx context.Context, params *UpdatePortfolioShareInput, optFns ...func(*Options)) (*UpdatePortfolioShareOutput, error) { + if params == nil { + params = &UpdatePortfolioShareInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdatePortfolioShare", params, optFns, addOperationUpdatePortfolioShareMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdatePortfolioShareOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdatePortfolioShareInput struct { + + // The unique identifier of the portfolio for which the share will be updated. + // + // This member is required. + PortfolioId *string + + // The language code. + // + // * en - English (default) + // + // * jp - Japanese + // + // * zh - Chinese + AcceptLanguage *string + + // The AWS Account Id of the recipient account. This field is required when + // updating an external account to account type share. + AccountId *string + + // Information about the organization node. + OrganizationNode *types.OrganizationNode + + // A flag to enable or disable TagOptions sharing for the portfolio share. If this + // field is not provided, the current state of TagOptions sharing on the portfolio + // share will not be modified. + ShareTagOptions *bool +} + +type UpdatePortfolioShareOutput struct { + + // The token that tracks the status of the UpdatePortfolioShare operation for + // external account to account or organizational type sharing. + PortfolioShareToken *string + + // The status of UpdatePortfolioShare operation. You can also obtain the operation + // status using DescribePortfolioShareStatus API. + Status types.ShareStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationUpdatePortfolioShareMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdatePortfolioShare{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdatePortfolioShare{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdatePortfolioShareValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePortfolioShare(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opUpdatePortfolioShare(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "servicecatalog", + OperationName: "UpdatePortfolioShare", + } +} diff --git a/service/servicecatalog/deserializers.go b/service/servicecatalog/deserializers.go index 7eed35f50ac..259e1dd9cd0 100644 --- a/service/servicecatalog/deserializers.go +++ b/service/servicecatalog/deserializers.go @@ -3280,6 +3280,120 @@ func awsAwsjson11_deserializeOpErrorDescribePortfolio(response *smithyhttp.Respo } } +type awsAwsjson11_deserializeOpDescribePortfolioShares struct { +} + +func (*awsAwsjson11_deserializeOpDescribePortfolioShares) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDescribePortfolioShares) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorDescribePortfolioShares(response, &metadata) + } + output := &DescribePortfolioSharesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentDescribePortfolioSharesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDescribePortfolioShares(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidParametersException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParametersException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpDescribePortfolioShareStatus struct { } @@ -9097,6 +9211,126 @@ func awsAwsjson11_deserializeOpErrorUpdatePortfolio(response *smithyhttp.Respons } } +type awsAwsjson11_deserializeOpUpdatePortfolioShare struct { +} + +func (*awsAwsjson11_deserializeOpUpdatePortfolioShare) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdatePortfolioShare) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUpdatePortfolioShare(response, &metadata) + } + output := &UpdatePortfolioShareOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentUpdatePortfolioShareOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdatePortfolioShare(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidParametersException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParametersException(response, errorBody) + + case strings.EqualFold("InvalidStateException", errorCode): + return awsAwsjson11_deserializeErrorInvalidStateException(response, errorBody) + + case strings.EqualFold("OperationNotSupportedException", errorCode): + return awsAwsjson11_deserializeErrorOperationNotSupportedException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpUpdateProduct struct { } @@ -11419,6 +11653,107 @@ func awsAwsjson11_deserializeDocumentPortfolioDetails(v *[]types.PortfolioDetail return nil } +func awsAwsjson11_deserializeDocumentPortfolioShareDetail(v **types.PortfolioShareDetail, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PortfolioShareDetail + if *v == nil { + sv = &types.PortfolioShareDetail{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Accepted": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Accepted = jtv + } + + case "PrincipalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.PrincipalId = ptr.String(jtv) + } + + case "ShareTagOptions": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.ShareTagOptions = jtv + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DescribePortfolioShareType to be of type string, got %T instead", value) + } + sv.Type = types.DescribePortfolioShareType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentPortfolioShareDetails(v *[]types.PortfolioShareDetail, 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.PortfolioShareDetail + if *v == nil { + cv = []types.PortfolioShareDetail{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PortfolioShareDetail + destAddr := &col + if err := awsAwsjson11_deserializeDocumentPortfolioShareDetail(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentPrincipal(v **types.Principal, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14892,6 +15227,15 @@ func awsAwsjson11_deserializeDocumentTagOptionDetail(v **types.TagOptionDetail, sv.Key = ptr.String(jtv) } + case "Owner": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Owner to be of type string, got %T instead", value) + } + sv.Owner = ptr.String(jtv) + } + case "Value": if value != nil { jtv, ok := value.(string) @@ -16405,6 +16749,51 @@ func awsAwsjson11_deserializeOpDocumentDescribePortfolioOutput(v **DescribePortf return nil } +func awsAwsjson11_deserializeOpDocumentDescribePortfolioSharesOutput(v **DescribePortfolioSharesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribePortfolioSharesOutput + if *v == nil { + sv = &DescribePortfolioSharesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextPageToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PageToken to be of type string, got %T instead", value) + } + sv.NextPageToken = ptr.String(jtv) + } + + case "PortfolioShareDetails": + if err := awsAwsjson11_deserializeDocumentPortfolioShareDetails(&sv.PortfolioShareDetails, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDescribePortfolioShareStatusOutput(v **DescribePortfolioShareStatusOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -18601,6 +18990,55 @@ func awsAwsjson11_deserializeOpDocumentUpdatePortfolioOutput(v **UpdatePortfolio return nil } +func awsAwsjson11_deserializeOpDocumentUpdatePortfolioShareOutput(v **UpdatePortfolioShareOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdatePortfolioShareOutput + if *v == nil { + sv = &UpdatePortfolioShareOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PortfolioShareToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.PortfolioShareToken = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ShareStatus to be of type string, got %T instead", value) + } + sv.Status = types.ShareStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentUpdateProductOutput(v **UpdateProductOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/servicecatalog/serializers.go b/service/servicecatalog/serializers.go index f89c1c797b4..d52257f6e07 100644 --- a/service/servicecatalog/serializers.go +++ b/service/servicecatalog/serializers.go @@ -1302,6 +1302,52 @@ func (m *awsAwsjson11_serializeOpDescribePortfolio) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDescribePortfolioShares struct { +} + +func (*awsAwsjson11_serializeOpDescribePortfolioShares) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDescribePortfolioShares) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribePortfolioSharesInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWS242ServiceCatalogService.DescribePortfolioShares") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribePortfolioSharesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDescribePortfolioShareStatus struct { } @@ -3627,6 +3673,52 @@ func (m *awsAwsjson11_serializeOpUpdatePortfolio) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpUpdatePortfolioShare struct { +} + +func (*awsAwsjson11_serializeOpUpdatePortfolioShare) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdatePortfolioShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdatePortfolioShareInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWS242ServiceCatalogService.UpdatePortfolioShare") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdatePortfolioShareInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpUpdateProduct struct { } @@ -4774,6 +4866,11 @@ func awsAwsjson11_serializeOpDocumentCreatePortfolioShareInput(v *CreatePortfoli ok.String(*v.PortfolioId) } + if v.ShareTagOptions { + ok := object.Key("ShareTagOptions") + ok.Boolean(v.ShareTagOptions) + } + return nil } @@ -5205,6 +5302,33 @@ func awsAwsjson11_serializeOpDocumentDescribePortfolioInput(v *DescribePortfolio return nil } +func awsAwsjson11_serializeOpDocumentDescribePortfolioSharesInput(v *DescribePortfolioSharesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PageSize != 0 { + ok := object.Key("PageSize") + ok.Integer(v.PageSize) + } + + if v.PageToken != nil { + ok := object.Key("PageToken") + ok.String(*v.PageToken) + } + + if v.PortfolioId != nil { + ok := object.Key("PortfolioId") + ok.String(*v.PortfolioId) + } + + if len(v.Type) > 0 { + ok := object.Key("Type") + ok.String(string(v.Type)) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDescribePortfolioShareStatusInput(v *DescribePortfolioShareStatusInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5236,6 +5360,11 @@ func awsAwsjson11_serializeOpDocumentDescribeProductAsAdminInput(v *DescribeProd ok.String(*v.Name) } + if v.SourcePortfolioId != nil { + ok := object.Key("SourcePortfolioId") + ok.String(*v.SourcePortfolioId) + } + return nil } @@ -6616,6 +6745,40 @@ func awsAwsjson11_serializeOpDocumentUpdatePortfolioInput(v *UpdatePortfolioInpu return nil } +func awsAwsjson11_serializeOpDocumentUpdatePortfolioShareInput(v *UpdatePortfolioShareInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AcceptLanguage != nil { + ok := object.Key("AcceptLanguage") + ok.String(*v.AcceptLanguage) + } + + if v.AccountId != nil { + ok := object.Key("AccountId") + ok.String(*v.AccountId) + } + + if v.OrganizationNode != nil { + ok := object.Key("OrganizationNode") + if err := awsAwsjson11_serializeDocumentOrganizationNode(v.OrganizationNode, ok); err != nil { + return err + } + } + + if v.PortfolioId != nil { + ok := object.Key("PortfolioId") + ok.String(*v.PortfolioId) + } + + if v.ShareTagOptions != nil { + ok := object.Key("ShareTagOptions") + ok.Boolean(*v.ShareTagOptions) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentUpdateProductInput(v *UpdateProductInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/servicecatalog/types/enums.go b/service/servicecatalog/types/enums.go index 79ce8834c96..48ab536b4f6 100644 --- a/service/servicecatalog/types/enums.go +++ b/service/servicecatalog/types/enums.go @@ -98,6 +98,28 @@ func (CopyProductStatus) Values() []CopyProductStatus { } } +type DescribePortfolioShareType string + +// Enum values for DescribePortfolioShareType +const ( + DescribePortfolioShareTypeAccount DescribePortfolioShareType = "ACCOUNT" + DescribePortfolioShareTypeOrganization DescribePortfolioShareType = "ORGANIZATION" + DescribePortfolioShareTypeOrganizationalUnit DescribePortfolioShareType = "ORGANIZATIONAL_UNIT" + DescribePortfolioShareTypeOrganizationMemberAccount DescribePortfolioShareType = "ORGANIZATION_MEMBER_ACCOUNT" +) + +// Values returns all known values for DescribePortfolioShareType. 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 (DescribePortfolioShareType) Values() []DescribePortfolioShareType { + return []DescribePortfolioShareType{ + "ACCOUNT", + "ORGANIZATION", + "ORGANIZATIONAL_UNIT", + "ORGANIZATION_MEMBER_ACCOUNT", + } +} + type EvaluationType string // Enum values for EvaluationType @@ -621,6 +643,13 @@ func (StackInstanceStatus) Values() []StackInstanceStatus { type StackSetOperationType string +// Enum values for StackSetOperationType +const ( + StackSetOperationTypeCreate StackSetOperationType = "CREATE" + StackSetOperationTypeUpdate StackSetOperationType = "UPDATE" + StackSetOperationTypeDelete StackSetOperationType = "DELETE" +) + // Values returns all known values for StackSetOperationType. 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. diff --git a/service/servicecatalog/types/types.go b/service/servicecatalog/types/types.go index 97f6a456f16..f3a732652f0 100644 --- a/service/servicecatalog/types/types.go +++ b/service/servicecatalog/types/types.go @@ -216,6 +216,28 @@ type PortfolioDetail struct { ProviderName *string } +// Information about the portfolio share. +type PortfolioShareDetail struct { + + // Indicates whether the shared portfolio is imported by the recipient account. If + // the recipient is in an organization node, the share is automatically imported, + // and the field is always set to true. + Accepted bool + + // The identifier of the recipient entity that received the portfolio share. The + // recipient entities can be one of the following: 1. An external account. 2. An + // organziation member account. 3. An organzational unit (OU). 4. The organization + // itself. (This shares with every account in the organization). + PrincipalId *string + + // Indicates whether TagOptions sharing is enabled or disabled for the portfolio + // share. + ShareTagOptions bool + + // The type of the portfolio share. + Type DescribePortfolioShareType +} + // Information about a principal. type Principal struct { @@ -696,9 +718,15 @@ type ProvisioningArtifactPreferences struct { // product. type ProvisioningArtifactProperties struct { - // The URL of the CloudFormation template in Amazon S3. Specify the URL in JSON - // format as follows: "LoadTemplateFromURL": - // "https://s3.amazonaws.com/cf-templates-ozkq9d3hgiq2-us-east-1/..." + // Specify the template source with one of the following options, but not both. + // Keys accepted: [ LoadTemplateFromURL, ImportFromPhysicalId ] The URL of the + // CloudFormation template in Amazon S3. Specify the URL in JSON format as follows: + // "LoadTemplateFromURL": + // "https://s3.amazonaws.com/cf-templates-ozkq9d3hgiq2-us-east-1/..."ImportFromPhysicalId: + // The physical id of the resource that contains the template. Currently only + // supports CloudFormation stack arn. Specify the physical id in JSON format as + // follows: ImportFromPhysicalId: + // “arn:aws:cloudformation:[us-east-1]:[accountId]:stack/[StackName]/[resourceId] // // This member is required. Info map[string]string @@ -771,15 +799,21 @@ type ProvisioningParameter struct { } // The user-defined preferences that will be applied when updating a provisioned -// product. Not all preferences are applicable to all provisioned product types. +// product. Not all preferences are applicable to all provisioned product type One +// or more AWS accounts that will have access to the provisioned product. +// Applicable only to a CFN_STACKSET provisioned product type. The AWS accounts +// specified should be within the list of accounts in the STACKSET constraint. To +// get the list of accounts in the STACKSET constraint, use the +// DescribeProvisioningParameters operation. If no values are specified, the +// default value is all accounts from the STACKSET constraint. type ProvisioningPreferences struct { - // One or more AWS accounts that will have access to the provisioned product. - // Applicable only to a CFN_STACKSET provisioned product type. The AWS accounts - // specified should be within the list of accounts in the STACKSET constraint. To + // One or more AWS accounts where the provisioned product will be available. + // Applicable only to a CFN_STACKSET provisioned product type. The specified + // accounts should be within the list of accounts from the STACKSET constraint. To // get the list of accounts in the STACKSET constraint, use the // DescribeProvisioningParameters operation. If no values are specified, the - // default value is all accounts from the STACKSET constraint. + // default value is all acounts from the STACKSET constraint. StackSetAccounts []string // The number of accounts, per region, for which this operation can fail before AWS @@ -1144,6 +1178,9 @@ type TagOptionDetail struct { // The TagOption key. Key *string + // The AWS account Id of the owner account that created the TagOption. + Owner *string + // The TagOption value. Value *string } diff --git a/service/servicecatalog/validators.go b/service/servicecatalog/validators.go index b3d56c4abbf..167dde2fe3e 100644 --- a/service/servicecatalog/validators.go +++ b/service/servicecatalog/validators.go @@ -570,6 +570,26 @@ func (m *validateOpDescribePortfolio) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpDescribePortfolioShares struct { +} + +func (*validateOpDescribePortfolioShares) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribePortfolioShares) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribePortfolioSharesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribePortfolioSharesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribePortfolioShareStatus struct { } @@ -1210,6 +1230,26 @@ func (m *validateOpUpdatePortfolio) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpUpdatePortfolioShare struct { +} + +func (*validateOpUpdatePortfolioShare) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdatePortfolioShare) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdatePortfolioShareInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdatePortfolioShareInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateProduct struct { } @@ -1442,6 +1482,10 @@ func addOpDescribePortfolioValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribePortfolio{}, middleware.After) } +func addOpDescribePortfolioSharesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribePortfolioShares{}, middleware.After) +} + func addOpDescribePortfolioShareStatusValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribePortfolioShareStatus{}, middleware.After) } @@ -1570,6 +1614,10 @@ func addOpUpdatePortfolioValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdatePortfolio{}, middleware.After) } +func addOpUpdatePortfolioShareValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdatePortfolioShare{}, middleware.After) +} + func addOpUpdateProductValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateProduct{}, middleware.After) } @@ -2240,6 +2288,24 @@ func validateOpDescribePortfolioInput(v *DescribePortfolioInput) error { } } +func validateOpDescribePortfolioSharesInput(v *DescribePortfolioSharesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribePortfolioSharesInput"} + if v.PortfolioId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PortfolioId")) + } + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribePortfolioShareStatusInput(v *DescribePortfolioShareStatusInput) error { if v == nil { return nil @@ -2781,6 +2847,21 @@ func validateOpUpdatePortfolioInput(v *UpdatePortfolioInput) error { } } +func validateOpUpdatePortfolioShareInput(v *UpdatePortfolioShareInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdatePortfolioShareInput"} + if v.PortfolioId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PortfolioId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateProductInput(v *UpdateProductInput) error { if v == nil { return nil diff --git a/service/servicecatalogappregistry/api_op_SyncResource.go b/service/servicecatalogappregistry/api_op_SyncResource.go new file mode 100644 index 00000000000..99b0bf4a7cd --- /dev/null +++ b/service/servicecatalogappregistry/api_op_SyncResource.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package servicecatalogappregistry + +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/servicecatalogappregistry/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Syncs the resource with what is currently recorded in App registry. +// Specifically, the resource’s App registry system tags are synced with its +// associated application. The resource is removed if it is not associated with the +// application. The caller must have permissions to read and update the resource. +func (c *Client) SyncResource(ctx context.Context, params *SyncResourceInput, optFns ...func(*Options)) (*SyncResourceOutput, error) { + if params == nil { + params = &SyncResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SyncResource", params, optFns, addOperationSyncResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SyncResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SyncResourceInput struct { + + // An entity you can work with and specify with a name or ID. Examples include an + // Amazon EC2 instance, an AWS CloudFormation stack, or an Amazon S3 bucket. + // + // This member is required. + Resource *string + + // The type of resource of which the application will be associated. + // + // This member is required. + ResourceType types.ResourceType +} + +type SyncResourceOutput struct { + + // The results of the output if an application is associated with an ARN value, + // which could be syncStarted or None. + ActionTaken types.SyncAction + + // The Amazon resource name (ARN) that specifies the application. + ApplicationArn *string + + // The Amazon resource name (ARN) that specifies the resource. + ResourceArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationSyncResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpSyncResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSyncResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpSyncResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSyncResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opSyncResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "servicecatalog", + OperationName: "SyncResource", + } +} diff --git a/service/servicecatalogappregistry/api_op_TagResource.go b/service/servicecatalogappregistry/api_op_TagResource.go index 34c1deac971..3205f6c138a 100644 --- a/service/servicecatalogappregistry/api_op_TagResource.go +++ b/service/servicecatalogappregistry/api_op_TagResource.go @@ -12,7 +12,8 @@ import ( // Assigns one or more tags (key-value pairs) to the specified resource. Each tag // consists of a key and an optional value. If a tag with the same key is already -// associated with the resource, this action updates its value. +// associated with the resource, this action updates its value. This operation +// returns an empty response if the call was successful. func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { if params == nil { params = &TagResourceInput{} diff --git a/service/servicecatalogappregistry/api_op_UntagResource.go b/service/servicecatalogappregistry/api_op_UntagResource.go index 0c1b58e901b..beadb7f8a42 100644 --- a/service/servicecatalogappregistry/api_op_UntagResource.go +++ b/service/servicecatalogappregistry/api_op_UntagResource.go @@ -10,7 +10,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Removes tags from a resource. +// Removes tags from a resource. This operation returns an empty response if the +// call was successful. func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { if params == nil { params = &UntagResourceInput{} diff --git a/service/servicecatalogappregistry/deserializers.go b/service/servicecatalogappregistry/deserializers.go index 45aab53ae79..1b19d8f5b0e 100644 --- a/service/servicecatalogappregistry/deserializers.go +++ b/service/servicecatalogappregistry/deserializers.go @@ -2548,6 +2548,181 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } +type awsRestjson1_deserializeOpSyncResource struct { +} + +func (*awsRestjson1_deserializeOpSyncResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSyncResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorSyncResource(response, &metadata) + } + output := &SyncResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentSyncResourceOutput(&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_deserializeOpErrorSyncResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentSyncResourceOutput(v **SyncResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *SyncResourceOutput + if *v == nil { + sv = &SyncResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "actionTaken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SyncAction to be of type string, got %T instead", value) + } + sv.ActionTaken = types.SyncAction(jtv) + } + + case "applicationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ApplicationArn to be of type string, got %T instead", value) + } + sv.ApplicationArn = ptr.String(jtv) + } + + case "resourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ResourceArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpTagResource struct { } diff --git a/service/servicecatalogappregistry/serializers.go b/service/servicecatalogappregistry/serializers.go index fded184ea83..562d06dbe5d 100644 --- a/service/servicecatalogappregistry/serializers.go +++ b/service/servicecatalogappregistry/serializers.go @@ -1085,6 +1085,78 @@ func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsFor return nil } +type awsRestjson1_serializeOpSyncResource struct { +} + +func (*awsRestjson1_serializeOpSyncResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpSyncResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SyncResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sync/{resourceType}/{resource}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsSyncResourceInput(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_serializeOpHttpBindingsSyncResourceInput(v *SyncResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Resource == nil || len(*v.Resource) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resource must not be empty")} + } + if v.Resource != nil { + if err := encoder.SetURI("resource").String(*v.Resource); err != nil { + return err + } + } + + if len(v.ResourceType) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member resourceType must not be empty")} + } + if len(v.ResourceType) > 0 { + if err := encoder.SetURI("resourceType").String(string(v.ResourceType)); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpTagResource struct { } diff --git a/service/servicecatalogappregistry/types/enums.go b/service/servicecatalogappregistry/types/enums.go index 1324444c130..f0f7d0d977b 100644 --- a/service/servicecatalogappregistry/types/enums.go +++ b/service/servicecatalogappregistry/types/enums.go @@ -17,3 +17,21 @@ func (ResourceType) Values() []ResourceType { "CFN_STACK", } } + +type SyncAction string + +// Enum values for SyncAction +const ( + SyncActionStartSync SyncAction = "START_SYNC" + SyncActionNoAction SyncAction = "NO_ACTION" +) + +// Values returns all known values for SyncAction. 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 (SyncAction) Values() []SyncAction { + return []SyncAction{ + "START_SYNC", + "NO_ACTION", + } +} diff --git a/service/servicecatalogappregistry/validators.go b/service/servicecatalogappregistry/validators.go index 71ee6ea8eda..4f8a647be6d 100644 --- a/service/servicecatalogappregistry/validators.go +++ b/service/servicecatalogappregistry/validators.go @@ -269,6 +269,26 @@ func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpSyncResource struct { +} + +func (*validateOpSyncResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSyncResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SyncResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSyncResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpTagResource struct { } @@ -401,6 +421,10 @@ func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } +func addOpSyncResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSyncResource{}, middleware.After) +} + func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } @@ -639,6 +663,24 @@ func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { } } +func validateOpSyncResourceInput(v *SyncResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SyncResourceInput"} + if len(v.ResourceType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ResourceType")) + } + if v.Resource == nil { + invalidParams.Add(smithy.NewErrParamRequired("Resource")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil diff --git a/service/servicequotas/api_op_AssociateServiceQuotaTemplate.go b/service/servicequotas/api_op_AssociateServiceQuotaTemplate.go index 9f778ec4e04..73f78995e10 100644 --- a/service/servicequotas/api_op_AssociateServiceQuotaTemplate.go +++ b/service/servicequotas/api_op_AssociateServiceQuotaTemplate.go @@ -10,11 +10,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Associates the Service Quotas template with your organization so that when new -// accounts are created in your organization, the template submits increase -// requests for the specified service quotas. Use the Service Quotas template to -// request an increase for any adjustable quota value. After you define the Service -// Quotas template, use this operation to associate, or enable, the template. +// Associates your quota request template with your organization. When a new +// account is created in your organization, the quota increase requests in the +// template are automatically applied to the account. You can add a quota increase +// request for any adjustable quota to your template. func (c *Client) AssociateServiceQuotaTemplate(ctx context.Context, params *AssociateServiceQuotaTemplateInput, optFns ...func(*Options)) (*AssociateServiceQuotaTemplateOutput, error) { if params == nil { params = &AssociateServiceQuotaTemplateInput{} diff --git a/service/servicequotas/api_op_DeleteServiceQuotaIncreaseRequestFromTemplate.go b/service/servicequotas/api_op_DeleteServiceQuotaIncreaseRequestFromTemplate.go index 259967fbad2..b65f2e6f57b 100644 --- a/service/servicequotas/api_op_DeleteServiceQuotaIncreaseRequestFromTemplate.go +++ b/service/servicequotas/api_op_DeleteServiceQuotaIncreaseRequestFromTemplate.go @@ -10,7 +10,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Removes a service quota increase request from the Service Quotas template. +// Deletes the quota increase request for the specified quota from your quota +// request template. func (c *Client) DeleteServiceQuotaIncreaseRequestFromTemplate(ctx context.Context, params *DeleteServiceQuotaIncreaseRequestFromTemplateInput, optFns ...func(*Options)) (*DeleteServiceQuotaIncreaseRequestFromTemplateOutput, error) { if params == nil { params = &DeleteServiceQuotaIncreaseRequestFromTemplateInput{} @@ -28,17 +29,17 @@ func (c *Client) DeleteServiceQuotaIncreaseRequestFromTemplate(ctx context.Conte type DeleteServiceQuotaIncreaseRequestFromTemplateInput struct { - // Specifies the AWS Region for the quota that you want to delete. + // The AWS Region. // // This member is required. AwsRegion *string - // Specifies the code for the quota that you want to delete. + // The quota identifier. // // This member is required. QuotaCode *string - // Specifies the code for the service that you want to delete. + // The service identifier. // // This member is required. ServiceCode *string diff --git a/service/servicequotas/api_op_DisassociateServiceQuotaTemplate.go b/service/servicequotas/api_op_DisassociateServiceQuotaTemplate.go index d93b851a47e..7d5b7eab2b5 100644 --- a/service/servicequotas/api_op_DisassociateServiceQuotaTemplate.go +++ b/service/servicequotas/api_op_DisassociateServiceQuotaTemplate.go @@ -10,16 +10,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Disables the Service Quotas template. Once the template is disabled, it does not -// request quota increases for new accounts in your organization. Disabling the -// quota template does not apply the quota increase requests from the template. -// Related operations -// -// * To enable the quota template, call -// AssociateServiceQuotaTemplate. -// -// * To delete a specific service quota from the -// template, use DeleteServiceQuotaIncreaseRequestFromTemplate. +// Disables your quota request template. After a template is disabled, the quota +// increase requests in the template are not applied to new accounts in your +// organization. Disabling a quota request template does not apply its quota +// increase requests. func (c *Client) DisassociateServiceQuotaTemplate(ctx context.Context, params *DisassociateServiceQuotaTemplateInput, optFns ...func(*Options)) (*DisassociateServiceQuotaTemplateOutput, error) { if params == nil { params = &DisassociateServiceQuotaTemplateInput{} diff --git a/service/servicequotas/api_op_GetAWSDefaultServiceQuota.go b/service/servicequotas/api_op_GetAWSDefaultServiceQuota.go index d0c7a03f421..c2242b669c1 100644 --- a/service/servicequotas/api_op_GetAWSDefaultServiceQuota.go +++ b/service/servicequotas/api_op_GetAWSDefaultServiceQuota.go @@ -11,8 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves the default service quotas values. The Value returned for each quota -// is the AWS default value, even if the quotas have been increased.. +// Retrieves the default value for the specified quota. The default value does not +// reflect any quota increases. func (c *Client) GetAWSDefaultServiceQuota(ctx context.Context, params *GetAWSDefaultServiceQuotaInput, optFns ...func(*Options)) (*GetAWSDefaultServiceQuotaOutput, error) { if params == nil { params = &GetAWSDefaultServiceQuotaInput{} @@ -30,12 +30,12 @@ func (c *Client) GetAWSDefaultServiceQuota(ctx context.Context, params *GetAWSDe type GetAWSDefaultServiceQuotaInput struct { - // Identifies the service quota you want to select. + // The quota identifier. // // This member is required. QuotaCode *string - // Specifies the service that you want to use. + // The service identifier. // // This member is required. ServiceCode *string @@ -43,7 +43,7 @@ type GetAWSDefaultServiceQuotaInput struct { type GetAWSDefaultServiceQuotaOutput struct { - // Returns the ServiceQuota object which contains all values for a quota. + // Information about the quota. Quota *types.ServiceQuota // Metadata pertaining to the operation's result. diff --git a/service/servicequotas/api_op_GetAssociationForServiceQuotaTemplate.go b/service/servicequotas/api_op_GetAssociationForServiceQuotaTemplate.go index 67f8c895b69..0407f9e8370 100644 --- a/service/servicequotas/api_op_GetAssociationForServiceQuotaTemplate.go +++ b/service/servicequotas/api_op_GetAssociationForServiceQuotaTemplate.go @@ -11,9 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves the ServiceQuotaTemplateAssociationStatus value from the service. Use -// this action to determine if the Service Quota template is associated, or -// enabled. +// Retrieves the status of the association for the quota request template. func (c *Client) GetAssociationForServiceQuotaTemplate(ctx context.Context, params *GetAssociationForServiceQuotaTemplateInput, optFns ...func(*Options)) (*GetAssociationForServiceQuotaTemplateOutput, error) { if params == nil { params = &GetAssociationForServiceQuotaTemplateInput{} @@ -34,9 +32,8 @@ type GetAssociationForServiceQuotaTemplateInput struct { type GetAssociationForServiceQuotaTemplateOutput struct { - // Specifies whether the template is ASSOCIATED or DISASSOCIATED. If the template - // is ASSOCIATED, then it requests service quota increases for all new accounts - // created in your organization. + // The association status. If the status is ASSOCIATED, the quota increase requests + // in the template are automatically applied to new accounts in your organization. ServiceQuotaTemplateAssociationStatus types.ServiceQuotaTemplateAssociationStatus // Metadata pertaining to the operation's result. diff --git a/service/servicequotas/api_op_GetRequestedServiceQuotaChange.go b/service/servicequotas/api_op_GetRequestedServiceQuotaChange.go index 32dc00177e4..eb049f68078 100644 --- a/service/servicequotas/api_op_GetRequestedServiceQuotaChange.go +++ b/service/servicequotas/api_op_GetRequestedServiceQuotaChange.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves the details for a particular increase request. +// Retrieves information about the specified quota increase request. func (c *Client) GetRequestedServiceQuotaChange(ctx context.Context, params *GetRequestedServiceQuotaChangeInput, optFns ...func(*Options)) (*GetRequestedServiceQuotaChangeOutput, error) { if params == nil { params = &GetRequestedServiceQuotaChangeInput{} @@ -29,7 +29,7 @@ func (c *Client) GetRequestedServiceQuotaChange(ctx context.Context, params *Get type GetRequestedServiceQuotaChangeInput struct { - // Identifies the quota increase request. + // The ID of the quota increase request. // // This member is required. RequestId *string @@ -37,8 +37,7 @@ type GetRequestedServiceQuotaChangeInput struct { type GetRequestedServiceQuotaChangeOutput struct { - // Returns the RequestedServiceQuotaChange object for the specific increase - // request. + // Information about the quota increase request. RequestedQuota *types.RequestedServiceQuotaChange // Metadata pertaining to the operation's result. diff --git a/service/servicequotas/api_op_GetServiceQuota.go b/service/servicequotas/api_op_GetServiceQuota.go index 00b6edde18d..a08a37021e3 100644 --- a/service/servicequotas/api_op_GetServiceQuota.go +++ b/service/servicequotas/api_op_GetServiceQuota.go @@ -11,10 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns the details for the specified service quota. This operation provides a -// different Value than the GetAWSDefaultServiceQuota operation. This operation -// returns the applied value for each quota. GetAWSDefaultServiceQuota returns the -// default AWS value for each quota. +// Retrieves the applied quota value for the specified quota. For some quotas, only +// the default values are available. If the applied quota value is not available +// for a quota, the quota is not retrieved. func (c *Client) GetServiceQuota(ctx context.Context, params *GetServiceQuotaInput, optFns ...func(*Options)) (*GetServiceQuotaOutput, error) { if params == nil { params = &GetServiceQuotaInput{} @@ -32,12 +31,12 @@ func (c *Client) GetServiceQuota(ctx context.Context, params *GetServiceQuotaInp type GetServiceQuotaInput struct { - // Identifies the service quota you want to select. + // The quota identifier. // // This member is required. QuotaCode *string - // Specifies the service that you want to use. + // The service identifier. // // This member is required. ServiceCode *string @@ -45,7 +44,7 @@ type GetServiceQuotaInput struct { type GetServiceQuotaOutput struct { - // Returns the ServiceQuota object which contains all values for a quota. + // Information about the quota. Quota *types.ServiceQuota // Metadata pertaining to the operation's result. diff --git a/service/servicequotas/api_op_GetServiceQuotaIncreaseRequestFromTemplate.go b/service/servicequotas/api_op_GetServiceQuotaIncreaseRequestFromTemplate.go index 27a9d6037b0..1e0b0da78f6 100644 --- a/service/servicequotas/api_op_GetServiceQuotaIncreaseRequestFromTemplate.go +++ b/service/servicequotas/api_op_GetServiceQuotaIncreaseRequestFromTemplate.go @@ -11,7 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns the details of the service quota increase request in your template. +// Retrieves information about the specified quota increase request in your quota +// request template. func (c *Client) GetServiceQuotaIncreaseRequestFromTemplate(ctx context.Context, params *GetServiceQuotaIncreaseRequestFromTemplateInput, optFns ...func(*Options)) (*GetServiceQuotaIncreaseRequestFromTemplateOutput, error) { if params == nil { params = &GetServiceQuotaIncreaseRequestFromTemplateInput{} @@ -29,17 +30,17 @@ func (c *Client) GetServiceQuotaIncreaseRequestFromTemplate(ctx context.Context, type GetServiceQuotaIncreaseRequestFromTemplateInput struct { - // Specifies the AWS Region for the quota that you want to use. + // The AWS Region. // // This member is required. AwsRegion *string - // Specifies the quota you want. + // The quota identifier. // // This member is required. QuotaCode *string - // Specifies the service that you want to use. + // The service identifier. // // This member is required. ServiceCode *string @@ -47,7 +48,7 @@ type GetServiceQuotaIncreaseRequestFromTemplateInput struct { type GetServiceQuotaIncreaseRequestFromTemplateOutput struct { - // This object contains the details about the quota increase request. + // Information about the quota increase request. ServiceQuotaIncreaseRequestInTemplate *types.ServiceQuotaIncreaseRequestInTemplate // Metadata pertaining to the operation's result. diff --git a/service/servicequotas/api_op_ListAWSDefaultServiceQuotas.go b/service/servicequotas/api_op_ListAWSDefaultServiceQuotas.go index 4659e9d4acf..a6100f25737 100644 --- a/service/servicequotas/api_op_ListAWSDefaultServiceQuotas.go +++ b/service/servicequotas/api_op_ListAWSDefaultServiceQuotas.go @@ -12,17 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists all default service quotas for the specified AWS service or all AWS -// services. ListAWSDefaultServiceQuotas is similar to ListServiceQuotas except for -// the Value object. The Value object returned by ListAWSDefaultServiceQuotas is -// the default value assigned by AWS. This request returns a list of all service -// quotas for the specified service. The listing of each you'll see the default -// values are the values that AWS provides for the quotas. Always check the -// NextToken response parameter when calling any of the List* operations. These -// operations can return an unexpected list of results, even when there are more -// results available. When this happens, the NextToken response parameter contains -// a value to pass the next call to the same API to request the next part of the -// list. +// Lists the default values for the quotas for the specified AWS service. A default +// value does not reflect any quota increases. func (c *Client) ListAWSDefaultServiceQuotas(ctx context.Context, params *ListAWSDefaultServiceQuotasInput, optFns ...func(*Options)) (*ListAWSDefaultServiceQuotasOutput, error) { if params == nil { params = &ListAWSDefaultServiceQuotasInput{} @@ -40,40 +31,27 @@ func (c *Client) ListAWSDefaultServiceQuotas(ctx context.Context, params *ListAW type ListAWSDefaultServiceQuotasInput struct { - // Specifies the service that you want to use. + // The service identifier. // // This member is required. ServiceCode *string - // (Optional) Limits the number of results that you want to include in the - // response. If you don't include this parameter, the response defaults to a value - // that's specific to the operation. If additional items exist beyond the specified - // maximum, the NextToken element is present and has a value (isn't null). Include - // that value as the NextToken request parameter in the call to the operation to - // get the next part of the results. You should check NextToken after every - // operation to ensure that you receive all of the results. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, if any, make another call with the token returned from this + // call. MaxResults *int32 - // (Optional) Use this parameter in a request if you receive a NextToken response - // in a previous request that indicates that there's more output available. In a - // subsequent call, set it to the value of the previous call's NextToken response - // to indicate where the output should continue from. If additional items exist - // beyond the specified maximum, the NextToken element is present and has a value - // (isn't null). Include that value as the NextToken request parameter in the call - // to the operation to get the next part of the results. You should check NextToken - // after every operation to ensure that you receive all of the results. + // The token for the next page of results. NextToken *string } type ListAWSDefaultServiceQuotasOutput struct { - // (Optional) Use this parameter in a request if you receive a NextToken response - // in a previous request that indicates that there's more output available. In a - // subsequent call, set it to the value of the previous call's NextToken response - // to indicate where the output should continue from. + // The token to use to retrieve the next page of results. This value is null when + // there are no more results to return. NextToken *string - // A list of the quotas in the account with the AWS default values. + // Information about the quotas. Quotas []types.ServiceQuota // Metadata pertaining to the operation's result. @@ -151,13 +129,9 @@ var _ ListAWSDefaultServiceQuotasAPIClient = (*Client)(nil) // ListAWSDefaultServiceQuotasPaginatorOptions is the paginator options for // ListAWSDefaultServiceQuotas type ListAWSDefaultServiceQuotasPaginatorOptions struct { - // (Optional) Limits the number of results that you want to include in the - // response. If you don't include this parameter, the response defaults to a value - // that's specific to the operation. If additional items exist beyond the specified - // maximum, the NextToken element is present and has a value (isn't null). Include - // that value as the NextToken request parameter in the call to the operation to - // get the next part of the results. You should check NextToken after every - // operation to ensure that you receive all of the results. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, if any, make another call with the token returned from this + // call. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistory.go b/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistory.go index 5d65fb1668c..5dcd9054065 100644 --- a/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistory.go +++ b/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistory.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Requests a list of the changes to quotas for a service. +// Retrieves the quota increase requests for the specified service. func (c *Client) ListRequestedServiceQuotaChangeHistory(ctx context.Context, params *ListRequestedServiceQuotaChangeHistoryInput, optFns ...func(*Options)) (*ListRequestedServiceQuotaChangeHistoryOutput, error) { if params == nil { params = &ListRequestedServiceQuotaChangeHistoryInput{} @@ -30,40 +30,28 @@ func (c *Client) ListRequestedServiceQuotaChangeHistory(ctx context.Context, par type ListRequestedServiceQuotaChangeHistoryInput struct { - // (Optional) Limits the number of results that you want to include in the - // response. If you don't include this parameter, the response defaults to a value - // that's specific to the operation. If additional items exist beyond the specified - // maximum, the NextToken element is present and has a value (isn't null). Include - // that value as the NextToken request parameter in the call to the operation to - // get the next part of the results. You should check NextToken after every - // operation to ensure that you receive all of the results. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, if any, make another call with the token returned from this + // call. MaxResults *int32 - // (Optional) Use this parameter in a request if you receive a NextToken response - // in a previous request that indicates that there's more output available. In a - // subsequent call, set it to the value of the previous call's NextToken response - // to indicate where the output should continue from. + // The token for the next page of results. NextToken *string - // Specifies the service that you want to use. + // The service identifier. ServiceCode *string - // Specifies the status value of the quota increase request. + // The status of the quota increase request. Status types.RequestStatus } type ListRequestedServiceQuotaChangeHistoryOutput struct { - // If present in the response, this value indicates there's more output available - // that what's included in the current response. This can occur even when the - // response includes no values at all, such as when you ask for a filtered view of - // a very long list. Use this value in the NextToken request parameter in a - // subsequent call to the operation to continue processing and get the next part of - // the output. You should repeat this until the NextToken response element comes - // back empty (as null). + // The token to use to retrieve the next page of results. This value is null when + // there are no more results to return. NextToken *string - // Returns a list of service quota requests. + // Information about the quota increase requests. RequestedQuotas []types.RequestedServiceQuotaChange // Metadata pertaining to the operation's result. @@ -138,13 +126,9 @@ var _ ListRequestedServiceQuotaChangeHistoryAPIClient = (*Client)(nil) // ListRequestedServiceQuotaChangeHistoryPaginatorOptions is the paginator options // for ListRequestedServiceQuotaChangeHistory type ListRequestedServiceQuotaChangeHistoryPaginatorOptions struct { - // (Optional) Limits the number of results that you want to include in the - // response. If you don't include this parameter, the response defaults to a value - // that's specific to the operation. If additional items exist beyond the specified - // maximum, the NextToken element is present and has a value (isn't null). Include - // that value as the NextToken request parameter in the call to the operation to - // get the next part of the results. You should check NextToken after every - // operation to ensure that you receive all of the results. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, if any, make another call with the token returned from this + // call. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistoryByQuota.go b/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistoryByQuota.go index a1aab502fe1..0c3df13e6bd 100644 --- a/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistoryByQuota.go +++ b/service/servicequotas/api_op_ListRequestedServiceQuotaChangeHistoryByQuota.go @@ -12,10 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Requests a list of the changes to specific service quotas. This command provides -// additional granularity over the ListRequestedServiceQuotaChangeHistory command. -// Once a quota change request has reached CASE_CLOSED, APPROVED, or DENIED, the -// history has been kept for 90 days. +// Retrieves the quota increase requests for the specified quota. func (c *Client) ListRequestedServiceQuotaChangeHistoryByQuota(ctx context.Context, params *ListRequestedServiceQuotaChangeHistoryByQuotaInput, optFns ...func(*Options)) (*ListRequestedServiceQuotaChangeHistoryByQuotaOutput, error) { if params == nil { params = &ListRequestedServiceQuotaChangeHistoryByQuotaInput{} @@ -33,47 +30,35 @@ func (c *Client) ListRequestedServiceQuotaChangeHistoryByQuota(ctx context.Conte type ListRequestedServiceQuotaChangeHistoryByQuotaInput struct { - // Specifies the service quota that you want to use + // The quota identifier. // // This member is required. QuotaCode *string - // Specifies the service that you want to use. + // The service identifier. // // This member is required. ServiceCode *string - // (Optional) Limits the number of results that you want to include in the - // response. If you don't include this parameter, the response defaults to a value - // that's specific to the operation. If additional items exist beyond the specified - // maximum, the NextToken element is present and has a value (isn't null). Include - // that value as the NextToken request parameter in the call to the operation to - // get the next part of the results. You should check NextToken after every - // operation to ensure that you receive all of the results. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, if any, make another call with the token returned from this + // call. MaxResults *int32 - // (Optional) Use this parameter in a request if you receive a NextToken response - // in a previous request that indicates that there's more output available. In a - // subsequent call, set it to the value of the previous call's NextToken response - // to indicate where the output should continue from. + // The token for the next page of results. NextToken *string - // Specifies the status value of the quota increase request. + // The status value of the quota increase request. Status types.RequestStatus } type ListRequestedServiceQuotaChangeHistoryByQuotaOutput struct { - // If present in the response, this value indicates there's more output available - // that what's included in the current response. This can occur even when the - // response includes no values at all, such as when you ask for a filtered view of - // a very long list. Use this value in the NextToken request parameter in a - // subsequent call to the operation to continue processing and get the next part of - // the output. You should repeat this until the NextToken response element comes - // back empty (as null). + // The token to use to retrieve the next page of results. This value is null when + // there are no more results to return. NextToken *string - // Returns a list of service quota requests. + // Information about the quota increase requests. RequestedQuotas []types.RequestedServiceQuotaChange // Metadata pertaining to the operation's result. @@ -151,13 +136,9 @@ var _ ListRequestedServiceQuotaChangeHistoryByQuotaAPIClient = (*Client)(nil) // ListRequestedServiceQuotaChangeHistoryByQuotaPaginatorOptions is the paginator // options for ListRequestedServiceQuotaChangeHistoryByQuota type ListRequestedServiceQuotaChangeHistoryByQuotaPaginatorOptions struct { - // (Optional) Limits the number of results that you want to include in the - // response. If you don't include this parameter, the response defaults to a value - // that's specific to the operation. If additional items exist beyond the specified - // maximum, the NextToken element is present and has a value (isn't null). Include - // that value as the NextToken request parameter in the call to the operation to - // get the next part of the results. You should check NextToken after every - // operation to ensure that you receive all of the results. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, if any, make another call with the token returned from this + // call. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/servicequotas/api_op_ListServiceQuotaIncreaseRequestsInTemplate.go b/service/servicequotas/api_op_ListServiceQuotaIncreaseRequestsInTemplate.go index 5f398ce880d..7fa0f3fa4ca 100644 --- a/service/servicequotas/api_op_ListServiceQuotaIncreaseRequestsInTemplate.go +++ b/service/servicequotas/api_op_ListServiceQuotaIncreaseRequestsInTemplate.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a list of the quota increase requests in the template. +// Lists the quota increase requests in the specified quota request template. func (c *Client) ListServiceQuotaIncreaseRequestsInTemplate(ctx context.Context, params *ListServiceQuotaIncreaseRequestsInTemplateInput, optFns ...func(*Options)) (*ListServiceQuotaIncreaseRequestsInTemplateOutput, error) { if params == nil { params = &ListServiceQuotaIncreaseRequestsInTemplateInput{} @@ -30,41 +30,28 @@ func (c *Client) ListServiceQuotaIncreaseRequestsInTemplate(ctx context.Context, type ListServiceQuotaIncreaseRequestsInTemplateInput struct { - // Specifies the AWS Region for the quota that you want to use. + // The AWS Region. AwsRegion *string - // (Optional) Limits the number of results that you want to include in the - // response. If you don't include this parameter, the response defaults to a value - // that's specific to the operation. If additional items exist beyond the specified - // maximum, the NextToken element is present and has a value (isn't null). Include - // that value as the NextToken request parameter in the call to the operation to - // get the next part of the results. You should check NextToken after every - // operation to ensure that you receive all of the results. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, if any, make another call with the token returned from this + // call. MaxResults *int32 - // (Optional) Use this parameter in a request if you receive a NextToken response - // in a previous request that indicates that there's more output available. In a - // subsequent call, set it to the value of the previous call's NextToken response - // to indicate where the output should continue from. + // The token for the next page of results. NextToken *string - // The identifier for a service. When performing an operation, use the ServiceCode - // to specify a particular service. + // The service identifier. ServiceCode *string } type ListServiceQuotaIncreaseRequestsInTemplateOutput struct { - // If present in the response, this value indicates there's more output available - // that what's included in the current response. This can occur even when the - // response includes no values at all, such as when you ask for a filtered view of - // a very long list. Use this value in the NextToken request parameter in a - // subsequent call to the operation to continue processing and get the next part of - // the output. You should repeat this until the NextToken response element comes - // back empty (as null). + // The token to use to retrieve the next page of results. This value is null when + // there are no more results to return. NextToken *string - // Returns the list of values of the quota increase request in the template. + // Information about the quota increase requests. ServiceQuotaIncreaseRequestInTemplateList []types.ServiceQuotaIncreaseRequestInTemplate // Metadata pertaining to the operation's result. @@ -139,13 +126,9 @@ var _ ListServiceQuotaIncreaseRequestsInTemplateAPIClient = (*Client)(nil) // ListServiceQuotaIncreaseRequestsInTemplatePaginatorOptions is the paginator // options for ListServiceQuotaIncreaseRequestsInTemplate type ListServiceQuotaIncreaseRequestsInTemplatePaginatorOptions struct { - // (Optional) Limits the number of results that you want to include in the - // response. If you don't include this parameter, the response defaults to a value - // that's specific to the operation. If additional items exist beyond the specified - // maximum, the NextToken element is present and has a value (isn't null). Include - // that value as the NextToken request parameter in the call to the operation to - // get the next part of the results. You should check NextToken after every - // operation to ensure that you receive all of the results. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, if any, make another call with the token returned from this + // call. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/servicequotas/api_op_ListServiceQuotas.go b/service/servicequotas/api_op_ListServiceQuotas.go index b71562da5ee..3fef5628716 100644 --- a/service/servicequotas/api_op_ListServiceQuotas.go +++ b/service/servicequotas/api_op_ListServiceQuotas.go @@ -12,14 +12,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists all service quotas for the specified AWS service. This request returns a -// list of the service quotas for the specified service. you'll see the default -// values are the values that AWS provides for the quotas. Always check the -// NextToken response parameter when calling any of the List* operations. These -// operations can return an unexpected list of results, even when there are more -// results available. When this happens, the NextToken response parameter contains -// a value to pass the next call to the same API to request the next part of the -// list. +// Lists the applied quota values for the specified AWS service. For some quotas, +// only the default values are available. If the applied quota value is not +// available for a quota, the quota is not retrieved. func (c *Client) ListServiceQuotas(ctx context.Context, params *ListServiceQuotasInput, optFns ...func(*Options)) (*ListServiceQuotasOutput, error) { if params == nil { params = &ListServiceQuotasInput{} @@ -37,41 +32,27 @@ func (c *Client) ListServiceQuotas(ctx context.Context, params *ListServiceQuota type ListServiceQuotasInput struct { - // The identifier for a service. When performing an operation, use the ServiceCode - // to specify a particular service. + // The service identifier. // // This member is required. ServiceCode *string - // (Optional) Limits the number of results that you want to include in the - // response. If you don't include this parameter, the response defaults to a value - // that's specific to the operation. If additional items exist beyond the specified - // maximum, the NextToken element is present and has a value (isn't null). Include - // that value as the NextToken request parameter in the call to the operation to - // get the next part of the results. You should check NextToken after every - // operation to ensure that you receive all of the results. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, if any, make another call with the token returned from this + // call. MaxResults *int32 - // (Optional) Use this parameter in a request if you receive a NextToken response - // in a previous request that indicates that there's more output available. In a - // subsequent call, set it to the value of the previous call's NextToken response - // to indicate where the output should continue from. + // The token for the next page of results. NextToken *string } type ListServiceQuotasOutput struct { - // If present in the response, this value indicates there's more output available - // that what's included in the current response. This can occur even when the - // response includes no values at all, such as when you ask for a filtered view of - // a very long list. Use this value in the NextToken request parameter in a - // subsequent call to the operation to continue processing and get the next part of - // the output. You should repeat this until the NextToken response element comes - // back empty (as null). + // The token to use to retrieve the next page of results. This value is null when + // there are no more results to return. NextToken *string - // The response information for a quota lists all attribute information for the - // quota. + // Information about the quotas. Quotas []types.ServiceQuota // Metadata pertaining to the operation's result. @@ -148,13 +129,9 @@ var _ ListServiceQuotasAPIClient = (*Client)(nil) // ListServiceQuotasPaginatorOptions is the paginator options for ListServiceQuotas type ListServiceQuotasPaginatorOptions struct { - // (Optional) Limits the number of results that you want to include in the - // response. If you don't include this parameter, the response defaults to a value - // that's specific to the operation. If additional items exist beyond the specified - // maximum, the NextToken element is present and has a value (isn't null). Include - // that value as the NextToken request parameter in the call to the operation to - // get the next part of the results. You should check NextToken after every - // operation to ensure that you receive all of the results. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, if any, make another call with the token returned from this + // call. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/servicequotas/api_op_ListServices.go b/service/servicequotas/api_op_ListServices.go index 6f0a3852f7c..8db215a1796 100644 --- a/service/servicequotas/api_op_ListServices.go +++ b/service/servicequotas/api_op_ListServices.go @@ -12,9 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the AWS services available in Service Quotas. Not all AWS services are -// available in Service Quotas. To list the see the list of the service quotas for -// a specific service, use ListServiceQuotas. +// Lists the names and codes for the services integrated with Service Quotas. func (c *Client) ListServices(ctx context.Context, params *ListServicesInput, optFns ...func(*Options)) (*ListServicesOutput, error) { if params == nil { params = &ListServicesInput{} @@ -32,34 +30,22 @@ func (c *Client) ListServices(ctx context.Context, params *ListServicesInput, op type ListServicesInput struct { - // (Optional) Limits the number of results that you want to include in the - // response. If you don't include this parameter, the response defaults to a value - // that's specific to the operation. If additional items exist beyond the specified - // maximum, the NextToken element is present and has a value (isn't null). Include - // that value as the NextToken request parameter in the call to the operation to - // get the next part of the results. You should check NextToken after every - // operation to ensure that you receive all of the results. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, if any, make another call with the token returned from this + // call. MaxResults *int32 - // (Optional) Use this parameter in a request if you receive a NextToken response - // in a previous request that indicates that there's more output available. In a - // subsequent call, set it to the value of the previous call's NextToken response - // to indicate where the output should continue from. + // The token for the next page of results. NextToken *string } type ListServicesOutput struct { - // If present in the response, this value indicates there's more output available - // that what's included in the current response. This can occur even when the - // response includes no values at all, such as when you ask for a filtered view of - // a very long list. Use this value in the NextToken request parameter in a - // subsequent call to the operation to continue processing and get the next part of - // the output. You should repeat this until the NextToken response element comes - // back empty (as null). + // The token to use to retrieve the next page of results. This value is null when + // there are no more results to return. NextToken *string - // Returns a list of services. + // Information about the services. Services []types.ServiceInfo // Metadata pertaining to the operation's result. @@ -132,13 +118,9 @@ var _ ListServicesAPIClient = (*Client)(nil) // ListServicesPaginatorOptions is the paginator options for ListServices type ListServicesPaginatorOptions struct { - // (Optional) Limits the number of results that you want to include in the - // response. If you don't include this parameter, the response defaults to a value - // that's specific to the operation. If additional items exist beyond the specified - // maximum, the NextToken element is present and has a value (isn't null). Include - // that value as the NextToken request parameter in the call to the operation to - // get the next part of the results. You should check NextToken after every - // operation to ensure that you receive all of the results. + // The maximum number of results to return with a single call. To retrieve the + // remaining results, if any, make another call with the token returned from this + // call. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/servicequotas/api_op_ListTagsForResource.go b/service/servicequotas/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..2c45ba8914b --- /dev/null +++ b/service/servicequotas/api_op_ListTagsForResource.go @@ -0,0 +1,120 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package servicequotas + +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/servicequotas/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of the tags assigned to the specified applied quota. +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, addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The Amazon Resource Name (ARN) for the applied quota for which you want to list + // tags. You can get this information by using the Service Quotas console, or by + // listing the quotas using the list-service-quotas + // (https://docs.aws.amazon.com/cli/latest/reference/service-quotas/list-service-quotas.html) + // AWS CLI command or the ListServiceQuotas + // (https://docs.aws.amazon.com/servicequotas/2019-06-24/apireference/API_ListServiceQuotas.html) + // AWS API operation. + // + // This member is required. + ResourceARN *string +} + +type ListTagsForResourceOutput struct { + + // A complex data type that contains zero or more tag elements. + Tags []types.Tag + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "servicequotas", + OperationName: "ListTagsForResource", + } +} diff --git a/service/servicequotas/api_op_PutServiceQuotaIncreaseRequestIntoTemplate.go b/service/servicequotas/api_op_PutServiceQuotaIncreaseRequestIntoTemplate.go index 5b16a17f5f6..4fb174231bc 100644 --- a/service/servicequotas/api_op_PutServiceQuotaIncreaseRequestIntoTemplate.go +++ b/service/servicequotas/api_op_PutServiceQuotaIncreaseRequestIntoTemplate.go @@ -11,11 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Defines and adds a quota to the service quota template. To add a quota to the -// template, you must provide the ServiceCode, QuotaCode, AwsRegion, and -// DesiredValue. Once you add a quota to the template, use -// ListServiceQuotaIncreaseRequestsInTemplate to see the list of quotas in the -// template. +// Adds a quota increase request to your quota request template. func (c *Client) PutServiceQuotaIncreaseRequestIntoTemplate(ctx context.Context, params *PutServiceQuotaIncreaseRequestIntoTemplateInput, optFns ...func(*Options)) (*PutServiceQuotaIncreaseRequestIntoTemplateOutput, error) { if params == nil { params = &PutServiceQuotaIncreaseRequestIntoTemplateInput{} @@ -33,22 +29,22 @@ func (c *Client) PutServiceQuotaIncreaseRequestIntoTemplate(ctx context.Context, type PutServiceQuotaIncreaseRequestIntoTemplateInput struct { - // Specifies the AWS Region for the quota. + // The AWS Region. // // This member is required. AwsRegion *string - // Specifies the new, increased value for the quota. + // The new, increased value for the quota. // // This member is required. DesiredValue *float64 - // Specifies the service quota that you want to use. + // The quota identifier. // // This member is required. QuotaCode *string - // Specifies the service that you want to use. + // The service identifier. // // This member is required. ServiceCode *string @@ -56,7 +52,7 @@ type PutServiceQuotaIncreaseRequestIntoTemplateInput struct { type PutServiceQuotaIncreaseRequestIntoTemplateOutput struct { - // A structure that contains information about one service quota increase request. + // Information about the quota increase request. ServiceQuotaIncreaseRequestInTemplate *types.ServiceQuotaIncreaseRequestInTemplate // Metadata pertaining to the operation's result. diff --git a/service/servicequotas/api_op_RequestServiceQuotaIncrease.go b/service/servicequotas/api_op_RequestServiceQuotaIncrease.go index d2e6e63ce41..7ae27897538 100644 --- a/service/servicequotas/api_op_RequestServiceQuotaIncrease.go +++ b/service/servicequotas/api_op_RequestServiceQuotaIncrease.go @@ -11,8 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves the details of a service quota increase request. The response to this -// command provides the details in the RequestedServiceQuotaChange object. +// Submits a quota increase request for the specified quota. func (c *Client) RequestServiceQuotaIncrease(ctx context.Context, params *RequestServiceQuotaIncreaseInput, optFns ...func(*Options)) (*RequestServiceQuotaIncreaseOutput, error) { if params == nil { params = &RequestServiceQuotaIncreaseInput{} @@ -30,17 +29,17 @@ func (c *Client) RequestServiceQuotaIncrease(ctx context.Context, params *Reques type RequestServiceQuotaIncreaseInput struct { - // Specifies the value submitted in the service quota increase request. + // The new, increased value for the quota. // // This member is required. DesiredValue *float64 - // Specifies the service quota that you want to use. + // The quota identifier. // // This member is required. QuotaCode *string - // Specifies the service that you want to use. + // The service identifier. // // This member is required. ServiceCode *string @@ -48,7 +47,7 @@ type RequestServiceQuotaIncreaseInput struct { type RequestServiceQuotaIncreaseOutput struct { - // Returns a list of service quota requests. + // Information about the quota increase request. RequestedQuota *types.RequestedServiceQuotaChange // Metadata pertaining to the operation's result. diff --git a/service/servicequotas/api_op_TagResource.go b/service/servicequotas/api_op_TagResource.go new file mode 100644 index 00000000000..e590957e042 --- /dev/null +++ b/service/servicequotas/api_op_TagResource.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package servicequotas + +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/servicequotas/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds tags to the specified applied quota. You can include one or more tags to +// add to the quota. +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, addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The Amazon Resource Name (ARN) for the applied quota. You can get this + // information by using the Service Quotas console, or by listing the quotas using + // the list-service-quotas + // (https://docs.aws.amazon.com/cli/latest/reference/service-quotas/list-service-quotas.html) + // AWS CLI command or the ListServiceQuotas + // (https://docs.aws.amazon.com/servicequotas/2019-06-24/apireference/API_ListServiceQuotas.html) + // AWS API operation. + // + // This member is required. + ResourceARN *string + + // The tags that you want to add to the resource. + // + // This member is required. + Tags []types.Tag +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "servicequotas", + OperationName: "TagResource", + } +} diff --git a/service/servicequotas/api_op_UntagResource.go b/service/servicequotas/api_op_UntagResource.go new file mode 100644 index 00000000000..f4a485821e0 --- /dev/null +++ b/service/servicequotas/api_op_UntagResource.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package servicequotas + +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 specified applied quota. You can specify one or more tags +// to remove. +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, addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The Amazon Resource Name (ARN) for the applied quota that you want to untag. You + // can get this information by using the Service Quotas console, or by listing the + // quotas using the list-service-quotas + // (https://docs.aws.amazon.com/cli/latest/reference/service-quotas/list-service-quotas.html) + // AWS CLI command or the ListServiceQuotas + // (https://docs.aws.amazon.com/servicequotas/2019-06-24/apireference/API_ListServiceQuotas.html) + // AWS API operation. + // + // This member is required. + ResourceARN *string + + // The keys of the tags that you want to remove from the resource. + // + // This member is required. + TagKeys []string +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "servicequotas", + OperationName: "UntagResource", + } +} diff --git a/service/servicequotas/deserializers.go b/service/servicequotas/deserializers.go index 02cb2a5f008..1a96a791e18 100644 --- a/service/servicequotas/deserializers.go +++ b/service/servicequotas/deserializers.go @@ -1813,6 +1813,129 @@ func awsAwsjson11_deserializeOpErrorListServices(response *smithyhttp.Response, } } +type awsAwsjson11_deserializeOpListTagsForResource struct { +} + +func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("IllegalArgumentException", errorCode): + return awsAwsjson11_deserializeErrorIllegalArgumentException(response, errorBody) + + case strings.EqualFold("NoSuchResourceException", errorCode): + return awsAwsjson11_deserializeErrorNoSuchResourceException(response, errorBody) + + case strings.EqualFold("ServiceException", errorCode): + return awsAwsjson11_deserializeErrorServiceException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpPutServiceQuotaIncreaseRequestIntoTemplate struct { } @@ -2086,6 +2209,258 @@ func awsAwsjson11_deserializeOpErrorRequestServiceQuotaIncrease(response *smithy } } +type awsAwsjson11_deserializeOpTagResource struct { +} + +func (*awsAwsjson11_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("IllegalArgumentException", errorCode): + return awsAwsjson11_deserializeErrorIllegalArgumentException(response, errorBody) + + case strings.EqualFold("NoSuchResourceException", errorCode): + return awsAwsjson11_deserializeErrorNoSuchResourceException(response, errorBody) + + case strings.EqualFold("ServiceException", errorCode): + return awsAwsjson11_deserializeErrorServiceException(response, errorBody) + + case strings.EqualFold("TagPolicyViolationException", errorCode): + return awsAwsjson11_deserializeErrorTagPolicyViolationException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) + + case strings.EqualFold("TooManyTagsException", errorCode): + return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUntagResource struct { +} + +func (*awsAwsjson11_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("IllegalArgumentException", errorCode): + return awsAwsjson11_deserializeErrorIllegalArgumentException(response, errorBody) + + case strings.EqualFold("NoSuchResourceException", errorCode): + return awsAwsjson11_deserializeErrorNoSuchResourceException(response, errorBody) + + case strings.EqualFold("ServiceException", errorCode): + return awsAwsjson11_deserializeErrorServiceException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsAwsjson11_deserializeErrorTooManyRequestsException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + func awsAwsjson11_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2436,7 +2811,77 @@ func awsAwsjson11_deserializeErrorQuotaExceededException(response *smithyhttp.Re return output } -func awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ResourceAlreadyExistsException{} + err := awsAwsjson11_deserializeDocumentResourceAlreadyExistsException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorServiceException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ServiceException{} + err := awsAwsjson11_deserializeDocumentServiceException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorServiceQuotaTemplateNotInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2454,8 +2899,8 @@ func awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response *smith return err } - output := &types.ResourceAlreadyExistsException{} - err := awsAwsjson11_deserializeDocumentResourceAlreadyExistsException(&output, shape) + output := &types.ServiceQuotaTemplateNotInUseException{} + err := awsAwsjson11_deserializeDocumentServiceQuotaTemplateNotInUseException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -2471,7 +2916,7 @@ func awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response *smith return output } -func awsAwsjson11_deserializeErrorServiceException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorTagPolicyViolationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2489,8 +2934,8 @@ func awsAwsjson11_deserializeErrorServiceException(response *smithyhttp.Response return err } - output := &types.ServiceException{} - err := awsAwsjson11_deserializeDocumentServiceException(&output, shape) + output := &types.TagPolicyViolationException{} + err := awsAwsjson11_deserializeDocumentTagPolicyViolationException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -2506,7 +2951,7 @@ func awsAwsjson11_deserializeErrorServiceException(response *smithyhttp.Response return output } -func awsAwsjson11_deserializeErrorServiceQuotaTemplateNotInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorTemplatesNotAvailableInRegionException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2524,8 +2969,8 @@ func awsAwsjson11_deserializeErrorServiceQuotaTemplateNotInUseException(response return err } - output := &types.ServiceQuotaTemplateNotInUseException{} - err := awsAwsjson11_deserializeDocumentServiceQuotaTemplateNotInUseException(&output, shape) + output := &types.TemplatesNotAvailableInRegionException{} + err := awsAwsjson11_deserializeDocumentTemplatesNotAvailableInRegionException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -2541,7 +2986,7 @@ func awsAwsjson11_deserializeErrorServiceQuotaTemplateNotInUseException(response return output } -func awsAwsjson11_deserializeErrorTemplatesNotAvailableInRegionException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2559,8 +3004,8 @@ func awsAwsjson11_deserializeErrorTemplatesNotAvailableInRegionException(respons return err } - output := &types.TemplatesNotAvailableInRegionException{} - err := awsAwsjson11_deserializeDocumentTemplatesNotAvailableInRegionException(&output, shape) + output := &types.TooManyRequestsException{} + err := awsAwsjson11_deserializeDocumentTooManyRequestsException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -2576,7 +3021,7 @@ func awsAwsjson11_deserializeErrorTemplatesNotAvailableInRegionException(respons return output } -func awsAwsjson11_deserializeErrorTooManyRequestsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -2594,8 +3039,8 @@ func awsAwsjson11_deserializeErrorTooManyRequestsException(response *smithyhttp. return err } - output := &types.TooManyRequestsException{} - err := awsAwsjson11_deserializeDocumentTooManyRequestsException(&output, shape) + output := &types.TooManyTagsException{} + err := awsAwsjson11_deserializeDocumentTooManyTagsException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -3119,6 +3564,40 @@ func awsAwsjson11_deserializeDocumentOrganizationNotInAllFeaturesModeException(v return nil } +func awsAwsjson11_deserializeDocumentOutputTags(v *[]types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Tag + if *v == nil { + cv = []types.Tag{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Tag + destAddr := &col + if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentQuotaExceededException(v **types.QuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -3924,6 +4403,95 @@ func awsAwsjson11_deserializeDocumentServiceQuotaTemplateNotInUseException(v **t return nil } +func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Tag + if *v == nil { + sv = &types.Tag{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Key": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) + } + sv.Key = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentTagPolicyViolationException(v **types.TagPolicyViolationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TagPolicyViolationException + if *v == nil { + sv = &types.TagPolicyViolationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentTemplatesNotAvailableInRegionException(v **types.TemplatesNotAvailableInRegionException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4004,6 +4572,46 @@ func awsAwsjson11_deserializeDocumentTooManyRequestsException(v **types.TooManyR return nil } +func awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TooManyTagsException + if *v == nil { + sv = &types.TooManyTagsException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentAssociateServiceQuotaTemplateOutput(v **AssociateServiceQuotaTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4551,6 +5159,42 @@ func awsAwsjson11_deserializeOpDocumentListServicesOutput(v **ListServicesOutput return nil } +func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Tags": + if err := awsAwsjson11_deserializeDocumentOutputTags(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentPutServiceQuotaIncreaseRequestIntoTemplateOutput(v **PutServiceQuotaIncreaseRequestIntoTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -4622,3 +5266,65 @@ func awsAwsjson11_deserializeOpDocumentRequestServiceQuotaIncreaseOutput(v **Req *v = sv return nil } + +func awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *TagResourceOutput + if *v == nil { + sv = &TagResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UntagResourceOutput + if *v == nil { + sv = &UntagResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/servicequotas/doc.go b/service/servicequotas/doc.go index aa55106da18..938a774ba4e 100644 --- a/service/servicequotas/doc.go +++ b/service/servicequotas/doc.go @@ -3,16 +3,9 @@ // Package servicequotas provides the API client, operations, and parameter types // for Service Quotas. // -// Service Quotas is a web service that you can use to manage many of your AWS -// service quotas. Quotas, also referred to as limits, are the maximum values for a -// resource, item, or operation. This guide provide descriptions of the Service -// Quotas actions that you can call from an API. For the Service Quotas user guide, -// which explains how to use Service Quotas from the console, see What is Service -// Quotas (https://docs.aws.amazon.com/servicequotas/latest/userguide/intro.html). -// AWS provides SDKs that consist of libraries and sample code for programming -// languages and platforms (Java, Ruby, .NET, iOS, Android, etc...,). The SDKs -// provide a convenient way to create programmatic access to Service Quotas and -// AWS. For information about the AWS SDKs, including how to download and install -// them, see the Tools for Amazon Web Services -// (https://docs.aws.amazon.com/aws.amazon.com/tools) page. +// With Service Quotas, you can view and manage your quotas easily as your AWS +// workloads grow. Quotas, also referred to as limits, are the maximum number of +// resources that you can create in your AWS account. For more information, see the +// Service Quotas User Guide +// (https://docs.aws.amazon.com/servicequotas/latest/userguide/). package servicequotas diff --git a/service/servicequotas/serializers.go b/service/servicequotas/serializers.go index 74aa65e3186..2a953506828 100644 --- a/service/servicequotas/serializers.go +++ b/service/servicequotas/serializers.go @@ -6,6 +6,7 @@ import ( "bytes" "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/servicequotas/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" @@ -636,6 +637,52 @@ func (m *awsAwsjson11_serializeOpListServices) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpListTagsForResource struct { +} + +func (*awsAwsjson11_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("ServiceQuotasV20190624.ListTagsForResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpPutServiceQuotaIncreaseRequestIntoTemplate struct { } @@ -727,6 +774,139 @@ func (m *awsAwsjson11_serializeOpRequestServiceQuotaIncrease) HandleSerialize(ct return next.HandleSerialize(ctx, in) } + +type awsAwsjson11_serializeOpTagResource struct { +} + +func (*awsAwsjson11_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("ServiceQuotasV20190624.TagResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpUntagResource struct { +} + +func (*awsAwsjson11_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("ServiceQuotasV20190624.UntagResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsAwsjson11_serializeDocumentInputTagKeys(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentInputTags(v []types.Tag, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("Key") + ok.String(*v.Key) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentAssociateServiceQuotaTemplateInput(v *AssociateServiceQuotaTemplateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -985,6 +1165,18 @@ func awsAwsjson11_serializeOpDocumentListServicesInput(v *ListServicesInput, val return nil } +func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceARN != nil { + ok := object.Key("ResourceARN") + ok.String(*v.ResourceARN) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentPutServiceQuotaIncreaseRequestIntoTemplateInput(v *PutServiceQuotaIncreaseRequestIntoTemplateInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1033,3 +1225,41 @@ func awsAwsjson11_serializeOpDocumentRequestServiceQuotaIncreaseInput(v *Request return nil } + +func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceARN != nil { + ok := object.Key("ResourceARN") + ok.String(*v.ResourceARN) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson11_serializeDocumentInputTags(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceARN != nil { + ok := object.Key("ResourceARN") + ok.String(*v.ResourceARN) + } + + if v.TagKeys != nil { + ok := object.Key("TagKeys") + if err := awsAwsjson11_serializeDocumentInputTagKeys(v.TagKeys, ok); err != nil { + return err + } + } + + return nil +} diff --git a/service/servicequotas/types/errors.go b/service/servicequotas/types/errors.go index f944f26662c..05122d77533 100644 --- a/service/servicequotas/types/errors.go +++ b/service/servicequotas/types/errors.go @@ -7,7 +7,7 @@ import ( smithy "github.com/aws/smithy-go" ) -// You do not have sufficient access to perform this action. +// You do not have sufficient permission to perform this action. type AccessDeniedException struct { Message *string } @@ -25,8 +25,7 @@ func (e *AccessDeniedException) ErrorCode() string { return "AccessD func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // The action you attempted is not allowed unless Service Access with Service -// Quotas is enabled in your organization. To enable, call -// AssociateServiceQuotaTemplate. +// Quotas is enabled in your organization. type AWSServiceAccessNotEnabledException struct { Message *string } @@ -102,7 +101,7 @@ func (e *InvalidPaginationTokenException) ErrorCode() string { } func (e *InvalidPaginationTokenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// Invalid input was provided for the . +// The resource is in an invalid state. type InvalidResourceStateException struct { Message *string } @@ -155,9 +154,7 @@ func (e *NoSuchResourceException) ErrorMessage() string { func (e *NoSuchResourceException) ErrorCode() string { return "NoSuchResourceException" } func (e *NoSuchResourceException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The organization that your account belongs to, is not in All Features mode. To -// enable all features mode, see EnableAllFeatures -// (https://docs.aws.amazon.com/organizations/latest/APIReference/API_EnableAllFeatures.html). +// The organization that your account belongs to is not in All Features mode. type OrganizationNotInAllFeaturesModeException struct { Message *string } @@ -231,8 +228,7 @@ func (e *ServiceException) ErrorMessage() string { func (e *ServiceException) ErrorCode() string { return "ServiceException" } func (e *ServiceException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } -// The quota request template is not associated with your organization. To use the -// template, call AssociateServiceQuotaTemplate. +// The quota request template is not associated with your organization. type ServiceQuotaTemplateNotInUseException struct { Message *string } @@ -253,8 +249,24 @@ func (e *ServiceQuotaTemplateNotInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The Service Quotas template is not available in the Region where you are making -// the request. Please make the request in us-east-1. +// The specified tag is a reserved word and cannot be used. +type TagPolicyViolationException struct { + Message *string +} + +func (e *TagPolicyViolationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TagPolicyViolationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TagPolicyViolationException) ErrorCode() string { return "TagPolicyViolationException" } +func (e *TagPolicyViolationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The Service Quotas template is not available in this AWS Region. type TemplatesNotAvailableInRegionException struct { Message *string } @@ -292,3 +304,23 @@ func (e *TooManyRequestsException) ErrorMessage() string { } func (e *TooManyRequestsException) ErrorCode() string { return "TooManyRequestsException" } func (e *TooManyRequestsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// You've exceeded the number of tags allowed for a resource. For more information, +// see Tag restrictions +// (https://docs.aws.amazon.com/servicequotas/latest/userguide/sq-tagging.html#sq-tagging-restrictions) +// in the Service Quotas User Guide. +type TooManyTagsException struct { + Message *string +} + +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 { return "TooManyTagsException" } +func (e *TooManyTagsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/servicequotas/types/types.go b/service/servicequotas/types/types.go index 9cb0b9d59f9..b1c3d65ea59 100644 --- a/service/servicequotas/types/types.go +++ b/service/servicequotas/types/types.go @@ -6,182 +6,196 @@ import ( "time" ) -// Returns an error that explains why the action did not succeed. +// An error that explains why an action did not succeed. type ErrorReason struct { - // Service Quotas returns the following error values. - // DEPENDENCY_ACCESS_DENIED_ERROR is returned when the caller does not have - // permission to call the service or service quota. To resolve the error, you need - // permission to access the service or service quota. DEPENDENCY_THROTTLING_ERROR - // is returned when the service being called is throttling Service Quotas. - // DEPENDENCY_SERVICE_ERROR is returned when the service being called has - // availability issues. SERVICE_QUOTA_NOT_AVAILABLE_ERROR is returned when there - // was an error in Service Quotas. + // Service Quotas returns the following error values: + // + // * + // DEPENDENCY_ACCESS_DENIED_ERROR - The caller does not have the required + // permissions to complete the action. To resolve the error, you must have + // permission to access the service or quota. + // + // * DEPENDENCY_THROTTLING_ERROR - The + // service is throttling Service Quotas. + // + // * DEPENDENCY_SERVICE_ERROR - The service + // is not available. + // + // * SERVICE_QUOTA_NOT_AVAILABLE_ERROR - There was an error in + // Service Quotas. ErrorCode ErrorCode - // The error message that provides more detail. + // The error message. ErrorMessage *string } -// A structure that uses CloudWatch metrics to gather data about the service quota. +// Information about the CloudWatch metric that reflects quota usage. type MetricInfo struct { - // A dimension is a name/value pair that is part of the identity of a metric. Every - // metric has specific characteristics that describe it, and you can think of - // dimensions as categories for those characteristics. These dimensions are part of - // the CloudWatch Metric Identity that measures usage against a particular service - // quota. + // The metric dimension. This is a name/value pair that is part of the identity of + // a metric. MetricDimensions map[string]string - // The name of the CloudWatch metric that measures usage of a service quota. This - // is a required field. + // The name of the metric. MetricName *string - // The namespace of the metric. The namespace is a container for CloudWatch - // metrics. You can specify a name for the namespace when you create a metric. + // The namespace of the metric. MetricNamespace *string - // Statistics are metric data aggregations over specified periods of time. This is - // the recommended statistic to use when comparing usage in the CloudWatch Metric - // against your Service Quota. + // The metric statistic that we recommend you use when determining quota usage. MetricStatisticRecommendation *string } -// A structure that contains information about the quota period. +// Information about the quota period. type QuotaPeriod struct { - // The time unit of a period. + // The time unit. PeriodUnit PeriodUnit - // The value of a period. + // The value. PeriodValue *int32 } -// A structure that contains information about a requested change for a quota. +// Information about a quota increase request. type RequestedServiceQuotaChange struct { - // The case Id for the service quota increase request. + // The case ID. CaseId *string - // The date and time when the service quota increase request was received and the - // case Id was created. + // The date and time when the quota increase request was received and the case ID + // was created. Created *time.Time - // New increased value for the service quota. + // The new, increased value for the quota. DesiredValue *float64 - // Identifies if the quota is global. + // Indicates whether the quota is global. GlobalQuota bool - // The unique identifier of a requested service quota change. + // The unique identifier. Id *string - // The date and time of the most recent change in the service quota increase - // request. + // The date and time of the most recent change. LastUpdated *time.Time - // The Amazon Resource Name (ARN) of the service quota. + // The Amazon Resource Name (ARN) of the quota. QuotaArn *string - // Specifies the service quota that you want to use. + // The quota identifier. QuotaCode *string - // Name of the service quota. + // The quota name. QuotaName *string - // The IAM identity who submitted the service quota increase request. + // The IAM identity of the requester. Requester *string - // Specifies the service that you want to use. + // The service identifier. ServiceCode *string - // The name of the AWS service specified in the increase request. + // The service name. ServiceName *string - // State of the service quota increase request. + // The state of the quota increase request. Status RequestStatus - // Specifies the unit used for the quota. + // The unit of measurement. Unit *string } -// A structure that contains the ServiceName and ServiceCode. It does not include -// all details of the service quota. To get those values, use the ListServiceQuotas -// operation. +// Information about a service. type ServiceInfo struct { - // Specifies the service that you want to use. + // The service identifier. ServiceCode *string - // The name of the AWS service specified in the increase request. + // The service name. ServiceName *string } -// A structure that contains the full set of details that define the service quota. +// Information about a quota. type ServiceQuota struct { - // Specifies if the quota value can be increased. + // Indicates whether the quota value can be increased. Adjustable bool - // Specifies the ErrorCode and ErrorMessage when success isn't achieved. + // The error code and error reason. ErrorReason *ErrorReason - // Specifies if the quota is global. + // Indicates whether the quota is global. GlobalQuota bool - // Identifies the unit and value of how time is measured. + // The period of time. Period *QuotaPeriod - // The Amazon Resource Name (ARN) of the service quota. + // The Amazon Resource Name (ARN) of the quota. QuotaArn *string - // The code identifier for the service quota specified. + // The quota identifier. QuotaCode *string - // The name identifier of the service quota. + // The quota name. QuotaName *string - // Specifies the service that you want to use. + // The service identifier. ServiceCode *string - // The name of the AWS service specified in the increase request. + // The service name. ServiceName *string - // The unit of measurement for the value of the service quota. + // The unit of measurement. Unit *string - // Specifies the details about the measurement. + // Information about the measurement. UsageMetric *MetricInfo - // The value of service quota. + // The quota value. Value *float64 } -// A structure that contains information about one service quota increase request. +// Information about a quota increase request. type ServiceQuotaIncreaseRequestInTemplate struct { - // The AWS Region where the increase request occurs. + // The AWS Region. AwsRegion *string - // Identifies the new, increased value of the service quota in the increase - // request. + // The new, increased value of the quota. DesiredValue *float64 - // Specifies if the quota is a global quota. + // Indicates whether the quota is global. GlobalQuota bool - // The code identifier for the service quota specified in the increase request. + // The quota identifier. QuotaCode *string - // The name of the service quota in the increase request. + // The quota name. QuotaName *string - // The code identifier for the AWS service specified in the increase request. + // The service identifier. ServiceCode *string - // The name of the AWS service specified in the increase request. + // The service name. ServiceName *string - // The unit of measure for the increase request. + // The unit of measurement. Unit *string } + +// A complex data type that contains a tag key and tag value. +type Tag struct { + + // A string that contains a tag key. The string length should be between 1 and 128 + // characters. Valid characters include a-z, A-Z, 0-9, space, and the special + // characters _ - . : / = + @. + // + // This member is required. + Key *string + + // A string that contains an optional tag value. The string length should be + // between 0 and 256 characters. Valid characters include a-z, A-Z, 0-9, space, and + // the special characters _ - . : / = + @. + // + // This member is required. + Value *string +} diff --git a/service/servicequotas/validators.go b/service/servicequotas/validators.go index 14cc2cff28a..a6496124924 100644 --- a/service/servicequotas/validators.go +++ b/service/servicequotas/validators.go @@ -5,6 +5,7 @@ package servicequotas import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/servicequotas/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) @@ -169,6 +170,26 @@ func (m *validateOpListServiceQuotas) HandleInitialize(ctx context.Context, in m 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 validateOpPutServiceQuotaIncreaseRequestIntoTemplate struct { } @@ -209,6 +230,46 @@ func (m *validateOpRequestServiceQuotaIncrease) HandleInitialize(ctx context.Con return next.HandleInitialize(ctx, in) } +type validateOpTagResource struct { +} + +func (*validateOpTagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUntagResource struct { +} + +func (*validateOpUntagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUntagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + func addOpDeleteServiceQuotaIncreaseRequestFromTemplateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteServiceQuotaIncreaseRequestFromTemplate{}, middleware.After) } @@ -241,6 +302,10 @@ func addOpListServiceQuotasValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListServiceQuotas{}, middleware.After) } +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + func addOpPutServiceQuotaIncreaseRequestIntoTemplateValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutServiceQuotaIncreaseRequestIntoTemplate{}, middleware.After) } @@ -249,6 +314,49 @@ func addOpRequestServiceQuotaIncreaseValidationMiddleware(stack *middleware.Stac return stack.Initialize.Add(&validateOpRequestServiceQuotaIncrease{}, 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 validateInputTags(v []types.Tag) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "InputTags"} + 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 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 validateOpDeleteServiceQuotaIncreaseRequestFromTemplateInput(v *DeleteServiceQuotaIncreaseRequestFromTemplateInput) error { if v == nil { return nil @@ -390,6 +498,21 @@ func validateOpListServiceQuotasInput(v *ListServiceQuotasInput) error { } } +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 validateOpPutServiceQuotaIncreaseRequestIntoTemplateInput(v *PutServiceQuotaIncreaseRequestIntoTemplateInput) error { if v == nil { return nil @@ -434,3 +557,43 @@ func validateOpRequestServiceQuotaIncreaseInput(v *RequestServiceQuotaIncreaseIn 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 := validateInputTags(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 + } +} diff --git a/service/ses/types/enums.go b/service/ses/types/enums.go index 97a8d143fb5..109fdaff017 100644 --- a/service/ses/types/enums.go +++ b/service/ses/types/enums.go @@ -208,6 +208,12 @@ func (EventType) Values() []EventType { type IdentityType string +// Enum values for IdentityType +const ( + IdentityTypeEmailaddress IdentityType = "EmailAddress" + IdentityTypeDomain IdentityType = "Domain" +) + // Values returns all known values for IdentityType. 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. @@ -220,6 +226,12 @@ func (IdentityType) Values() []IdentityType { type InvocationType string +// Enum values for InvocationType +const ( + InvocationTypeEvent InvocationType = "Event" + InvocationTypeRequestresponse InvocationType = "RequestResponse" +) + // Values returns all known values for InvocationType. 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. @@ -232,6 +244,13 @@ func (InvocationType) Values() []InvocationType { type NotificationType string +// Enum values for NotificationType +const ( + NotificationTypeBounce NotificationType = "Bounce" + NotificationTypeComplaint NotificationType = "Complaint" + NotificationTypeDelivery NotificationType = "Delivery" +) + // Values returns all known values for NotificationType. 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. @@ -315,6 +334,15 @@ func (TlsPolicy) Values() []TlsPolicy { type VerificationStatus string +// Enum values for VerificationStatus +const ( + VerificationStatusPending VerificationStatus = "Pending" + VerificationStatusSuccess VerificationStatus = "Success" + VerificationStatusFailed VerificationStatus = "Failed" + VerificationStatusTemporaryfailure VerificationStatus = "TemporaryFailure" + VerificationStatusNotstarted VerificationStatus = "NotStarted" +) + // Values returns all known values for VerificationStatus. 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. diff --git a/service/sfn/types/enums.go b/service/sfn/types/enums.go index 571053956a0..ca503ba6d27 100644 --- a/service/sfn/types/enums.go +++ b/service/sfn/types/enums.go @@ -4,6 +4,15 @@ package types type ExecutionStatus string +// Enum values for ExecutionStatus +const ( + ExecutionStatusRunning ExecutionStatus = "RUNNING" + ExecutionStatusSucceeded ExecutionStatus = "SUCCEEDED" + ExecutionStatusFailed ExecutionStatus = "FAILED" + ExecutionStatusTimedOut ExecutionStatus = "TIMED_OUT" + ExecutionStatusAborted ExecutionStatus = "ABORTED" +) + // Values returns all known values for ExecutionStatus. Note that this can be // expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. @@ -19,6 +28,65 @@ func (ExecutionStatus) Values() []ExecutionStatus { type HistoryEventType string +// Enum values for HistoryEventType +const ( + HistoryEventTypeActivityfailed HistoryEventType = "ActivityFailed" + HistoryEventTypeActivityscheduled HistoryEventType = "ActivityScheduled" + HistoryEventTypeActivityschedulefailed HistoryEventType = "ActivityScheduleFailed" + HistoryEventTypeActivitystarted HistoryEventType = "ActivityStarted" + HistoryEventTypeActivitysucceeded HistoryEventType = "ActivitySucceeded" + HistoryEventTypeActivitytimedout HistoryEventType = "ActivityTimedOut" + HistoryEventTypeChoicestateentered HistoryEventType = "ChoiceStateEntered" + HistoryEventTypeChoicestateexited HistoryEventType = "ChoiceStateExited" + HistoryEventTypeExecutionaborted HistoryEventType = "ExecutionAborted" + HistoryEventTypeExecutionfailed HistoryEventType = "ExecutionFailed" + HistoryEventTypeExecutionstarted HistoryEventType = "ExecutionStarted" + HistoryEventTypeExecutionsucceeded HistoryEventType = "ExecutionSucceeded" + HistoryEventTypeExecutiontimedout HistoryEventType = "ExecutionTimedOut" + HistoryEventTypeFailstateentered HistoryEventType = "FailStateEntered" + HistoryEventTypeLambdafunctionfailed HistoryEventType = "LambdaFunctionFailed" + HistoryEventTypeLambdafunctionscheduled HistoryEventType = "LambdaFunctionScheduled" + HistoryEventTypeLambdafunctionschedulefailed HistoryEventType = "LambdaFunctionScheduleFailed" + HistoryEventTypeLambdafunctionstarted HistoryEventType = "LambdaFunctionStarted" + HistoryEventTypeLambdafunctionstartfailed HistoryEventType = "LambdaFunctionStartFailed" + HistoryEventTypeLambdafunctionsucceeded HistoryEventType = "LambdaFunctionSucceeded" + HistoryEventTypeLambdafunctiontimedout HistoryEventType = "LambdaFunctionTimedOut" + HistoryEventTypeMapiterationaborted HistoryEventType = "MapIterationAborted" + HistoryEventTypeMapiterationfailed HistoryEventType = "MapIterationFailed" + HistoryEventTypeMapiterationstarted HistoryEventType = "MapIterationStarted" + HistoryEventTypeMapiterationsucceeded HistoryEventType = "MapIterationSucceeded" + HistoryEventTypeMapstateaborted HistoryEventType = "MapStateAborted" + HistoryEventTypeMapstateentered HistoryEventType = "MapStateEntered" + HistoryEventTypeMapstateexited HistoryEventType = "MapStateExited" + HistoryEventTypeMapstatefailed HistoryEventType = "MapStateFailed" + HistoryEventTypeMapstatestarted HistoryEventType = "MapStateStarted" + HistoryEventTypeMapstatesucceeded HistoryEventType = "MapStateSucceeded" + HistoryEventTypeParallelstateaborted HistoryEventType = "ParallelStateAborted" + HistoryEventTypeParallelstateentered HistoryEventType = "ParallelStateEntered" + HistoryEventTypeParallelstateexited HistoryEventType = "ParallelStateExited" + HistoryEventTypeParallelstatefailed HistoryEventType = "ParallelStateFailed" + HistoryEventTypeParallelstatestarted HistoryEventType = "ParallelStateStarted" + HistoryEventTypeParallelstatesucceeded HistoryEventType = "ParallelStateSucceeded" + HistoryEventTypePassstateentered HistoryEventType = "PassStateEntered" + HistoryEventTypePassstateexited HistoryEventType = "PassStateExited" + HistoryEventTypeSucceedstateentered HistoryEventType = "SucceedStateEntered" + HistoryEventTypeSucceedstateexited HistoryEventType = "SucceedStateExited" + HistoryEventTypeTaskfailed HistoryEventType = "TaskFailed" + HistoryEventTypeTaskscheduled HistoryEventType = "TaskScheduled" + HistoryEventTypeTaskstarted HistoryEventType = "TaskStarted" + HistoryEventTypeTaskstartfailed HistoryEventType = "TaskStartFailed" + HistoryEventTypeTaskstateaborted HistoryEventType = "TaskStateAborted" + HistoryEventTypeTaskstateentered HistoryEventType = "TaskStateEntered" + HistoryEventTypeTaskstateexited HistoryEventType = "TaskStateExited" + HistoryEventTypeTasksubmitfailed HistoryEventType = "TaskSubmitFailed" + HistoryEventTypeTasksubmitted HistoryEventType = "TaskSubmitted" + HistoryEventTypeTasksucceeded HistoryEventType = "TaskSucceeded" + HistoryEventTypeTasktimedout HistoryEventType = "TaskTimedOut" + HistoryEventTypeWaitstateaborted HistoryEventType = "WaitStateAborted" + HistoryEventTypeWaitstateentered HistoryEventType = "WaitStateEntered" + HistoryEventTypeWaitstateexited HistoryEventType = "WaitStateExited" +) + // Values returns all known values for HistoryEventType. Note that this can be // expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. @@ -84,6 +152,14 @@ func (HistoryEventType) Values() []HistoryEventType { type LogLevel string +// Enum values for LogLevel +const ( + LogLevelAll LogLevel = "ALL" + LogLevelError LogLevel = "ERROR" + LogLevelFatal LogLevel = "FATAL" + LogLevelOff LogLevel = "OFF" +) + // Values returns all known values for LogLevel. Note that this can be expanded in // the future, and so it is only as up to date as the client. The ordering of this // slice is not guaranteed to be stable across updates. @@ -98,6 +174,12 @@ func (LogLevel) Values() []LogLevel { type StateMachineStatus string +// Enum values for StateMachineStatus +const ( + StateMachineStatusActive StateMachineStatus = "ACTIVE" + StateMachineStatusDeleting StateMachineStatus = "DELETING" +) + // Values returns all known values for StateMachineStatus. Note that this can be // expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. @@ -110,6 +192,12 @@ func (StateMachineStatus) Values() []StateMachineStatus { type StateMachineType string +// Enum values for StateMachineType +const ( + StateMachineTypeStandard StateMachineType = "STANDARD" + StateMachineTypeExpress StateMachineType = "EXPRESS" +) + // Values returns all known values for StateMachineType. Note that this can be // expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. @@ -122,6 +210,13 @@ func (StateMachineType) Values() []StateMachineType { type SyncExecutionStatus string +// Enum values for SyncExecutionStatus +const ( + SyncExecutionStatusSucceeded SyncExecutionStatus = "SUCCEEDED" + SyncExecutionStatusFailed SyncExecutionStatus = "FAILED" + SyncExecutionStatusTimedOut SyncExecutionStatus = "TIMED_OUT" +) + // Values returns all known values for SyncExecutionStatus. Note that this can be // expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. diff --git a/service/signer/types/enums.go b/service/signer/types/enums.go index 8a4f1bbebe9..001ce62fb39 100644 --- a/service/signer/types/enums.go +++ b/service/signer/types/enums.go @@ -4,6 +4,11 @@ package types type Category string +// Enum values for Category +const ( + CategoryAwsiot Category = "AWSIoT" +) + // Values returns all known values for Category. 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. @@ -15,6 +20,12 @@ func (Category) Values() []Category { type EncryptionAlgorithm string +// Enum values for EncryptionAlgorithm +const ( + EncryptionAlgorithmRsa EncryptionAlgorithm = "RSA" + EncryptionAlgorithmEcdsa EncryptionAlgorithm = "ECDSA" +) + // Values returns all known values for EncryptionAlgorithm. 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. @@ -27,6 +38,12 @@ func (EncryptionAlgorithm) Values() []EncryptionAlgorithm { type HashAlgorithm string +// Enum values for HashAlgorithm +const ( + HashAlgorithmSha1 HashAlgorithm = "SHA1" + HashAlgorithmSha256 HashAlgorithm = "SHA256" +) + // Values returns all known values for HashAlgorithm. 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. @@ -39,6 +56,13 @@ func (HashAlgorithm) Values() []HashAlgorithm { type ImageFormat string +// Enum values for ImageFormat +const ( + ImageFormatJson ImageFormat = "JSON" + ImageFormatJsonembedded ImageFormat = "JSONEmbedded" + ImageFormatJsondetached ImageFormat = "JSONDetached" +) + // Values returns all known values for ImageFormat. 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. @@ -52,6 +76,13 @@ func (ImageFormat) Values() []ImageFormat { type SigningProfileStatus string +// Enum values for SigningProfileStatus +const ( + SigningProfileStatusActive SigningProfileStatus = "Active" + SigningProfileStatusCanceled SigningProfileStatus = "Canceled" + SigningProfileStatusRevoked SigningProfileStatus = "Revoked" +) + // Values returns all known values for SigningProfileStatus. 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. @@ -65,6 +96,13 @@ func (SigningProfileStatus) Values() []SigningProfileStatus { type SigningStatus string +// Enum values for SigningStatus +const ( + SigningStatusInprogress SigningStatus = "InProgress" + SigningStatusFailed SigningStatus = "Failed" + SigningStatusSucceeded SigningStatus = "Succeeded" +) + // Values returns all known values for SigningStatus. 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. @@ -78,6 +116,13 @@ func (SigningStatus) Values() []SigningStatus { type ValidityType string +// Enum values for ValidityType +const ( + ValidityTypeDays ValidityType = "DAYS" + ValidityTypeMonths ValidityType = "MONTHS" + ValidityTypeYears ValidityType = "YEARS" +) + // Values returns all known values for ValidityType. 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. diff --git a/service/sqs/api_op_AddPermission.go b/service/sqs/api_op_AddPermission.go index e71864b7008..25efdc8199c 100644 --- a/service/sqs/api_op_AddPermission.go +++ b/service/sqs/api_op_AddPermission.go @@ -38,7 +38,7 @@ import ( // are integers starting from 1. For example, a parameter list with two elements // looks like this: &AttributeName.1=first&AttributeName.2=second Cross-account // permissions don't apply to this action. For more information, see Grant -// Cross-Account Permissions to a Role and a User Name +// cross-account permissions to a role and a user name // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) // in the Amazon Simple Queue Service Developer Guide. func (c *Client) AddPermission(ctx context.Context, params *AddPermissionInput, optFns ...func(*Options)) (*AddPermissionOutput, error) { diff --git a/service/sqs/api_op_CreateQueue.go b/service/sqs/api_op_CreateQueue.go index e110df74ce5..4e24a2241f3 100644 --- a/service/sqs/api_op_CreateQueue.go +++ b/service/sqs/api_op_CreateQueue.go @@ -50,7 +50,7 @@ import ( // are integers starting from 1. For example, a parameter list with two elements // looks like this: &AttributeName.1=first&AttributeName.2=second Cross-account // permissions don't apply to this action. For more information, see Grant -// Cross-Account Permissions to a Role and a User Name +// cross-account permissions to a role and a user name // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) // in the Amazon Simple Queue Service Developer Guide. func (c *Client) CreateQueue(ctx context.Context, params *CreateQueueInput, optFns ...func(*Options)) (*CreateQueueOutput, error) { @@ -170,49 +170,95 @@ type CreateQueueInput struct { // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html): // // * - // FifoQueue – Designates a queue as FIFO. Valid values: true, false. If you don't - // specify the FifoQueue attribute, Amazon SQS creates a standard queue. You can - // provide this attribute only during queue creation. You can't change it for an - // existing queue. When you set this attribute, you must also provide the + // FifoQueue – Designates a queue as FIFO. Valid values are true and false. If you + // don't specify the FifoQueue attribute, Amazon SQS creates a standard queue. You + // can provide this attribute only during queue creation. You can't change it for + // an existing queue. When you set this attribute, you must also provide the // MessageGroupId for your messages explicitly. For more information, see FIFO // Queue Logic // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-understanding-logic) // in the Amazon Simple Queue Service Developer Guide. // // * ContentBasedDeduplication - // – Enables content-based deduplication. Valid values: true, false. For more + // – Enables content-based deduplication. Valid values are true and false. For more // information, see Exactly-Once Processing // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing) - // in the Amazon Simple Queue Service Developer Guide. + // in the Amazon Simple Queue Service Developer Guide. Note the following: // - // * Every message must have a - // unique MessageDeduplicationId, + // * Every + // message must have a unique MessageDeduplicationId. // - // * You may provide a MessageDeduplicationId - // explicitly. + // * You may provide a + // MessageDeduplicationId explicitly. // - // * If you aren't able to provide a MessageDeduplicationId and you - // enable ContentBasedDeduplication for your queue, Amazon SQS uses a SHA-256 hash - // to generate the MessageDeduplicationId using the body of the message (but not - // the attributes of the message). + // * If you aren't able to provide a + // MessageDeduplicationId and you enable ContentBasedDeduplication for your queue, + // Amazon SQS uses a SHA-256 hash to generate the MessageDeduplicationId using the + // body of the message (but not the attributes of the message). // - // * If you don't provide a MessageDeduplicationId - // and the queue doesn't have ContentBasedDeduplication set, the action fails with - // an error. + // * If you don't + // provide a MessageDeduplicationId and the queue doesn't have + // ContentBasedDeduplication set, the action fails with an error. // - // * If the queue has ContentBasedDeduplication set, your - // MessageDeduplicationId overrides the generated one. + // * If the queue + // has ContentBasedDeduplication set, your MessageDeduplicationId overrides the + // generated one. // - // * When - // ContentBasedDeduplication is in effect, messages with identical content sent - // within the deduplication interval are treated as duplicates and only one copy of - // the message is delivered. + // * When ContentBasedDeduplication is in effect, messages with + // identical content sent within the deduplication interval are treated as + // duplicates and only one copy of the message is delivered. // - // * If you send one message with - // ContentBasedDeduplication enabled and then another message with a + // * If you send one + // message with ContentBasedDeduplication enabled and then another message with a // MessageDeduplicationId that is the same as the one generated for the first // MessageDeduplicationId, the two messages are treated as duplicates and only one // copy of the message is delivered. + // + // Preview: High throughput for FIFO queues High + // throughput for Amazon SQS FIFO queues is in preview release and is subject to + // change. This feature provides a high number of transactions per second (TPS) for + // messages in FIFO queues. For information on throughput quotas, see Quotas + // related to messages + // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) + // in the Amazon Simple Queue Service Developer Guide. This preview includes two + // new attributes: + // + // * DeduplicationScope – Specifies whether message deduplication + // occurs at the message group or queue level. Valid values are messageGroup and + // queue. + // + // * FifoThroughputLimit – Specifies whether the FIFO queue throughput + // quota applies to the entire queue or per message group. Valid values are + // perQueue and perMessageGroupId. The perMessageGroupId value is allowed only when + // the value for DeduplicationScope is messageGroup. + // + // To enable high throughput for + // FIFO queues, do the following: + // + // * Set DeduplicationScope to messageGroup. + // + // * Set + // FifoThroughputLimit to perMessageGroupId. + // + // If you set these attributes to + // anything other than the values shown for enabling high throughput, standard + // throughput is in effect and deduplication occurs as specified. This preview is + // available in the following AWS Regions: + // + // * US East (Ohio); us-east-2 + // + // * US East + // (N. Virginia); us-east-1 + // + // * US West (Oregon); us-west-2 + // + // * Europe (Ireland); + // eu-west-1 + // + // For more information about high throughput for FIFO queues, see + // Preview: High throughput for FIFO queues + // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html) + // in the Amazon Simple Queue Service Developer Guide. Attributes map[string]string // Add cost allocation tags to the specified Amazon SQS queue. For an overview, see @@ -238,7 +284,7 @@ type CreateQueueInput struct { // in the Amazon Simple Queue Service Developer Guide. To be able to tag a queue on // creation, you must have the sqs:CreateQueue and sqs:TagQueue permissions. // Cross-account permissions don't apply to this action. For more information, see - // Grant Cross-Account Permissions to a Role and a User Name + // Grant cross-account permissions to a role and a user name // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) // in the Amazon Simple Queue Service Developer Guide. Tags map[string]string diff --git a/service/sqs/api_op_DeleteQueue.go b/service/sqs/api_op_DeleteQueue.go index a8a6d753551..c0843326613 100644 --- a/service/sqs/api_op_DeleteQueue.go +++ b/service/sqs/api_op_DeleteQueue.go @@ -18,7 +18,7 @@ import ( // after 60 seconds the queue and the message you sent no longer exist. When you // delete a queue, you must wait at least 60 seconds before creating a queue with // the same name. Cross-account permissions don't apply to this action. For more -// information, see Grant Cross-Account Permissions to a Role and a User Name +// information, see Grant cross-account permissions to a role and a user name // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) // in the Amazon Simple Queue Service Developer Guide. func (c *Client) DeleteQueue(ctx context.Context, params *DeleteQueueInput, optFns ...func(*Options)) (*DeleteQueueOutput, error) { diff --git a/service/sqs/api_op_GetQueueAttributes.go b/service/sqs/api_op_GetQueueAttributes.go index f509f956167..2423f129359 100644 --- a/service/sqs/api_op_GetQueueAttributes.go +++ b/service/sqs/api_op_GetQueueAttributes.go @@ -135,8 +135,8 @@ type GetQueueAttributesInput struct { // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html): // // * - // FifoQueue – Returns whether the queue is FIFO. For more information, see FIFO - // Queue Logic + // FifoQueue – Returns information about whether the queue is FIFO. For more + // information, see FIFO Queue Logic // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-understanding-logic) // in the Amazon Simple Queue Service Developer Guide. To determine whether a queue // is FIFO @@ -148,6 +148,52 @@ type GetQueueAttributesInput struct { // enabled for the queue. For more information, see Exactly-Once Processing // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing) // in the Amazon Simple Queue Service Developer Guide. + // + // Preview: High throughput + // for FIFO queues High throughput for Amazon SQS FIFO queues is in preview release + // and is subject to change. This feature provides a high number of transactions + // per second (TPS) for messages in FIFO queues. For information on throughput + // quotas, see Quotas related to messages + // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) + // in the Amazon Simple Queue Service Developer Guide. This preview includes two + // new attributes: + // + // * DeduplicationScope – Specifies whether message deduplication + // occurs at the message group or queue level. Valid values are messageGroup and + // queue. + // + // * FifoThroughputLimit – Specifies whether the FIFO queue throughput + // quota applies to the entire queue or per message group. Valid values are + // perQueue and perMessageGroupId. The perMessageGroupId value is allowed only when + // the value for DeduplicationScope is messageGroup. + // + // To enable high throughput for + // FIFO queues, do the following: + // + // * Set DeduplicationScope to messageGroup. + // + // * Set + // FifoThroughputLimit to perMessageGroupId. + // + // If you set these attributes to + // anything other than the values shown for enabling high throughput, standard + // throughput is in effect and deduplication occurs as specified. This preview is + // available in the following AWS Regions: + // + // * US East (Ohio); us-east-2 + // + // * US East + // (N. Virginia); us-east-1 + // + // * US West (Oregon); us-west-2 + // + // * Europe (Ireland); + // eu-west-1 + // + // For more information about high throughput for FIFO queues, see + // Preview: High throughput for FIFO queues + // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html) + // in the Amazon Simple Queue Service Developer Guide. AttributeNames []types.QueueAttributeName } diff --git a/service/sqs/api_op_ListQueueTags.go b/service/sqs/api_op_ListQueueTags.go index 4ee8b842053..32470bea515 100644 --- a/service/sqs/api_op_ListQueueTags.go +++ b/service/sqs/api_op_ListQueueTags.go @@ -14,8 +14,8 @@ import ( // overview, see Tagging Your Amazon SQS Queues // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html) // in the Amazon Simple Queue Service Developer Guide. Cross-account permissions -// don't apply to this action. For more information, see Grant Cross-Account -// Permissions to a Role and a User Name +// don't apply to this action. For more information, see Grant cross-account +// permissions to a role and a user name // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) // in the Amazon Simple Queue Service Developer Guide. func (c *Client) ListQueueTags(ctx context.Context, params *ListQueueTagsInput, optFns ...func(*Options)) (*ListQueueTagsOutput, error) { diff --git a/service/sqs/api_op_ListQueues.go b/service/sqs/api_op_ListQueues.go index d2d3b620e28..faa3a16ae6c 100644 --- a/service/sqs/api_op_ListQueues.go +++ b/service/sqs/api_op_ListQueues.go @@ -21,7 +21,7 @@ import ( // results to display, the response includes a value for NextToken. Use NextToken // as a parameter in your next request to listQueues to receive the next page of // results. Cross-account permissions don't apply to this action. For more -// information, see Grant Cross-Account Permissions to a Role and a User Name +// information, see Grant cross-account permissions to a role and a user name // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) // in the Amazon Simple Queue Service Developer Guide. func (c *Client) ListQueues(ctx context.Context, params *ListQueuesInput, optFns ...func(*Options)) (*ListQueuesOutput, error) { diff --git a/service/sqs/api_op_RemovePermission.go b/service/sqs/api_op_RemovePermission.go index 697f64181c0..546020ffa3c 100644 --- a/service/sqs/api_op_RemovePermission.go +++ b/service/sqs/api_op_RemovePermission.go @@ -17,7 +17,7 @@ import ( // // * // Cross-account permissions don't apply to this action. For more information, see -// Grant Cross-Account Permissions to a Role and a User Name +// Grant cross-account permissions to a role and a user name // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) // in the Amazon Simple Queue Service Developer Guide. // diff --git a/service/sqs/api_op_SetQueueAttributes.go b/service/sqs/api_op_SetQueueAttributes.go index 9fcefc49396..5b659911abd 100644 --- a/service/sqs/api_op_SetQueueAttributes.go +++ b/service/sqs/api_op_SetQueueAttributes.go @@ -21,7 +21,7 @@ import ( // gracefully. // // * Cross-account permissions don't apply to this action. For more -// information, see Grant Cross-Account Permissions to a Role and a User Name +// information, see Grant cross-account permissions to a role and a user name // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) // in the Amazon Simple Queue Service Developer Guide. // @@ -132,37 +132,83 @@ type SetQueueAttributesInput struct { // ContentBasedDeduplication – Enables content-based deduplication. For more // information, see Exactly-Once Processing // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-exactly-once-processing) - // in the Amazon Simple Queue Service Developer Guide. + // in the Amazon Simple Queue Service Developer Guide. Note the following: // - // * Every message must have a - // unique MessageDeduplicationId, + // * Every + // message must have a unique MessageDeduplicationId. // - // * You may provide a MessageDeduplicationId - // explicitly. + // * You may provide a + // MessageDeduplicationId explicitly. // - // * If you aren't able to provide a MessageDeduplicationId and you - // enable ContentBasedDeduplication for your queue, Amazon SQS uses a SHA-256 hash - // to generate the MessageDeduplicationId using the body of the message (but not - // the attributes of the message). + // * If you aren't able to provide a + // MessageDeduplicationId and you enable ContentBasedDeduplication for your queue, + // Amazon SQS uses a SHA-256 hash to generate the MessageDeduplicationId using the + // body of the message (but not the attributes of the message). // - // * If you don't provide a MessageDeduplicationId - // and the queue doesn't have ContentBasedDeduplication set, the action fails with - // an error. + // * If you don't + // provide a MessageDeduplicationId and the queue doesn't have + // ContentBasedDeduplication set, the action fails with an error. // - // * If the queue has ContentBasedDeduplication set, your - // MessageDeduplicationId overrides the generated one. + // * If the queue + // has ContentBasedDeduplication set, your MessageDeduplicationId overrides the + // generated one. // - // * When - // ContentBasedDeduplication is in effect, messages with identical content sent - // within the deduplication interval are treated as duplicates and only one copy of - // the message is delivered. + // * When ContentBasedDeduplication is in effect, messages with + // identical content sent within the deduplication interval are treated as + // duplicates and only one copy of the message is delivered. // - // * If you send one message with - // ContentBasedDeduplication enabled and then another message with a + // * If you send one + // message with ContentBasedDeduplication enabled and then another message with a // MessageDeduplicationId that is the same as the one generated for the first // MessageDeduplicationId, the two messages are treated as duplicates and only one // copy of the message is delivered. // + // Preview: High throughput for FIFO queues High + // throughput for Amazon SQS FIFO queues is in preview release and is subject to + // change. This feature provides a high number of transactions per second (TPS) for + // messages in FIFO queues. For information on throughput quotas, see Quotas + // related to messages + // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/quotas-messages.html) + // in the Amazon Simple Queue Service Developer Guide. This preview includes two + // new attributes: + // + // * DeduplicationScope – Specifies whether message deduplication + // occurs at the message group or queue level. Valid values are messageGroup and + // queue. + // + // * FifoThroughputLimit – Specifies whether the FIFO queue throughput + // quota applies to the entire queue or per message group. Valid values are + // perQueue and perMessageGroupId. The perMessageGroupId value is allowed only when + // the value for DeduplicationScope is messageGroup. + // + // To enable high throughput for + // FIFO queues, do the following: + // + // * Set DeduplicationScope to messageGroup. + // + // * Set + // FifoThroughputLimit to perMessageGroupId. + // + // If you set these attributes to + // anything other than the values shown for enabling high throughput, standard + // throughput is in effect and deduplication occurs as specified. This preview is + // available in the following AWS Regions: + // + // * US East (Ohio); us-east-2 + // + // * US East + // (N. Virginia); us-east-1 + // + // * US West (Oregon); us-west-2 + // + // * Europe (Ireland); + // eu-west-1 + // + // For more information about high throughput for FIFO queues, see + // Preview: High throughput for FIFO queues + // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/high-throughput-fifo.html) + // in the Amazon Simple Queue Service Developer Guide. + // // This member is required. Attributes map[string]string diff --git a/service/sqs/api_op_TagQueue.go b/service/sqs/api_op_TagQueue.go index 0cac0cbd66d..83a47224fe6 100644 --- a/service/sqs/api_op_TagQueue.go +++ b/service/sqs/api_op_TagQueue.go @@ -31,8 +31,8 @@ import ( // For a full list of tag restrictions, see Limits Related to Queues // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-limits.html#limits-queues) // in the Amazon Simple Queue Service Developer Guide. Cross-account permissions -// don't apply to this action. For more information, see Grant Cross-Account -// Permissions to a Role and a User Name +// don't apply to this action. For more information, see Grant cross-account +// permissions to a role and a user name // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) // in the Amazon Simple Queue Service Developer Guide. func (c *Client) TagQueue(ctx context.Context, params *TagQueueInput, optFns ...func(*Options)) (*TagQueueOutput, error) { diff --git a/service/sqs/api_op_UntagQueue.go b/service/sqs/api_op_UntagQueue.go index 093f2de3817..39fca7fc81f 100644 --- a/service/sqs/api_op_UntagQueue.go +++ b/service/sqs/api_op_UntagQueue.go @@ -14,8 +14,8 @@ import ( // overview, see Tagging Your Amazon SQS Queues // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-queue-tags.html) // in the Amazon Simple Queue Service Developer Guide. Cross-account permissions -// don't apply to this action. For more information, see Grant Cross-Account -// Permissions to a Role and a User Name +// don't apply to this action. For more information, see Grant cross-account +// permissions to a role and a user name // (https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-customer-managed-policy-examples.html#grant-cross-account-permissions-to-role-and-user-name) // in the Amazon Simple Queue Service Developer Guide. func (c *Client) UntagQueue(ctx context.Context, params *UntagQueueInput, optFns ...func(*Options)) (*UntagQueueOutput, error) { diff --git a/service/sqs/types/enums.go b/service/sqs/types/enums.go index ec4525a23a9..1d69b6cfacd 100644 --- a/service/sqs/types/enums.go +++ b/service/sqs/types/enums.go @@ -4,6 +4,18 @@ package types type MessageSystemAttributeName string +// Enum values for MessageSystemAttributeName +const ( + MessageSystemAttributeNameSenderid MessageSystemAttributeName = "SenderId" + MessageSystemAttributeNameSenttimestamp MessageSystemAttributeName = "SentTimestamp" + MessageSystemAttributeNameApproximatereceivecount MessageSystemAttributeName = "ApproximateReceiveCount" + MessageSystemAttributeNameApproximatefirstreceivetimestamp MessageSystemAttributeName = "ApproximateFirstReceiveTimestamp" + MessageSystemAttributeNameSequencenumber MessageSystemAttributeName = "SequenceNumber" + MessageSystemAttributeNameMessagededuplicationid MessageSystemAttributeName = "MessageDeduplicationId" + MessageSystemAttributeNameMessagegroupid MessageSystemAttributeName = "MessageGroupId" + MessageSystemAttributeNameAwstraceheader MessageSystemAttributeName = "AWSTraceHeader" +) + // Values returns all known values for MessageSystemAttributeName. 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. @@ -22,6 +34,11 @@ func (MessageSystemAttributeName) Values() []MessageSystemAttributeName { type MessageSystemAttributeNameForSends string +// Enum values for MessageSystemAttributeNameForSends +const ( + MessageSystemAttributeNameForSendsAwstraceheader MessageSystemAttributeNameForSends = "AWSTraceHeader" +) + // Values returns all known values for MessageSystemAttributeNameForSends. 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 @@ -34,6 +51,30 @@ func (MessageSystemAttributeNameForSends) Values() []MessageSystemAttributeNameF type QueueAttributeName string +// Enum values for QueueAttributeName +const ( + QueueAttributeNameAll QueueAttributeName = "All" + QueueAttributeNamePolicy QueueAttributeName = "Policy" + QueueAttributeNameVisibilitytimeout QueueAttributeName = "VisibilityTimeout" + QueueAttributeNameMaximummessagesize QueueAttributeName = "MaximumMessageSize" + QueueAttributeNameMessageretentionperiod QueueAttributeName = "MessageRetentionPeriod" + QueueAttributeNameApproximatenumberofmessages QueueAttributeName = "ApproximateNumberOfMessages" + QueueAttributeNameApproximatenumberofmessagesnotvisible QueueAttributeName = "ApproximateNumberOfMessagesNotVisible" + QueueAttributeNameCreatedtimestamp QueueAttributeName = "CreatedTimestamp" + QueueAttributeNameLastmodifiedtimestamp QueueAttributeName = "LastModifiedTimestamp" + QueueAttributeNameQueuearn QueueAttributeName = "QueueArn" + QueueAttributeNameApproximatenumberofmessagesdelayed QueueAttributeName = "ApproximateNumberOfMessagesDelayed" + QueueAttributeNameDelayseconds QueueAttributeName = "DelaySeconds" + QueueAttributeNameReceivemessagewaittimeseconds QueueAttributeName = "ReceiveMessageWaitTimeSeconds" + QueueAttributeNameRedrivepolicy QueueAttributeName = "RedrivePolicy" + QueueAttributeNameFifoqueue QueueAttributeName = "FifoQueue" + QueueAttributeNameContentbaseddeduplication QueueAttributeName = "ContentBasedDeduplication" + QueueAttributeNameKmsmasterkeyid QueueAttributeName = "KmsMasterKeyId" + QueueAttributeNameKmsdatakeyreuseperiodseconds QueueAttributeName = "KmsDataKeyReusePeriodSeconds" + QueueAttributeNameDeduplicationscope QueueAttributeName = "DeduplicationScope" + QueueAttributeNameFifothroughputlimit QueueAttributeName = "FifoThroughputLimit" +) + // Values returns all known values for QueueAttributeName. 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. @@ -57,5 +98,7 @@ func (QueueAttributeName) Values() []QueueAttributeName { "ContentBasedDeduplication", "KmsMasterKeyId", "KmsDataKeyReusePeriodSeconds", + "DeduplicationScope", + "FifoThroughputLimit", } } diff --git a/service/ssm/api_op_CreateAssociation.go b/service/ssm/api_op_CreateAssociation.go index 9cb8927b6e5..308fc6a0ccd 100644 --- a/service/ssm/api_op_CreateAssociation.go +++ b/service/ssm/api_op_CreateAssociation.go @@ -125,6 +125,11 @@ type CreateAssociationInput struct { // use AUTO mode. SyncCompliance types.AssociationSyncCompliance + // A location is a combination of AWS Regions and AWS accounts where you want to + // run the association. Use this action to create an association in multiple + // Regions and multiple accounts. + TargetLocations []types.TargetLocation + // The targets for the association. You can target instances by using tags, AWS // Resource Groups, all instances in an AWS account, or individual instance IDs. // For more information about choosing targets for an association, see Using diff --git a/service/ssm/api_op_CreateMaintenanceWindow.go b/service/ssm/api_op_CreateMaintenanceWindow.go index dfbd42a31a4..a4f4fbbb95f 100644 --- a/service/ssm/api_op_CreateMaintenanceWindow.go +++ b/service/ssm/api_op_CreateMaintenanceWindow.go @@ -82,13 +82,13 @@ type CreateMaintenanceWindowInput struct { // The number of days to wait after the date and time specified by a CRON // expression before running the maintenance window. For example, the following // cron expression schedules a maintenance window to run on the third Tuesday of - // every month at 11:30 PM. cron(0 30 23 ? * TUE#3 *) If the schedule offset is 2, + // every month at 11:30 PM. cron(30 23 ? * TUE#3 *) If the schedule offset is 2, // the maintenance window won't run until two days later. ScheduleOffset int32 // The time zone that the scheduled maintenance window executions are based on, in // Internet Assigned Numbers Authority (IANA) format. For example: - // "America/Los_Angeles", "etc/UTC", or "Asia/Seoul". For more information, see the + // "America/Los_Angeles", "UTC", or "Asia/Seoul". For more information, see the // Time Zone Database (https://www.iana.org/time-zones) on the IANA website. ScheduleTimezone *string diff --git a/service/ssm/api_op_CreateOpsItem.go b/service/ssm/api_op_CreateOpsItem.go index b17d04c4446..8c9da4cf047 100644 --- a/service/ssm/api_op_CreateOpsItem.go +++ b/service/ssm/api_op_CreateOpsItem.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" + "time" ) // Creates a new OpsItem. You must have permission in AWS Identity and Access @@ -55,6 +56,14 @@ type CreateOpsItemInput struct { // This member is required. Title *string + // The time a runbook workflow ended. Currently reported only for the OpsItem type + // /aws/changerequest. + ActualEndTime *time.Time + + // The time a runbook workflow started. Currently reported only for the OpsItem + // type /aws/changerequest. + ActualStartTime *time.Time + // Specify a category to assign to an OpsItem. Category *string @@ -81,6 +90,18 @@ type CreateOpsItemInput struct { // in the AWS Systems Manager User Guide. OperationalData map[string]types.OpsItemDataValue + // The type of OpsItem to create. Currently, the only valid values are + // /aws/changerequest and /aws/issue. + OpsItemType *string + + // The time specified in a change request for a runbook workflow to end. Currently + // supported only for the OpsItem type /aws/changerequest. + PlannedEndTime *time.Time + + // The time specified in a change request for a runbook workflow to start. + // Currently supported only for the OpsItem type /aws/changerequest. + PlannedStartTime *time.Time + // The importance of this OpsItem in relation to other OpsItems in the system. Priority *int32 diff --git a/service/ssm/api_op_CreateOpsMetadata.go b/service/ssm/api_op_CreateOpsMetadata.go index 1c1c110a972..3fe852994b6 100644 --- a/service/ssm/api_op_CreateOpsMetadata.go +++ b/service/ssm/api_op_CreateOpsMetadata.go @@ -11,8 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// If you create a new application in AppManager, Systems Manager calls this API -// action to specify information about the new application, including the +// If you create a new application in Application Manager, Systems Manager calls +// this API action to specify information about the new application, including the // application type. func (c *Client) CreateOpsMetadata(ctx context.Context, params *CreateOpsMetadataInput, optFns ...func(*Options)) (*CreateOpsMetadataOutput, error) { if params == nil { @@ -31,12 +31,12 @@ func (c *Client) CreateOpsMetadata(ctx context.Context, params *CreateOpsMetadat type CreateOpsMetadataInput struct { - // A resource ID for a new AppManager application. + // A resource ID for a new Application Manager application. // // This member is required. ResourceId *string - // Metadata for a new AppManager application. + // Metadata for a new Application Manager application. Metadata map[string]types.MetadataValue } diff --git a/service/ssm/api_op_DescribeMaintenanceWindowTasks.go b/service/ssm/api_op_DescribeMaintenanceWindowTasks.go index 77a590bdb3e..2c0b04439a1 100644 --- a/service/ssm/api_op_DescribeMaintenanceWindowTasks.go +++ b/service/ssm/api_op_DescribeMaintenanceWindowTasks.go @@ -12,7 +12,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the tasks in a maintenance window. +// Lists the tasks in a maintenance window. For maintenance window tasks without a +// specified target, you cannot supply values for --max-errors and +// --max-concurrency. Instead, the system inserts a placeholder value of 1, which +// may be reported in the response to this command. These values do not affect the +// running of your task and can be ignored. func (c *Client) DescribeMaintenanceWindowTasks(ctx context.Context, params *DescribeMaintenanceWindowTasksInput, optFns ...func(*Options)) (*DescribeMaintenanceWindowTasksOutput, error) { if params == nil { params = &DescribeMaintenanceWindowTasksInput{} diff --git a/service/ssm/api_op_GetDocument.go b/service/ssm/api_op_GetDocument.go index 95da798ec63..3b2227aa6db 100644 --- a/service/ssm/api_op_GetDocument.go +++ b/service/ssm/api_op_GetDocument.go @@ -73,6 +73,14 @@ type GetDocumentOutput struct { // document. Requires []types.DocumentRequires + // The current review status of a new custom Systems Manager document (SSM + // document) created by a member of your organization, or of the latest version of + // an existing SSM document. Only one version of an SSM document can be in the + // APPROVED state at a time. When a new version is approved, the status of the + // previous version changes to REJECTED. Only one version of an SSM document can be + // in review, or PENDING, at a time. + ReviewStatus types.ReviewStatus + // The status of the Systems Manager document, such as Creating, Active, Updating, // Failed, and Deleting. Status types.DocumentStatus diff --git a/service/ssm/api_op_GetMaintenanceWindow.go b/service/ssm/api_op_GetMaintenanceWindow.go index 74dea36cdb4..5ff68e47aa8 100644 --- a/service/ssm/api_op_GetMaintenanceWindow.go +++ b/service/ssm/api_op_GetMaintenanceWindow.go @@ -81,7 +81,7 @@ type GetMaintenanceWindowOutput struct { // The time zone that the scheduled maintenance window executions are based on, in // Internet Assigned Numbers Authority (IANA) format. For example: - // "America/Los_Angeles", "etc/UTC", or "Asia/Seoul". For more information, see the + // "America/Los_Angeles", "UTC", or "Asia/Seoul". For more information, see the // Time Zone Database (https://www.iana.org/time-zones) on the IANA website. ScheduleTimezone *string diff --git a/service/ssm/api_op_GetMaintenanceWindowTask.go b/service/ssm/api_op_GetMaintenanceWindowTask.go index 7836eafbed5..a1d588f8879 100644 --- a/service/ssm/api_op_GetMaintenanceWindowTask.go +++ b/service/ssm/api_op_GetMaintenanceWindowTask.go @@ -11,7 +11,11 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the tasks in a maintenance window. +// Lists the tasks in a maintenance window. For maintenance window tasks without a +// specified target, you cannot supply values for --max-errors and +// --max-concurrency. Instead, the system inserts a placeholder value of 1, which +// may be reported in the response to this command. These values do not affect the +// running of your task and can be ignored. func (c *Client) GetMaintenanceWindowTask(ctx context.Context, params *GetMaintenanceWindowTaskInput, optFns ...func(*Options)) (*GetMaintenanceWindowTaskOutput, error) { if params == nil { params = &GetMaintenanceWindowTaskInput{} @@ -53,10 +57,18 @@ type GetMaintenanceWindowTaskOutput struct { // MaintenanceWindowTaskInvocationParameters. LoggingInfo *types.LoggingInfo - // The maximum number of targets allowed to run this task in parallel. + // The maximum number of targets allowed to run this task in parallel. For + // maintenance window tasks without a target specified, you cannot supply a value + // for this option. Instead, the system inserts a placeholder value of 1, which may + // be reported in the response to this command. This value does not affect the + // running of your task and can be ignored. MaxConcurrency *string - // The maximum number of errors allowed before the task stops being scheduled. + // The maximum number of errors allowed before the task stops being scheduled. For + // maintenance window tasks without a target specified, you cannot supply a value + // for this option. Instead, the system inserts a placeholder value of 1, which may + // be reported in the response to this command. This value does not affect the + // running of your task and can be ignored. MaxErrors *string // The retrieved task name. diff --git a/service/ssm/api_op_GetOpsMetadata.go b/service/ssm/api_op_GetOpsMetadata.go index e427c514ddc..ba23fbd591b 100644 --- a/service/ssm/api_op_GetOpsMetadata.go +++ b/service/ssm/api_op_GetOpsMetadata.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// View operational metadata related to an application in AppManager. +// View operational metadata related to an application in Application Manager. func (c *Client) GetOpsMetadata(ctx context.Context, params *GetOpsMetadataInput, optFns ...func(*Options)) (*GetOpsMetadataOutput, error) { if params == nil { params = &GetOpsMetadataInput{} @@ -44,14 +44,14 @@ type GetOpsMetadataInput struct { type GetOpsMetadataOutput struct { - // OpsMetadata for an AppManager application. + // OpsMetadata for an Application Manager application. Metadata map[string]types.MetadataValue // The token for the next set of items to return. Use this token to get the next // set of results. NextToken *string - // The resource ID of the AppManager application. + // The resource ID of the Application Manager application. ResourceId *string // Metadata pertaining to the operation's result. diff --git a/service/ssm/api_op_ListDocumentMetadataHistory.go b/service/ssm/api_op_ListDocumentMetadataHistory.go new file mode 100644 index 00000000000..76d9af940aa --- /dev/null +++ b/service/ssm/api_op_ListDocumentMetadataHistory.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +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/ssm/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Information about approval reviews for a version of an SSM document. +func (c *Client) ListDocumentMetadataHistory(ctx context.Context, params *ListDocumentMetadataHistoryInput, optFns ...func(*Options)) (*ListDocumentMetadataHistoryOutput, error) { + if params == nil { + params = &ListDocumentMetadataHistoryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListDocumentMetadataHistory", params, optFns, addOperationListDocumentMetadataHistoryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListDocumentMetadataHistoryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListDocumentMetadataHistoryInput struct { + + // The type of data for which details are being requested. Currently, the only + // supported value is DocumentReviews. + // + // This member is required. + Metadata types.DocumentMetadataEnum + + // The name of the document. + // + // This member is required. + Name *string + + // The version of the document. + DocumentVersion *string + + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + MaxResults int32 + + // The token for the next set of items to return. (You received this token from a + // previous call.) + NextToken *string +} + +type ListDocumentMetadataHistoryOutput struct { + + // The user ID of the person in the organization who requested the document review. + Author *string + + // The version of the document. + DocumentVersion *string + + // Information about the response to the document approval request. + Metadata *types.DocumentMetadataResponseInfo + + // The name of the document. + Name *string + + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListDocumentMetadataHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListDocumentMetadataHistory{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListDocumentMetadataHistory{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListDocumentMetadataHistoryValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDocumentMetadataHistory(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opListDocumentMetadataHistory(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "ssm", + OperationName: "ListDocumentMetadataHistory", + } +} diff --git a/service/ssm/api_op_ListOpsItemEvents.go b/service/ssm/api_op_ListOpsItemEvents.go new file mode 100644 index 00000000000..027e3ff9574 --- /dev/null +++ b/service/ssm/api_op_ListOpsItemEvents.go @@ -0,0 +1,214 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +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/ssm/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of all OpsItem events in the current AWS account and Region. You +// can limit the results to events associated with specific OpsItems by specifying +// a filter. +func (c *Client) ListOpsItemEvents(ctx context.Context, params *ListOpsItemEventsInput, optFns ...func(*Options)) (*ListOpsItemEventsOutput, error) { + if params == nil { + params = &ListOpsItemEventsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListOpsItemEvents", params, optFns, addOperationListOpsItemEventsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListOpsItemEventsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListOpsItemEventsInput struct { + + // One or more OpsItem filters. Use a filter to return a more specific list of + // results. + Filters []types.OpsItemEventFilter + + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + MaxResults *int32 + + // A token to start the list. Use this token to get the next set of results. + NextToken *string +} + +type ListOpsItemEventsOutput struct { + + // The token for the next set of items to return. Use this token to get the next + // set of results. + NextToken *string + + // A list of event information for the specified OpsItems. + Summaries []types.OpsItemEventSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListOpsItemEventsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListOpsItemEvents{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListOpsItemEvents{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListOpsItemEventsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListOpsItemEvents(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListOpsItemEventsAPIClient is a client that implements the ListOpsItemEvents +// operation. +type ListOpsItemEventsAPIClient interface { + ListOpsItemEvents(context.Context, *ListOpsItemEventsInput, ...func(*Options)) (*ListOpsItemEventsOutput, error) +} + +var _ ListOpsItemEventsAPIClient = (*Client)(nil) + +// ListOpsItemEventsPaginatorOptions is the paginator options for ListOpsItemEvents +type ListOpsItemEventsPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListOpsItemEventsPaginator is a paginator for ListOpsItemEvents +type ListOpsItemEventsPaginator struct { + options ListOpsItemEventsPaginatorOptions + client ListOpsItemEventsAPIClient + params *ListOpsItemEventsInput + nextToken *string + firstPage bool +} + +// NewListOpsItemEventsPaginator returns a new ListOpsItemEventsPaginator +func NewListOpsItemEventsPaginator(client ListOpsItemEventsAPIClient, params *ListOpsItemEventsInput, optFns ...func(*ListOpsItemEventsPaginatorOptions)) *ListOpsItemEventsPaginator { + options := ListOpsItemEventsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOpsItemEventsInput{} + } + + return &ListOpsItemEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOpsItemEventsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListOpsItemEvents page. +func (p *ListOpsItemEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOpsItemEventsOutput, 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.ListOpsItemEvents(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListOpsItemEvents(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "ssm", + OperationName: "ListOpsItemEvents", + } +} diff --git a/service/ssm/api_op_ListOpsMetadata.go b/service/ssm/api_op_ListOpsMetadata.go index a171a831268..56463778e9b 100644 --- a/service/ssm/api_op_ListOpsMetadata.go +++ b/service/ssm/api_op_ListOpsMetadata.go @@ -4,6 +4,7 @@ package ssm 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/ssm/types" @@ -11,8 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Systems Manager calls this API action when displaying all AppManager OpsMetadata -// objects or blobs. +// Systems Manager calls this API action when displaying all Application Manager +// OpsMetadata objects or blobs. func (c *Client) ListOpsMetadata(ctx context.Context, params *ListOpsMetadataInput, optFns ...func(*Options)) (*ListOpsMetadataOutput, error) { if params == nil { params = &ListOpsMetadataInput{} @@ -115,6 +116,89 @@ func addOperationListOpsMetadataMiddlewares(stack *middleware.Stack, options Opt return nil } +// ListOpsMetadataAPIClient is a client that implements the ListOpsMetadata +// operation. +type ListOpsMetadataAPIClient interface { + ListOpsMetadata(context.Context, *ListOpsMetadataInput, ...func(*Options)) (*ListOpsMetadataOutput, error) +} + +var _ ListOpsMetadataAPIClient = (*Client)(nil) + +// ListOpsMetadataPaginatorOptions is the paginator options for ListOpsMetadata +type ListOpsMetadataPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListOpsMetadataPaginator is a paginator for ListOpsMetadata +type ListOpsMetadataPaginator struct { + options ListOpsMetadataPaginatorOptions + client ListOpsMetadataAPIClient + params *ListOpsMetadataInput + nextToken *string + firstPage bool +} + +// NewListOpsMetadataPaginator returns a new ListOpsMetadataPaginator +func NewListOpsMetadataPaginator(client ListOpsMetadataAPIClient, params *ListOpsMetadataInput, optFns ...func(*ListOpsMetadataPaginatorOptions)) *ListOpsMetadataPaginator { + options := ListOpsMetadataPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListOpsMetadataInput{} + } + + return &ListOpsMetadataPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListOpsMetadataPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListOpsMetadata page. +func (p *ListOpsMetadataPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListOpsMetadataOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListOpsMetadata(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + func newServiceMetadataMiddleware_opListOpsMetadata(region string) *awsmiddleware.RegisterServiceMetadata { return &awsmiddleware.RegisterServiceMetadata{ Region: region, diff --git a/service/ssm/api_op_RegisterTaskWithMaintenanceWindow.go b/service/ssm/api_op_RegisterTaskWithMaintenanceWindow.go index 65b17f425c6..368b50cf3dd 100644 --- a/service/ssm/api_op_RegisterTaskWithMaintenanceWindow.go +++ b/service/ssm/api_op_RegisterTaskWithMaintenanceWindow.go @@ -30,23 +30,6 @@ func (c *Client) RegisterTaskWithMaintenanceWindow(ctx context.Context, params * type RegisterTaskWithMaintenanceWindowInput struct { - // The maximum number of targets this task can be run for in parallel. - // - // This member is required. - MaxConcurrency *string - - // The maximum number of errors allowed before this task stops being scheduled. - // - // This member is required. - MaxErrors *string - - // The targets (either instances or maintenance window targets). Specify instances - // using the following format: Key=InstanceIds,Values=, Specify maintenance window - // targets using the following format: Key=WindowTargetIds;,Values=, - // - // This member is required. - Targets []types.Target - // The ARN of the task to run. // // This member is required. @@ -76,6 +59,18 @@ type RegisterTaskWithMaintenanceWindowInput struct { // MaintenanceWindowTaskInvocationParameters. LoggingInfo *types.LoggingInfo + // The maximum number of targets this task can be run for in parallel. For + // maintenance window tasks without a target specified, you cannot supply a value + // for this option. Instead, the system inserts a placeholder value of 1. This + // value does not affect the running of your task. + MaxConcurrency *string + + // The maximum number of errors allowed before this task stops being scheduled. For + // maintenance window tasks without a target specified, you cannot supply a value + // for this option. Instead, the system inserts a placeholder value of 1. This + // value does not affect the running of your task. + MaxErrors *string + // An optional name for the task. Name *string @@ -101,6 +96,18 @@ type RegisterTaskWithMaintenanceWindowInput struct { // (https://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-maintenance-permissions.html#maintenance-window-tasks-service-role) ServiceRoleArn *string + // The targets (either instances or maintenance window targets). One or more + // targets must be specified for maintenance window Run Command-type tasks. + // Depending on the task, targets are optional for other maintenance window task + // types (Automation, AWS Lambda, and AWS Step Functions). For more information + // about running tasks that do not specify targets, see see Registering maintenance + // window tasks without targets + // (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html) + // in the AWS Systems Manager User Guide. Specify instances using the following + // format: Key=InstanceIds,Values=, Specify maintenance window targets using the + // following format: Key=WindowTargetIds,Values=, + Targets []types.Target + // The parameters that the task should use during execution. Populate only the // fields that match the task type. All other fields should be empty. TaskInvocationParameters *types.MaintenanceWindowTaskInvocationParameters diff --git a/service/ssm/api_op_StartChangeRequestExecution.go b/service/ssm/api_op_StartChangeRequestExecution.go new file mode 100644 index 00000000000..e7d14f6dd70 --- /dev/null +++ b/service/ssm/api_op_StartChangeRequestExecution.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +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/ssm/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Creates a change request for Change Manager. The runbooks (Automation documents) +// specified in the change request run only after all required approvals for the +// change request have been received. +func (c *Client) StartChangeRequestExecution(ctx context.Context, params *StartChangeRequestExecutionInput, optFns ...func(*Options)) (*StartChangeRequestExecutionOutput, error) { + if params == nil { + params = &StartChangeRequestExecutionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartChangeRequestExecution", params, optFns, addOperationStartChangeRequestExecutionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartChangeRequestExecutionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartChangeRequestExecutionInput struct { + + // The name of the change template document to run during the runbook workflow. + // + // This member is required. + DocumentName *string + + // Information about the Automation runbooks (Automation documents) that are run + // during the runbook workflow. The Automation runbooks specified for the runbook + // workflow can't run until all required approvals for the change request have been + // received. + // + // This member is required. + Runbooks []types.Runbook + + // The name of the change request associated with the runbook workflow to be run. + ChangeRequestName *string + + // The user-provided idempotency token. The token must be unique, is case + // insensitive, enforces the UUID format, and can't be reused. + ClientToken *string + + // The version of the change template document to run during the runbook workflow. + DocumentVersion *string + + // A key-value map of parameters that match the declared parameters in the change + // template document. + Parameters map[string][]string + + // The date and time specified in the change request to run the Automation + // runbooks. The Automation runbooks specified for the runbook workflow can't run + // until all required approvals for the change request have been received. + ScheduledTime *time.Time + + // Optional metadata that you assign to a resource. You can specify a maximum of + // five tags for a change request. Tags enable you to categorize a resource in + // different ways, such as by purpose, owner, or environment. For example, you + // might want to tag a change request to identify an environment or target AWS + // Region. In this case, you could specify the following key-value pairs: + // + // * + // Key=Environment,Value=Production + // + // * Key=Region,Value=us-east-2 + Tags []types.Tag +} + +type StartChangeRequestExecutionOutput struct { + + // The unique ID of a runbook workflow operation. (A runbook workflow is a type of + // Automation operation.) + AutomationExecutionId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationStartChangeRequestExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartChangeRequestExecution{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartChangeRequestExecution{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpStartChangeRequestExecutionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartChangeRequestExecution(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opStartChangeRequestExecution(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "ssm", + OperationName: "StartChangeRequestExecution", + } +} diff --git a/service/ssm/api_op_UpdateAssociation.go b/service/ssm/api_op_UpdateAssociation.go index faeaa449213..c0ec2051c34 100644 --- a/service/ssm/api_op_UpdateAssociation.go +++ b/service/ssm/api_op_UpdateAssociation.go @@ -128,6 +128,11 @@ type UpdateAssociationInput struct { // use AUTO mode. SyncCompliance types.AssociationSyncCompliance + // A location is a combination of AWS Regions and AWS accounts where you want to + // run the association. Use this action to update an association in multiple + // Regions and multiple accounts. + TargetLocations []types.TargetLocation + // The targets of the association. Targets []types.Target } diff --git a/service/ssm/api_op_UpdateDocumentMetadata.go b/service/ssm/api_op_UpdateDocumentMetadata.go new file mode 100644 index 00000000000..c5accdbcc26 --- /dev/null +++ b/service/ssm/api_op_UpdateDocumentMetadata.go @@ -0,0 +1,119 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +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/ssm/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates information related to approval reviews for a specific version of a +// document. +func (c *Client) UpdateDocumentMetadata(ctx context.Context, params *UpdateDocumentMetadataInput, optFns ...func(*Options)) (*UpdateDocumentMetadataOutput, error) { + if params == nil { + params = &UpdateDocumentMetadataInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateDocumentMetadata", params, optFns, addOperationUpdateDocumentMetadataMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateDocumentMetadataOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateDocumentMetadataInput struct { + + // The document review details to update. + // + // This member is required. + DocumentReviews *types.DocumentReviews + + // The name of the document for which a version is to be updated. + // + // This member is required. + Name *string + + // The version of a document to update. + DocumentVersion *string +} + +type UpdateDocumentMetadataOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationUpdateDocumentMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateDocumentMetadata{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateDocumentMetadata{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateDocumentMetadataValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDocumentMetadata(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opUpdateDocumentMetadata(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "ssm", + OperationName: "UpdateDocumentMetadata", + } +} diff --git a/service/ssm/api_op_UpdateMaintenanceWindow.go b/service/ssm/api_op_UpdateMaintenanceWindow.go index d5962e8188c..a65e5a03654 100644 --- a/service/ssm/api_op_UpdateMaintenanceWindow.go +++ b/service/ssm/api_op_UpdateMaintenanceWindow.go @@ -75,19 +75,19 @@ type UpdateMaintenanceWindowInput struct { // The number of days to wait after the date and time specified by a CRON // expression before running the maintenance window. For example, the following // cron expression schedules a maintenance window to run the third Tuesday of every - // month at 11:30 PM. cron(0 30 23 ? * TUE#3 *) If the schedule offset is 2, the + // month at 11:30 PM. cron(30 23 ? * TUE#3 *) If the schedule offset is 2, the // maintenance window won't run until two days later. ScheduleOffset int32 // The time zone that the scheduled maintenance window executions are based on, in // Internet Assigned Numbers Authority (IANA) format. For example: - // "America/Los_Angeles", "etc/UTC", or "Asia/Seoul". For more information, see the + // "America/Los_Angeles", "UTC", or "Asia/Seoul". For more information, see the // Time Zone Database (https://www.iana.org/time-zones) on the IANA website. ScheduleTimezone *string // The time zone that the scheduled maintenance window executions are based on, in // Internet Assigned Numbers Authority (IANA) format. For example: - // "America/Los_Angeles", "etc/UTC", or "Asia/Seoul". For more information, see the + // "America/Los_Angeles", "UTC", or "Asia/Seoul". For more information, see the // Time Zone Database (https://www.iana.org/time-zones) on the IANA website. StartDate *string } @@ -128,7 +128,7 @@ type UpdateMaintenanceWindowOutput struct { // The time zone that the scheduled maintenance window executions are based on, in // Internet Assigned Numbers Authority (IANA) format. For example: - // "America/Los_Angeles", "etc/UTC", or "Asia/Seoul". For more information, see the + // "America/Los_Angeles", "UTC", or "Asia/Seoul". For more information, see the // Time Zone Database (https://www.iana.org/time-zones) on the IANA website. ScheduleTimezone *string diff --git a/service/ssm/api_op_UpdateMaintenanceWindowTask.go b/service/ssm/api_op_UpdateMaintenanceWindowTask.go index 07fc3cec1bc..9a5437b7cf7 100644 --- a/service/ssm/api_op_UpdateMaintenanceWindowTask.go +++ b/service/ssm/api_op_UpdateMaintenanceWindowTask.go @@ -29,18 +29,24 @@ import ( // * // MaxErrors // -// If the value for a parameter in UpdateMaintenanceWindowTask is null, -// then the corresponding field is not modified. If you set Replace to true, then -// all fields required by the RegisterTaskWithMaintenanceWindow action are required -// for this request. Optional fields that aren't specified are set to null. When -// you update a maintenance window task that has options specified in -// TaskInvocationParameters, you must provide again all the -// TaskInvocationParameters values that you want to retain. The values you do not -// specify again are removed. For example, suppose that when you registered a Run -// Command task, you specified TaskInvocationParameters values for Comment, -// NotificationConfig, and OutputS3BucketName. If you update the maintenance window -// task and specify only a different OutputS3BucketName value, the values for -// Comment and NotificationConfig are removed. +// One or more targets must be specified for maintenance window Run +// Command-type tasks. Depending on the task, targets are optional for other +// maintenance window task types (Automation, AWS Lambda, and AWS Step Functions). +// For more information about running tasks that do not specify targets, see see +// Registering maintenance window tasks without targets +// (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html) +// in the AWS Systems Manager User Guide. If the value for a parameter in +// UpdateMaintenanceWindowTask is null, then the corresponding field is not +// modified. If you set Replace to true, then all fields required by the +// RegisterTaskWithMaintenanceWindow action are required for this request. Optional +// fields that aren't specified are set to null. When you update a maintenance +// window task that has options specified in TaskInvocationParameters, you must +// provide again all the TaskInvocationParameters values that you want to retain. +// The values you do not specify again are removed. For example, suppose that when +// you registered a Run Command task, you specified TaskInvocationParameters values +// for Comment, NotificationConfig, and OutputS3BucketName. If you update the +// maintenance window task and specify only a different OutputS3BucketName value, +// the values for Comment and NotificationConfig are removed. func (c *Client) UpdateMaintenanceWindowTask(ctx context.Context, params *UpdateMaintenanceWindowTaskInput, optFns ...func(*Options)) (*UpdateMaintenanceWindowTaskOutput, error) { if params == nil { params = &UpdateMaintenanceWindowTaskInput{} @@ -80,11 +86,19 @@ type UpdateMaintenanceWindowTaskInput struct { LoggingInfo *types.LoggingInfo // The new MaxConcurrency value you want to specify. MaxConcurrency is the number - // of targets that are allowed to run this task in parallel. + // of targets that are allowed to run this task in parallel. For maintenance window + // tasks without a target specified, you cannot supply a value for this option. + // Instead, the system inserts a placeholder value of 1, which may be reported in + // the response to this command. This value does not affect the running of your + // task and can be ignored. MaxConcurrency *string // The new MaxErrors value to specify. MaxErrors is the maximum number of errors - // that are allowed before the task stops being scheduled. + // that are allowed before the task stops being scheduled. For maintenance window + // tasks without a target specified, you cannot supply a value for this option. + // Instead, the system inserts a placeholder value of 1, which may be reported in + // the response to this command. This value does not affect the running of your + // task and can be ignored. MaxErrors *string // The new task name to specify. @@ -118,7 +132,13 @@ type UpdateMaintenanceWindowTaskInput struct { // The targets (either instances or tags) to modify. Instances are specified using // Key=instanceids,Values=instanceID_1,instanceID_2. Tags are specified using - // Key=tag_name,Values=tag_value. + // Key=tag_name,Values=tag_value. One or more targets must be specified for + // maintenance window Run Command-type tasks. Depending on the task, targets are + // optional for other maintenance window task types (Automation, AWS Lambda, and + // AWS Step Functions). For more information about running tasks that do not + // specify targets, see see Registering maintenance window tasks without targets + // (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html) + // in the AWS Systems Manager User Guide. Targets []types.Target // The task ARN to modify. diff --git a/service/ssm/api_op_UpdateOpsItem.go b/service/ssm/api_op_UpdateOpsItem.go index 9aa3f63c1ff..97f3d300e97 100644 --- a/service/ssm/api_op_UpdateOpsItem.go +++ b/service/ssm/api_op_UpdateOpsItem.go @@ -9,6 +9,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/ssm/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" + "time" ) // Edit or change an OpsItem. You must have permission in AWS Identity and Access @@ -43,6 +44,14 @@ type UpdateOpsItemInput struct { // This member is required. OpsItemId *string + // The time a runbook workflow ended. Currently reported only for the OpsItem type + // /aws/changerequest. + ActualEndTime *time.Time + + // The time a runbook workflow started. Currently reported only for the OpsItem + // type /aws/changerequest. + ActualStartTime *time.Time + // Specify a new category for an OpsItem. Category *string @@ -77,6 +86,14 @@ type UpdateOpsItemInput struct { // Keys that you want to remove from the OperationalData map. OperationalDataToDelete []string + // The time specified in a change request for a runbook workflow to end. Currently + // supported only for the OpsItem type /aws/changerequest. + PlannedEndTime *time.Time + + // The time specified in a change request for a runbook workflow to start. + // Currently supported only for the OpsItem type /aws/changerequest. + PlannedStartTime *time.Time + // The importance of this OpsItem in relation to other OpsItems in the system. Priority *int32 diff --git a/service/ssm/api_op_UpdateOpsMetadata.go b/service/ssm/api_op_UpdateOpsMetadata.go index 5a3fc3eaff3..22acaf9f90b 100644 --- a/service/ssm/api_op_UpdateOpsMetadata.go +++ b/service/ssm/api_op_UpdateOpsMetadata.go @@ -11,7 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Systems Manager calls this API action when you edit OpsMetadata in AppManager. +// Systems Manager calls this API action when you edit OpsMetadata in Application +// Manager. func (c *Client) UpdateOpsMetadata(ctx context.Context, params *UpdateOpsMetadataInput, optFns ...func(*Options)) (*UpdateOpsMetadataOutput, error) { if params == nil { params = &UpdateOpsMetadataInput{} diff --git a/service/ssm/deserializers.go b/service/ssm/deserializers.go index 703f9fcef98..4d6d087ca43 100644 --- a/service/ssm/deserializers.go +++ b/service/ssm/deserializers.go @@ -10481,14 +10481,14 @@ func awsAwsjson11_deserializeOpErrorListComplianceSummaries(response *smithyhttp } } -type awsAwsjson11_deserializeOpListDocuments struct { +type awsAwsjson11_deserializeOpListDocumentMetadataHistory struct { } -func (*awsAwsjson11_deserializeOpListDocuments) ID() string { +func (*awsAwsjson11_deserializeOpListDocumentMetadataHistory) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListDocuments) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListDocumentMetadataHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10502,9 +10502,9 @@ func (m *awsAwsjson11_deserializeOpListDocuments) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListDocuments(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListDocumentMetadataHistory(response, &metadata) } - output := &ListDocumentsOutput{} + output := &ListDocumentMetadataHistoryOutput{} out.Result = output var buff [1024]byte @@ -10524,7 +10524,7 @@ func (m *awsAwsjson11_deserializeOpListDocuments) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListDocumentsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListDocumentMetadataHistoryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10538,7 +10538,7 @@ func (m *awsAwsjson11_deserializeOpListDocuments) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListDocuments(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListDocumentMetadataHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10582,8 +10582,11 @@ func awsAwsjson11_deserializeOpErrorListDocuments(response *smithyhttp.Response, case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidFilterKey", errorCode): - return awsAwsjson11_deserializeErrorInvalidFilterKey(response, errorBody) + case strings.EqualFold("InvalidDocument", errorCode): + return awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody) + + case strings.EqualFold("InvalidDocumentVersion", errorCode): + return awsAwsjson11_deserializeErrorInvalidDocumentVersion(response, errorBody) case strings.EqualFold("InvalidNextToken", errorCode): return awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody) @@ -10598,14 +10601,14 @@ func awsAwsjson11_deserializeOpErrorListDocuments(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpListDocumentVersions struct { +type awsAwsjson11_deserializeOpListDocuments struct { } -func (*awsAwsjson11_deserializeOpListDocumentVersions) ID() string { +func (*awsAwsjson11_deserializeOpListDocuments) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListDocumentVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListDocuments) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10619,9 +10622,9 @@ func (m *awsAwsjson11_deserializeOpListDocumentVersions) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListDocumentVersions(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListDocuments(response, &metadata) } - output := &ListDocumentVersionsOutput{} + output := &ListDocumentsOutput{} out.Result = output var buff [1024]byte @@ -10641,7 +10644,7 @@ func (m *awsAwsjson11_deserializeOpListDocumentVersions) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListDocumentVersionsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListDocumentsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10655,7 +10658,7 @@ func (m *awsAwsjson11_deserializeOpListDocumentVersions) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListDocumentVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListDocuments(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10699,8 +10702,8 @@ func awsAwsjson11_deserializeOpErrorListDocumentVersions(response *smithyhttp.Re case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidDocument", errorCode): - return awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody) + case strings.EqualFold("InvalidFilterKey", errorCode): + return awsAwsjson11_deserializeErrorInvalidFilterKey(response, errorBody) case strings.EqualFold("InvalidNextToken", errorCode): return awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody) @@ -10715,14 +10718,14 @@ func awsAwsjson11_deserializeOpErrorListDocumentVersions(response *smithyhttp.Re } } -type awsAwsjson11_deserializeOpListInventoryEntries struct { +type awsAwsjson11_deserializeOpListDocumentVersions struct { } -func (*awsAwsjson11_deserializeOpListInventoryEntries) ID() string { +func (*awsAwsjson11_deserializeOpListDocumentVersions) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListInventoryEntries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListDocumentVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10736,9 +10739,9 @@ func (m *awsAwsjson11_deserializeOpListInventoryEntries) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListInventoryEntries(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListDocumentVersions(response, &metadata) } - output := &ListInventoryEntriesOutput{} + output := &ListDocumentVersionsOutput{} out.Result = output var buff [1024]byte @@ -10758,7 +10761,7 @@ func (m *awsAwsjson11_deserializeOpListInventoryEntries) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListInventoryEntriesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListDocumentVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10772,7 +10775,7 @@ func (m *awsAwsjson11_deserializeOpListInventoryEntries) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListInventoryEntries(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListDocumentVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10816,18 +10819,12 @@ func awsAwsjson11_deserializeOpErrorListInventoryEntries(response *smithyhttp.Re case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidFilter", errorCode): - return awsAwsjson11_deserializeErrorInvalidFilter(response, errorBody) - - case strings.EqualFold("InvalidInstanceId", errorCode): - return awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody) + case strings.EqualFold("InvalidDocument", errorCode): + return awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody) case strings.EqualFold("InvalidNextToken", errorCode): return awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody) - case strings.EqualFold("InvalidTypeNameException", errorCode): - return awsAwsjson11_deserializeErrorInvalidTypeNameException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -10838,14 +10835,14 @@ func awsAwsjson11_deserializeOpErrorListInventoryEntries(response *smithyhttp.Re } } -type awsAwsjson11_deserializeOpListOpsMetadata struct { +type awsAwsjson11_deserializeOpListInventoryEntries struct { } -func (*awsAwsjson11_deserializeOpListOpsMetadata) ID() string { +func (*awsAwsjson11_deserializeOpListInventoryEntries) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListOpsMetadata) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListInventoryEntries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10859,9 +10856,9 @@ func (m *awsAwsjson11_deserializeOpListOpsMetadata) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListOpsMetadata(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListInventoryEntries(response, &metadata) } - output := &ListOpsMetadataOutput{} + output := &ListInventoryEntriesOutput{} out.Result = output var buff [1024]byte @@ -10881,7 +10878,7 @@ func (m *awsAwsjson11_deserializeOpListOpsMetadata) HandleDeserialize(ctx contex return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListOpsMetadataOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListInventoryEntriesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10895,7 +10892,7 @@ func (m *awsAwsjson11_deserializeOpListOpsMetadata) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListOpsMetadata(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListInventoryEntries(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10939,8 +10936,17 @@ func awsAwsjson11_deserializeOpErrorListOpsMetadata(response *smithyhttp.Respons case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("OpsMetadataInvalidArgumentException", errorCode): - return awsAwsjson11_deserializeErrorOpsMetadataInvalidArgumentException(response, errorBody) + case strings.EqualFold("InvalidFilter", errorCode): + return awsAwsjson11_deserializeErrorInvalidFilter(response, errorBody) + + case strings.EqualFold("InvalidInstanceId", errorCode): + return awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody) + + case strings.EqualFold("InvalidNextToken", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody) + + case strings.EqualFold("InvalidTypeNameException", errorCode): + return awsAwsjson11_deserializeErrorInvalidTypeNameException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -10952,14 +10958,14 @@ func awsAwsjson11_deserializeOpErrorListOpsMetadata(response *smithyhttp.Respons } } -type awsAwsjson11_deserializeOpListResourceComplianceSummaries struct { +type awsAwsjson11_deserializeOpListOpsItemEvents struct { } -func (*awsAwsjson11_deserializeOpListResourceComplianceSummaries) ID() string { +func (*awsAwsjson11_deserializeOpListOpsItemEvents) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListResourceComplianceSummaries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListOpsItemEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10973,9 +10979,9 @@ func (m *awsAwsjson11_deserializeOpListResourceComplianceSummaries) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListResourceComplianceSummaries(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListOpsItemEvents(response, &metadata) } - output := &ListResourceComplianceSummariesOutput{} + output := &ListOpsItemEventsOutput{} out.Result = output var buff [1024]byte @@ -10995,7 +11001,7 @@ func (m *awsAwsjson11_deserializeOpListResourceComplianceSummaries) HandleDeseri return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListResourceComplianceSummariesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListOpsItemEventsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11009,7 +11015,7 @@ func (m *awsAwsjson11_deserializeOpListResourceComplianceSummaries) HandleDeseri return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListResourceComplianceSummaries(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListOpsItemEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11053,11 +11059,14 @@ func awsAwsjson11_deserializeOpErrorListResourceComplianceSummaries(response *sm case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidFilter", errorCode): - return awsAwsjson11_deserializeErrorInvalidFilter(response, errorBody) + case strings.EqualFold("OpsItemInvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody) - case strings.EqualFold("InvalidNextToken", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody) + case strings.EqualFold("OpsItemLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemLimitExceededException(response, errorBody) + + case strings.EqualFold("OpsItemNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -11069,14 +11078,14 @@ func awsAwsjson11_deserializeOpErrorListResourceComplianceSummaries(response *sm } } -type awsAwsjson11_deserializeOpListResourceDataSync struct { +type awsAwsjson11_deserializeOpListOpsMetadata struct { } -func (*awsAwsjson11_deserializeOpListResourceDataSync) ID() string { +func (*awsAwsjson11_deserializeOpListOpsMetadata) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListResourceDataSync) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListOpsMetadata) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11090,9 +11099,9 @@ func (m *awsAwsjson11_deserializeOpListResourceDataSync) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListResourceDataSync(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListOpsMetadata(response, &metadata) } - output := &ListResourceDataSyncOutput{} + output := &ListOpsMetadataOutput{} out.Result = output var buff [1024]byte @@ -11112,7 +11121,7 @@ func (m *awsAwsjson11_deserializeOpListResourceDataSync) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListResourceDataSyncOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListOpsMetadataOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11126,7 +11135,7 @@ func (m *awsAwsjson11_deserializeOpListResourceDataSync) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListResourceDataSync(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListOpsMetadata(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11170,11 +11179,8 @@ func awsAwsjson11_deserializeOpErrorListResourceDataSync(response *smithyhttp.Re case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidNextToken", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody) - - case strings.EqualFold("ResourceDataSyncInvalidConfigurationException", errorCode): - return awsAwsjson11_deserializeErrorResourceDataSyncInvalidConfigurationException(response, errorBody) + case strings.EqualFold("OpsMetadataInvalidArgumentException", errorCode): + return awsAwsjson11_deserializeErrorOpsMetadataInvalidArgumentException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -11186,14 +11192,14 @@ func awsAwsjson11_deserializeOpErrorListResourceDataSync(response *smithyhttp.Re } } -type awsAwsjson11_deserializeOpListTagsForResource struct { +type awsAwsjson11_deserializeOpListResourceComplianceSummaries struct { } -func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { +func (*awsAwsjson11_deserializeOpListResourceComplianceSummaries) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListResourceComplianceSummaries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11207,9 +11213,9 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListResourceComplianceSummaries(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListResourceComplianceSummariesOutput{} out.Result = output var buff [1024]byte @@ -11229,7 +11235,7 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListResourceComplianceSummariesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11243,7 +11249,7 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListResourceComplianceSummaries(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11287,11 +11293,11 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidResourceId", errorCode): - return awsAwsjson11_deserializeErrorInvalidResourceId(response, errorBody) + case strings.EqualFold("InvalidFilter", errorCode): + return awsAwsjson11_deserializeErrorInvalidFilter(response, errorBody) - case strings.EqualFold("InvalidResourceType", errorCode): - return awsAwsjson11_deserializeErrorInvalidResourceType(response, errorBody) + case strings.EqualFold("InvalidNextToken", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -11303,14 +11309,14 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -type awsAwsjson11_deserializeOpModifyDocumentPermission struct { +type awsAwsjson11_deserializeOpListResourceDataSync struct { } -func (*awsAwsjson11_deserializeOpModifyDocumentPermission) ID() string { +func (*awsAwsjson11_deserializeOpListResourceDataSync) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpModifyDocumentPermission) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListResourceDataSync) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11324,9 +11330,9 @@ func (m *awsAwsjson11_deserializeOpModifyDocumentPermission) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorModifyDocumentPermission(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListResourceDataSync(response, &metadata) } - output := &ModifyDocumentPermissionOutput{} + output := &ListResourceDataSyncOutput{} out.Result = output var buff [1024]byte @@ -11346,7 +11352,7 @@ func (m *awsAwsjson11_deserializeOpModifyDocumentPermission) HandleDeserialize(c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentModifyDocumentPermissionOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListResourceDataSyncOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11360,7 +11366,7 @@ func (m *awsAwsjson11_deserializeOpModifyDocumentPermission) HandleDeserialize(c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorModifyDocumentPermission(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListResourceDataSync(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11401,20 +11407,14 @@ func awsAwsjson11_deserializeOpErrorModifyDocumentPermission(response *smithyhtt } switch { - case strings.EqualFold("DocumentLimitExceeded", errorCode): - return awsAwsjson11_deserializeErrorDocumentLimitExceeded(response, errorBody) - - case strings.EqualFold("DocumentPermissionLimit", errorCode): - return awsAwsjson11_deserializeErrorDocumentPermissionLimit(response, errorBody) - case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidDocument", errorCode): - return awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody) + case strings.EqualFold("InvalidNextToken", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody) - case strings.EqualFold("InvalidPermissionType", errorCode): - return awsAwsjson11_deserializeErrorInvalidPermissionType(response, errorBody) + case strings.EqualFold("ResourceDataSyncInvalidConfigurationException", errorCode): + return awsAwsjson11_deserializeErrorResourceDataSyncInvalidConfigurationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -11426,14 +11426,14 @@ func awsAwsjson11_deserializeOpErrorModifyDocumentPermission(response *smithyhtt } } -type awsAwsjson11_deserializeOpPutComplianceItems struct { +type awsAwsjson11_deserializeOpListTagsForResource struct { } -func (*awsAwsjson11_deserializeOpPutComplianceItems) ID() string { +func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutComplianceItems) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11447,9 +11447,9 @@ func (m *awsAwsjson11_deserializeOpPutComplianceItems) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutComplianceItems(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &PutComplianceItemsOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -11469,7 +11469,7 @@ func (m *awsAwsjson11_deserializeOpPutComplianceItems) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutComplianceItemsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11483,7 +11483,7 @@ func (m *awsAwsjson11_deserializeOpPutComplianceItems) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutComplianceItems(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11524,27 +11524,15 @@ func awsAwsjson11_deserializeOpErrorPutComplianceItems(response *smithyhttp.Resp } switch { - case strings.EqualFold("ComplianceTypeCountLimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorComplianceTypeCountLimitExceededException(response, errorBody) - case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidItemContentException", errorCode): - return awsAwsjson11_deserializeErrorInvalidItemContentException(response, errorBody) - case strings.EqualFold("InvalidResourceId", errorCode): return awsAwsjson11_deserializeErrorInvalidResourceId(response, errorBody) case strings.EqualFold("InvalidResourceType", errorCode): return awsAwsjson11_deserializeErrorInvalidResourceType(response, errorBody) - case strings.EqualFold("ItemSizeLimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorItemSizeLimitExceededException(response, errorBody) - - case strings.EqualFold("TotalSizeLimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorTotalSizeLimitExceededException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -11555,14 +11543,14 @@ func awsAwsjson11_deserializeOpErrorPutComplianceItems(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpPutInventory struct { +type awsAwsjson11_deserializeOpModifyDocumentPermission struct { } -func (*awsAwsjson11_deserializeOpPutInventory) ID() string { +func (*awsAwsjson11_deserializeOpModifyDocumentPermission) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutInventory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpModifyDocumentPermission) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11576,9 +11564,9 @@ func (m *awsAwsjson11_deserializeOpPutInventory) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutInventory(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorModifyDocumentPermission(response, &metadata) } - output := &PutInventoryOutput{} + output := &ModifyDocumentPermissionOutput{} out.Result = output var buff [1024]byte @@ -11598,7 +11586,7 @@ func (m *awsAwsjson11_deserializeOpPutInventory) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutInventoryOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentModifyDocumentPermissionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11612,7 +11600,7 @@ func (m *awsAwsjson11_deserializeOpPutInventory) HandleDeserialize(ctx context.C return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutInventory(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorModifyDocumentPermission(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11653,41 +11641,20 @@ func awsAwsjson11_deserializeOpErrorPutInventory(response *smithyhttp.Response, } switch { - case strings.EqualFold("CustomSchemaCountLimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorCustomSchemaCountLimitExceededException(response, errorBody) + case strings.EqualFold("DocumentLimitExceeded", errorCode): + return awsAwsjson11_deserializeErrorDocumentLimitExceeded(response, errorBody) + + case strings.EqualFold("DocumentPermissionLimit", errorCode): + return awsAwsjson11_deserializeErrorDocumentPermissionLimit(response, errorBody) case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidInstanceId", errorCode): - return awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody) - - case strings.EqualFold("InvalidInventoryItemContextException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInventoryItemContextException(response, errorBody) - - case strings.EqualFold("InvalidItemContentException", errorCode): - return awsAwsjson11_deserializeErrorInvalidItemContentException(response, errorBody) - - case strings.EqualFold("InvalidTypeNameException", errorCode): - return awsAwsjson11_deserializeErrorInvalidTypeNameException(response, errorBody) - - case strings.EqualFold("ItemContentMismatchException", errorCode): - return awsAwsjson11_deserializeErrorItemContentMismatchException(response, errorBody) - - case strings.EqualFold("ItemSizeLimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorItemSizeLimitExceededException(response, errorBody) - - case strings.EqualFold("SubTypeCountLimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorSubTypeCountLimitExceededException(response, errorBody) - - case strings.EqualFold("TotalSizeLimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorTotalSizeLimitExceededException(response, errorBody) - - case strings.EqualFold("UnsupportedInventoryItemContextException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedInventoryItemContextException(response, errorBody) + case strings.EqualFold("InvalidDocument", errorCode): + return awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody) - case strings.EqualFold("UnsupportedInventorySchemaVersionException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedInventorySchemaVersionException(response, errorBody) + case strings.EqualFold("InvalidPermissionType", errorCode): + return awsAwsjson11_deserializeErrorInvalidPermissionType(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -11699,14 +11666,14 @@ func awsAwsjson11_deserializeOpErrorPutInventory(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpPutParameter struct { +type awsAwsjson11_deserializeOpPutComplianceItems struct { } -func (*awsAwsjson11_deserializeOpPutParameter) ID() string { +func (*awsAwsjson11_deserializeOpPutComplianceItems) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutParameter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutComplianceItems) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11720,9 +11687,9 @@ func (m *awsAwsjson11_deserializeOpPutParameter) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutParameter(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutComplianceItems(response, &metadata) } - output := &PutParameterOutput{} + output := &PutComplianceItemsOutput{} out.Result = output var buff [1024]byte @@ -11742,7 +11709,7 @@ func (m *awsAwsjson11_deserializeOpPutParameter) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutParameterOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentPutComplianceItemsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11756,7 +11723,280 @@ func (m *awsAwsjson11_deserializeOpPutParameter) HandleDeserialize(ctx context.C return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutParameter(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutComplianceItems(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ComplianceTypeCountLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorComplianceTypeCountLimitExceededException(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidItemContentException", errorCode): + return awsAwsjson11_deserializeErrorInvalidItemContentException(response, errorBody) + + case strings.EqualFold("InvalidResourceId", errorCode): + return awsAwsjson11_deserializeErrorInvalidResourceId(response, errorBody) + + case strings.EqualFold("InvalidResourceType", errorCode): + return awsAwsjson11_deserializeErrorInvalidResourceType(response, errorBody) + + case strings.EqualFold("ItemSizeLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorItemSizeLimitExceededException(response, errorBody) + + case strings.EqualFold("TotalSizeLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorTotalSizeLimitExceededException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpPutInventory struct { +} + +func (*awsAwsjson11_deserializeOpPutInventory) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutInventory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorPutInventory(response, &metadata) + } + output := &PutInventoryOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentPutInventoryOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorPutInventory(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("CustomSchemaCountLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorCustomSchemaCountLimitExceededException(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidInstanceId", errorCode): + return awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody) + + case strings.EqualFold("InvalidInventoryItemContextException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInventoryItemContextException(response, errorBody) + + case strings.EqualFold("InvalidItemContentException", errorCode): + return awsAwsjson11_deserializeErrorInvalidItemContentException(response, errorBody) + + case strings.EqualFold("InvalidTypeNameException", errorCode): + return awsAwsjson11_deserializeErrorInvalidTypeNameException(response, errorBody) + + case strings.EqualFold("ItemContentMismatchException", errorCode): + return awsAwsjson11_deserializeErrorItemContentMismatchException(response, errorBody) + + case strings.EqualFold("ItemSizeLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorItemSizeLimitExceededException(response, errorBody) + + case strings.EqualFold("SubTypeCountLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorSubTypeCountLimitExceededException(response, errorBody) + + case strings.EqualFold("TotalSizeLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorTotalSizeLimitExceededException(response, errorBody) + + case strings.EqualFold("UnsupportedInventoryItemContextException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedInventoryItemContextException(response, errorBody) + + case strings.EqualFold("UnsupportedInventorySchemaVersionException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedInventorySchemaVersionException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpPutParameter struct { +} + +func (*awsAwsjson11_deserializeOpPutParameter) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutParameter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorPutParameter(response, &metadata) + } + output := &PutParameterOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentPutParameterOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorPutParameter(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -13190,6 +13430,135 @@ func awsAwsjson11_deserializeOpErrorStartAutomationExecution(response *smithyhtt } } +type awsAwsjson11_deserializeOpStartChangeRequestExecution struct { +} + +func (*awsAwsjson11_deserializeOpStartChangeRequestExecution) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpStartChangeRequestExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorStartChangeRequestExecution(response, &metadata) + } + output := &StartChangeRequestExecutionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentStartChangeRequestExecutionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorStartChangeRequestExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AutomationDefinitionNotApprovedException", errorCode): + return awsAwsjson11_deserializeErrorAutomationDefinitionNotApprovedException(response, errorBody) + + case strings.EqualFold("AutomationDefinitionNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorAutomationDefinitionNotFoundException(response, errorBody) + + case strings.EqualFold("AutomationDefinitionVersionNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorAutomationDefinitionVersionNotFoundException(response, errorBody) + + case strings.EqualFold("AutomationExecutionLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorAutomationExecutionLimitExceededException(response, errorBody) + + case strings.EqualFold("IdempotentParameterMismatch", errorCode): + return awsAwsjson11_deserializeErrorIdempotentParameterMismatch(response, errorBody) + + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidAutomationExecutionParametersException", errorCode): + return awsAwsjson11_deserializeErrorInvalidAutomationExecutionParametersException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpStartSession struct { } @@ -14066,14 +14435,14 @@ func awsAwsjson11_deserializeOpErrorUpdateDocumentDefaultVersion(response *smith } } -type awsAwsjson11_deserializeOpUpdateMaintenanceWindow struct { +type awsAwsjson11_deserializeOpUpdateDocumentMetadata struct { } -func (*awsAwsjson11_deserializeOpUpdateMaintenanceWindow) ID() string { +func (*awsAwsjson11_deserializeOpUpdateDocumentMetadata) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUpdateDocumentMetadata) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -14087,9 +14456,9 @@ func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindow) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindow(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateDocumentMetadata(response, &metadata) } - output := &UpdateMaintenanceWindowOutput{} + output := &UpdateDocumentMetadataOutput{} out.Result = output var buff [1024]byte @@ -14109,7 +14478,7 @@ func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindow) HandleDeserialize(ct return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUpdateDocumentMetadataOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -14123,7 +14492,7 @@ func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindow) HandleDeserialize(ct return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindow(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUpdateDocumentMetadata(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -14164,12 +14533,18 @@ func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindow(response *smithyhttp } switch { - case strings.EqualFold("DoesNotExistException", errorCode): - return awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody) - case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + case strings.EqualFold("InvalidDocument", errorCode): + return awsAwsjson11_deserializeErrorInvalidDocument(response, errorBody) + + case strings.EqualFold("InvalidDocumentOperation", errorCode): + return awsAwsjson11_deserializeErrorInvalidDocumentOperation(response, errorBody) + + case strings.EqualFold("InvalidDocumentVersion", errorCode): + return awsAwsjson11_deserializeErrorInvalidDocumentVersion(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -14180,14 +14555,14 @@ func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindow(response *smithyhttp } } -type awsAwsjson11_deserializeOpUpdateMaintenanceWindowTarget struct { +type awsAwsjson11_deserializeOpUpdateMaintenanceWindow struct { } -func (*awsAwsjson11_deserializeOpUpdateMaintenanceWindowTarget) ID() string { +func (*awsAwsjson11_deserializeOpUpdateMaintenanceWindow) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindowTarget) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindow) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -14201,9 +14576,9 @@ func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindowTarget) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTarget(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindow(response, &metadata) } - output := &UpdateMaintenanceWindowTargetOutput{} + output := &UpdateMaintenanceWindowOutput{} out.Result = output var buff [1024]byte @@ -14223,7 +14598,7 @@ func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindowTarget) HandleDeserial return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowTargetOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -14237,7 +14612,7 @@ func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindowTarget) HandleDeserial return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindow(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -14294,14 +14669,14 @@ func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTarget(response *smit } } -type awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask struct { +type awsAwsjson11_deserializeOpUpdateMaintenanceWindowTarget struct { } -func (*awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask) ID() string { +func (*awsAwsjson11_deserializeOpUpdateMaintenanceWindowTarget) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindowTarget) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -14315,9 +14690,9 @@ func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTask(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTarget(response, &metadata) } - output := &UpdateMaintenanceWindowTaskOutput{} + output := &UpdateMaintenanceWindowTargetOutput{} out.Result = output var buff [1024]byte @@ -14337,7 +14712,7 @@ func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask) HandleDeserializ return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowTaskOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowTargetOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -14351,7 +14726,7 @@ func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask) HandleDeserializ return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -14408,14 +14783,14 @@ func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTask(response *smithy } } -type awsAwsjson11_deserializeOpUpdateManagedInstanceRole struct { +type awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask struct { } -func (*awsAwsjson11_deserializeOpUpdateManagedInstanceRole) ID() string { +func (*awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateManagedInstanceRole) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUpdateMaintenanceWindowTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -14429,9 +14804,9 @@ func (m *awsAwsjson11_deserializeOpUpdateManagedInstanceRole) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateManagedInstanceRole(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTask(response, &metadata) } - output := &UpdateManagedInstanceRoleOutput{} + output := &UpdateMaintenanceWindowTaskOutput{} out.Result = output var buff [1024]byte @@ -14451,7 +14826,7 @@ func (m *awsAwsjson11_deserializeOpUpdateManagedInstanceRole) HandleDeserialize( return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateManagedInstanceRoleOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUpdateMaintenanceWindowTaskOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -14465,7 +14840,7 @@ func (m *awsAwsjson11_deserializeOpUpdateManagedInstanceRole) HandleDeserialize( return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateManagedInstanceRole(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUpdateMaintenanceWindowTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -14506,12 +14881,12 @@ func awsAwsjson11_deserializeOpErrorUpdateManagedInstanceRole(response *smithyht } switch { + case strings.EqualFold("DoesNotExistException", errorCode): + return awsAwsjson11_deserializeErrorDoesNotExistException(response, errorBody) + case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("InvalidInstanceId", errorCode): - return awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -14522,14 +14897,14 @@ func awsAwsjson11_deserializeOpErrorUpdateManagedInstanceRole(response *smithyht } } -type awsAwsjson11_deserializeOpUpdateOpsItem struct { +type awsAwsjson11_deserializeOpUpdateManagedInstanceRole struct { } -func (*awsAwsjson11_deserializeOpUpdateOpsItem) ID() string { +func (*awsAwsjson11_deserializeOpUpdateManagedInstanceRole) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateOpsItem) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUpdateManagedInstanceRole) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -14543,9 +14918,9 @@ func (m *awsAwsjson11_deserializeOpUpdateOpsItem) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateOpsItem(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateManagedInstanceRole(response, &metadata) } - output := &UpdateOpsItemOutput{} + output := &UpdateManagedInstanceRoleOutput{} out.Result = output var buff [1024]byte @@ -14565,7 +14940,7 @@ func (m *awsAwsjson11_deserializeOpUpdateOpsItem) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateOpsItemOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUpdateManagedInstanceRoleOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -14579,7 +14954,7 @@ func (m *awsAwsjson11_deserializeOpUpdateOpsItem) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateOpsItem(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUpdateManagedInstanceRole(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -14623,17 +14998,8 @@ func awsAwsjson11_deserializeOpErrorUpdateOpsItem(response *smithyhttp.Response, case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("OpsItemAlreadyExistsException", errorCode): - return awsAwsjson11_deserializeErrorOpsItemAlreadyExistsException(response, errorBody) - - case strings.EqualFold("OpsItemInvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody) - - case strings.EqualFold("OpsItemLimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorOpsItemLimitExceededException(response, errorBody) - - case strings.EqualFold("OpsItemNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorOpsItemNotFoundException(response, errorBody) + case strings.EqualFold("InvalidInstanceId", errorCode): + return awsAwsjson11_deserializeErrorInvalidInstanceId(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -14645,14 +15011,14 @@ func awsAwsjson11_deserializeOpErrorUpdateOpsItem(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpUpdateOpsMetadata struct { +type awsAwsjson11_deserializeOpUpdateOpsItem struct { } -func (*awsAwsjson11_deserializeOpUpdateOpsMetadata) ID() string { +func (*awsAwsjson11_deserializeOpUpdateOpsItem) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateOpsMetadata) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUpdateOpsItem) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -14666,9 +15032,9 @@ func (m *awsAwsjson11_deserializeOpUpdateOpsMetadata) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateOpsMetadata(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateOpsItem(response, &metadata) } - output := &UpdateOpsMetadataOutput{} + output := &UpdateOpsItemOutput{} out.Result = output var buff [1024]byte @@ -14688,7 +15054,7 @@ func (m *awsAwsjson11_deserializeOpUpdateOpsMetadata) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateOpsMetadataOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUpdateOpsItemOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -14702,7 +15068,7 @@ func (m *awsAwsjson11_deserializeOpUpdateOpsMetadata) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateOpsMetadata(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUpdateOpsItem(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -14746,17 +15112,17 @@ func awsAwsjson11_deserializeOpErrorUpdateOpsMetadata(response *smithyhttp.Respo case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("OpsMetadataInvalidArgumentException", errorCode): - return awsAwsjson11_deserializeErrorOpsMetadataInvalidArgumentException(response, errorBody) + case strings.EqualFold("OpsItemAlreadyExistsException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemAlreadyExistsException(response, errorBody) - case strings.EqualFold("OpsMetadataKeyLimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorOpsMetadataKeyLimitExceededException(response, errorBody) + case strings.EqualFold("OpsItemInvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody) - case strings.EqualFold("OpsMetadataNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorOpsMetadataNotFoundException(response, errorBody) + case strings.EqualFold("OpsItemLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemLimitExceededException(response, errorBody) - case strings.EqualFold("OpsMetadataTooManyUpdatesException", errorCode): - return awsAwsjson11_deserializeErrorOpsMetadataTooManyUpdatesException(response, errorBody) + case strings.EqualFold("OpsItemNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemNotFoundException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -14768,14 +15134,14 @@ func awsAwsjson11_deserializeOpErrorUpdateOpsMetadata(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpUpdatePatchBaseline struct { +type awsAwsjson11_deserializeOpUpdateOpsMetadata struct { } -func (*awsAwsjson11_deserializeOpUpdatePatchBaseline) ID() string { +func (*awsAwsjson11_deserializeOpUpdateOpsMetadata) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdatePatchBaseline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpUpdateOpsMetadata) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -14789,9 +15155,9 @@ func (m *awsAwsjson11_deserializeOpUpdatePatchBaseline) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdatePatchBaseline(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateOpsMetadata(response, &metadata) } - output := &UpdatePatchBaselineOutput{} + output := &UpdateOpsMetadataOutput{} out.Result = output var buff [1024]byte @@ -14811,7 +15177,7 @@ func (m *awsAwsjson11_deserializeOpUpdatePatchBaseline) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdatePatchBaselineOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentUpdateOpsMetadataOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -14825,7 +15191,130 @@ func (m *awsAwsjson11_deserializeOpUpdatePatchBaseline) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdatePatchBaseline(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorUpdateOpsMetadata(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("OpsMetadataInvalidArgumentException", errorCode): + return awsAwsjson11_deserializeErrorOpsMetadataInvalidArgumentException(response, errorBody) + + case strings.EqualFold("OpsMetadataKeyLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorOpsMetadataKeyLimitExceededException(response, errorBody) + + case strings.EqualFold("OpsMetadataNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOpsMetadataNotFoundException(response, errorBody) + + case strings.EqualFold("OpsMetadataTooManyUpdatesException", errorCode): + return awsAwsjson11_deserializeErrorOpsMetadataTooManyUpdatesException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdatePatchBaseline struct { +} + +func (*awsAwsjson11_deserializeOpUpdatePatchBaseline) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdatePatchBaseline) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUpdatePatchBaseline(response, &metadata) + } + output := &UpdatePatchBaselineOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentUpdatePatchBaselineOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdatePatchBaseline(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -15364,6 +15853,41 @@ func awsAwsjson11_deserializeErrorAssociationVersionLimitExceeded(response *smit return output } +func awsAwsjson11_deserializeErrorAutomationDefinitionNotApprovedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.AutomationDefinitionNotApprovedException{} + err := awsAwsjson11_deserializeDocumentAutomationDefinitionNotApprovedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + func awsAwsjson11_deserializeErrorAutomationDefinitionNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -20036,6 +20560,11 @@ func awsAwsjson11_deserializeDocumentAssociationDescription(v **types.Associatio sv.SyncCompliance = types.AssociationSyncCompliance(jtv) } + case "TargetLocations": + if err := awsAwsjson11_deserializeDocumentTargetLocations(&sv.TargetLocations, value); err != nil { + return err + } + case "Targets": if err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil { return err @@ -20829,6 +21358,11 @@ func awsAwsjson11_deserializeDocumentAssociationVersionInfo(v **types.Associatio sv.SyncCompliance = types.AssociationSyncCompliance(jtv) } + case "TargetLocations": + if err := awsAwsjson11_deserializeDocumentTargetLocations(&sv.TargetLocations, value); err != nil { + return err + } + case "Targets": if err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil { return err @@ -21105,6 +21639,46 @@ func awsAwsjson11_deserializeDocumentAttachmentInformationList(v *[]types.Attach return nil } +func awsAwsjson11_deserializeDocumentAutomationDefinitionNotApprovedException(v **types.AutomationDefinitionNotApprovedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AutomationDefinitionNotApprovedException + if *v == nil { + sv = &types.AutomationDefinitionNotApprovedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentAutomationDefinitionNotFoundException(v **types.AutomationDefinitionNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -21207,6 +21781,15 @@ func awsAwsjson11_deserializeDocumentAutomationExecution(v **types.AutomationExe for key, value := range shape { switch key { + case "AssociationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AssociationId = ptr.String(jtv) + } + case "AutomationExecutionId": if value != nil { jtv, ok := value.(string) @@ -21225,6 +21808,24 @@ func awsAwsjson11_deserializeDocumentAutomationExecution(v **types.AutomationExe sv.AutomationExecutionStatus = types.AutomationExecutionStatus(jtv) } + case "AutomationSubtype": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AutomationSubtype to be of type string, got %T instead", value) + } + sv.AutomationSubtype = types.AutomationSubtype(jtv) + } + + case "ChangeRequestName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ChangeRequestName to be of type string, got %T instead", value) + } + sv.ChangeRequestName = ptr.String(jtv) + } + case "CurrentAction": if value != nil { jtv, ok := value.(string) @@ -21332,6 +21933,15 @@ func awsAwsjson11_deserializeDocumentAutomationExecution(v **types.AutomationExe sv.Mode = types.ExecutionMode(jtv) } + case "OpsItemId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.OpsItemId = ptr.String(jtv) + } + case "Outputs": if err := awsAwsjson11_deserializeDocumentAutomationParameterMap(&sv.Outputs, value); err != nil { return err @@ -21361,6 +21971,24 @@ func awsAwsjson11_deserializeDocumentAutomationExecution(v **types.AutomationExe return err } + case "Runbooks": + if err := awsAwsjson11_deserializeDocumentRunbooks(&sv.Runbooks, value); err != nil { + return err + } + + case "ScheduledTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ScheduledTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + case "StepExecutions": if err := awsAwsjson11_deserializeDocumentStepExecutionList(&sv.StepExecutions, value); err != nil { return err @@ -21479,6 +22107,15 @@ func awsAwsjson11_deserializeDocumentAutomationExecutionMetadata(v **types.Autom for key, value := range shape { switch key { + case "AssociationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AssociationId = ptr.String(jtv) + } + case "AutomationExecutionId": if value != nil { jtv, ok := value.(string) @@ -21497,6 +22134,15 @@ func awsAwsjson11_deserializeDocumentAutomationExecutionMetadata(v **types.Autom sv.AutomationExecutionStatus = types.AutomationExecutionStatus(jtv) } + case "AutomationSubtype": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AutomationSubtype to be of type string, got %T instead", value) + } + sv.AutomationSubtype = types.AutomationSubtype(jtv) + } + case "AutomationType": if value != nil { jtv, ok := value.(string) @@ -21506,6 +22152,15 @@ func awsAwsjson11_deserializeDocumentAutomationExecutionMetadata(v **types.Autom sv.AutomationType = types.AutomationType(jtv) } + case "ChangeRequestName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ChangeRequestName to be of type string, got %T instead", value) + } + sv.ChangeRequestName = ptr.String(jtv) + } + case "CurrentAction": if value != nil { jtv, ok := value.(string) @@ -21622,6 +22277,15 @@ func awsAwsjson11_deserializeDocumentAutomationExecutionMetadata(v **types.Autom sv.Mode = types.ExecutionMode(jtv) } + case "OpsItemId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.OpsItemId = ptr.String(jtv) + } + case "Outputs": if err := awsAwsjson11_deserializeDocumentAutomationParameterMap(&sv.Outputs, value); err != nil { return err @@ -21641,6 +22305,24 @@ func awsAwsjson11_deserializeDocumentAutomationExecutionMetadata(v **types.Autom return err } + case "Runbooks": + if err := awsAwsjson11_deserializeDocumentRunbooks(&sv.Runbooks, value); err != nil { + return err + } + + case "ScheduledTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ScheduledTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + case "Target": if value != nil { jtv, ok := value.(string) @@ -23126,6 +23808,11 @@ func awsAwsjson11_deserializeDocumentCreateAssociationBatchRequestEntry(v **type sv.SyncCompliance = types.AssociationSyncCompliance(jtv) } + case "TargetLocations": + if err := awsAwsjson11_deserializeDocumentTargetLocations(&sv.TargetLocations, value); err != nil { + return err + } + case "Targets": if err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil { return err @@ -23300,11 +23987,29 @@ func awsAwsjson11_deserializeDocumentDocumentDescription(v **types.DocumentDescr for key, value := range shape { switch key { + case "ApprovedVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentVersion to be of type string, got %T instead", value) + } + sv.ApprovedVersion = ptr.String(jtv) + } + case "AttachmentsInformation": if err := awsAwsjson11_deserializeDocumentAttachmentInformationList(&sv.AttachmentsInformation, value); err != nil { return err } + case "Author": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentAuthor to be of type string, got %T instead", value) + } + sv.Author = ptr.String(jtv) + } + case "CreatedDate": if value != nil { jtv, ok := value.(json.Number) @@ -23413,6 +24118,15 @@ func awsAwsjson11_deserializeDocumentDocumentDescription(v **types.DocumentDescr return err } + case "PendingReviewVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentVersion to be of type string, got %T instead", value) + } + sv.PendingReviewVersion = ptr.String(jtv) + } + case "PlatformTypes": if err := awsAwsjson11_deserializeDocumentPlatformTypeList(&sv.PlatformTypes, value); err != nil { return err @@ -23423,6 +24137,20 @@ func awsAwsjson11_deserializeDocumentDocumentDescription(v **types.DocumentDescr return err } + case "ReviewInformation": + if err := awsAwsjson11_deserializeDocumentReviewInformationList(&sv.ReviewInformation, value); err != nil { + return err + } + + case "ReviewStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ReviewStatus to be of type string, got %T instead", value) + } + sv.ReviewStatus = types.ReviewStatus(jtv) + } + case "SchemaVersion": if value != nil { jtv, ok := value.(string) @@ -23513,6 +24241,15 @@ func awsAwsjson11_deserializeDocumentDocumentIdentifier(v **types.DocumentIdenti for key, value := range shape { switch key { + case "Author": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentAuthor to be of type string, got %T instead", value) + } + sv.Author = ptr.String(jtv) + } + case "DocumentFormat": if value != nil { jtv, ok := value.(string) @@ -23568,6 +24305,15 @@ func awsAwsjson11_deserializeDocumentDocumentIdentifier(v **types.DocumentIdenti return err } + case "ReviewStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ReviewStatus to be of type string, got %T instead", value) + } + sv.ReviewStatus = types.ReviewStatus(jtv) + } + case "SchemaVersion": if value != nil { jtv, ok := value.(string) @@ -23683,6 +24429,42 @@ func awsAwsjson11_deserializeDocumentDocumentLimitExceeded(v **types.DocumentLim return nil } +func awsAwsjson11_deserializeDocumentDocumentMetadataResponseInfo(v **types.DocumentMetadataResponseInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DocumentMetadataResponseInfo + if *v == nil { + sv = &types.DocumentMetadataResponseInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ReviewerResponse": + if err := awsAwsjson11_deserializeDocumentDocumentReviewerResponseList(&sv.ReviewerResponse, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentDocumentParameter(v **types.DocumentParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -23907,6 +24689,203 @@ func awsAwsjson11_deserializeDocumentDocumentRequiresList(v *[]types.DocumentReq return nil } +func awsAwsjson11_deserializeDocumentDocumentReviewCommentList(v *[]types.DocumentReviewCommentSource, 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.DocumentReviewCommentSource + if *v == nil { + cv = []types.DocumentReviewCommentSource{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DocumentReviewCommentSource + destAddr := &col + if err := awsAwsjson11_deserializeDocumentDocumentReviewCommentSource(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentDocumentReviewCommentSource(v **types.DocumentReviewCommentSource, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DocumentReviewCommentSource + if *v == nil { + sv = &types.DocumentReviewCommentSource{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Content": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentReviewComment to be of type string, got %T instead", value) + } + sv.Content = ptr.String(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentReviewCommentType to be of type string, got %T instead", value) + } + sv.Type = types.DocumentReviewCommentType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDocumentReviewerResponseList(v *[]types.DocumentReviewerResponseSource, 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.DocumentReviewerResponseSource + if *v == nil { + cv = []types.DocumentReviewerResponseSource{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DocumentReviewerResponseSource + destAddr := &col + if err := awsAwsjson11_deserializeDocumentDocumentReviewerResponseSource(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentDocumentReviewerResponseSource(v **types.DocumentReviewerResponseSource, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DocumentReviewerResponseSource + if *v == nil { + sv = &types.DocumentReviewerResponseSource{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Comment": + if err := awsAwsjson11_deserializeDocumentDocumentReviewCommentList(&sv.Comment, value); err != nil { + return err + } + + case "CreateTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "Reviewer": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Reviewer to be of type string, got %T instead", value) + } + sv.Reviewer = ptr.String(jtv) + } + + case "ReviewStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ReviewStatus to be of type string, got %T instead", value) + } + sv.ReviewStatus = types.ReviewStatus(jtv) + } + + case "UpdatedTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentDocumentVersionInfo(v **types.DocumentVersionInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -23978,6 +24957,15 @@ func awsAwsjson11_deserializeDocumentDocumentVersionInfo(v **types.DocumentVersi sv.Name = ptr.String(jtv) } + case "ReviewStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ReviewStatus to be of type string, got %T instead", value) + } + sv.ReviewStatus = types.ReviewStatus(jtv) + } + case "Status": if value != nil { jtv, ok := value.(string) @@ -30528,6 +31516,32 @@ func awsAwsjson11_deserializeDocumentOpsItem(v **types.OpsItem, value interface{ for key, value := range shape { switch key { + case "ActualEndTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ActualEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "ActualStartTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ActualStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + case "Category": if value != nil { jtv, ok := value.(string) @@ -30609,6 +31623,41 @@ func awsAwsjson11_deserializeDocumentOpsItem(v **types.OpsItem, value interface{ sv.OpsItemId = ptr.String(jtv) } + case "OpsItemType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OpsItemType to be of type string, got %T instead", value) + } + sv.OpsItemType = ptr.String(jtv) + } + + case "PlannedEndTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.PlannedEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "PlannedStartTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.PlannedStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + case "Priority": if value != nil { jtv, ok := value.(json.Number) @@ -30779,6 +31828,174 @@ func awsAwsjson11_deserializeDocumentOpsItemDataValue(v **types.OpsItemDataValue return nil } +func awsAwsjson11_deserializeDocumentOpsItemEventSummaries(v *[]types.OpsItemEventSummary, 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.OpsItemEventSummary + if *v == nil { + cv = []types.OpsItemEventSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.OpsItemEventSummary + destAddr := &col + if err := awsAwsjson11_deserializeDocumentOpsItemEventSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentOpsItemEventSummary(v **types.OpsItemEventSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.OpsItemEventSummary + if *v == nil { + sv = &types.OpsItemEventSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedBy": + if err := awsAwsjson11_deserializeDocumentOpsItemIdentity(&sv.CreatedBy, value); err != nil { + return err + } + + case "CreatedTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "Detail": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Detail = ptr.String(jtv) + } + + case "DetailType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DetailType = ptr.String(jtv) + } + + case "EventId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.EventId = ptr.String(jtv) + } + + case "OpsItemId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.OpsItemId = ptr.String(jtv) + } + + case "Source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Source = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentOpsItemIdentity(v **types.OpsItemIdentity, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.OpsItemIdentity + if *v == nil { + sv = &types.OpsItemIdentity{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentOpsItemInvalidParameterException(v **types.OpsItemInvalidParameterException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -31132,6 +32349,32 @@ func awsAwsjson11_deserializeDocumentOpsItemSummary(v **types.OpsItemSummary, va for key, value := range shape { switch key { + case "ActualEndTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ActualEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "ActualStartTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ActualStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + case "Category": if value != nil { jtv, ok := value.(string) @@ -31199,6 +32442,41 @@ func awsAwsjson11_deserializeDocumentOpsItemSummary(v **types.OpsItemSummary, va sv.OpsItemId = ptr.String(jtv) } + case "OpsItemType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OpsItemType to be of type string, got %T instead", value) + } + sv.OpsItemType = ptr.String(jtv) + } + + case "PlannedEndTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.PlannedEndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "PlannedStartTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.PlannedStartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + case "Priority": if value != nil { jtv, ok := value.(json.Number) @@ -35259,6 +36537,227 @@ func awsAwsjson11_deserializeDocumentResourceLimitExceededException(v **types.Re return nil } +func awsAwsjson11_deserializeDocumentReviewInformation(v **types.ReviewInformation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ReviewInformation + if *v == nil { + sv = &types.ReviewInformation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ReviewedTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DateTime to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ReviewedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "Reviewer": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Reviewer to be of type string, got %T instead", value) + } + sv.Reviewer = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ReviewStatus to be of type string, got %T instead", value) + } + sv.Status = types.ReviewStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentReviewInformationList(v *[]types.ReviewInformation, 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.ReviewInformation + if *v == nil { + cv = []types.ReviewInformation{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ReviewInformation + destAddr := &col + if err := awsAwsjson11_deserializeDocumentReviewInformation(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentRunbook(v **types.Runbook, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Runbook + if *v == nil { + sv = &types.Runbook{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DocumentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentARN to be of type string, got %T instead", value) + } + sv.DocumentName = ptr.String(jtv) + } + + case "DocumentVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentVersion to be of type string, got %T instead", value) + } + sv.DocumentVersion = ptr.String(jtv) + } + + case "MaxConcurrency": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MaxConcurrency to be of type string, got %T instead", value) + } + sv.MaxConcurrency = ptr.String(jtv) + } + + case "MaxErrors": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MaxErrors to be of type string, got %T instead", value) + } + sv.MaxErrors = ptr.String(jtv) + } + + case "Parameters": + if err := awsAwsjson11_deserializeDocumentAutomationParameterMap(&sv.Parameters, value); err != nil { + return err + } + + case "TargetLocations": + if err := awsAwsjson11_deserializeDocumentTargetLocations(&sv.TargetLocations, value); err != nil { + return err + } + + case "TargetParameterName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AutomationParameterKey to be of type string, got %T instead", value) + } + sv.TargetParameterName = ptr.String(jtv) + } + + case "Targets": + if err := awsAwsjson11_deserializeDocumentTargets(&sv.Targets, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentRunbooks(v *[]types.Runbook, 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.Runbook + if *v == nil { + cv = []types.Runbook{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Runbook + destAddr := &col + if err := awsAwsjson11_deserializeDocumentRunbook(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentS3OutputLocation(v **types.S3OutputLocation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -40197,6 +41696,15 @@ func awsAwsjson11_deserializeOpDocumentGetDocumentOutput(v **GetDocumentOutput, return err } + case "ReviewStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ReviewStatus to be of type string, got %T instead", value) + } + sv.ReviewStatus = types.ReviewStatus(jtv) + } + case "Status": if value != nil { jtv, ok := value.(string) @@ -41776,7 +43284,259 @@ func awsAwsjson11_deserializeOpDocumentListCommandInvocationsOutput(v **ListComm return nil } -func awsAwsjson11_deserializeOpDocumentListCommandsOutput(v **ListCommandsOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentListCommandsOutput(v **ListCommandsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListCommandsOutput + if *v == nil { + sv = &ListCommandsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Commands": + if err := awsAwsjson11_deserializeDocumentCommandList(&sv.Commands, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListComplianceItemsOutput(v **ListComplianceItemsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListComplianceItemsOutput + if *v == nil { + sv = &ListComplianceItemsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ComplianceItems": + if err := awsAwsjson11_deserializeDocumentComplianceItemList(&sv.ComplianceItems, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListComplianceSummariesOutput(v **ListComplianceSummariesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListComplianceSummariesOutput + if *v == nil { + sv = &ListComplianceSummariesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ComplianceSummaryItems": + if err := awsAwsjson11_deserializeDocumentComplianceSummaryItemList(&sv.ComplianceSummaryItems, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListDocumentMetadataHistoryOutput(v **ListDocumentMetadataHistoryOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListDocumentMetadataHistoryOutput + if *v == nil { + sv = &ListDocumentMetadataHistoryOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Author": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentAuthor to be of type string, got %T instead", value) + } + sv.Author = ptr.String(jtv) + } + + case "DocumentVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentVersion to be of type string, got %T instead", value) + } + sv.DocumentVersion = ptr.String(jtv) + } + + case "Metadata": + if err := awsAwsjson11_deserializeDocumentDocumentMetadataResponseInfo(&sv.Metadata, value); err != nil { + return err + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListDocumentsOutput(v **ListDocumentsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListDocumentsOutput + if *v == nil { + sv = &ListDocumentsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DocumentIdentifiers": + if err := awsAwsjson11_deserializeDocumentDocumentIdentifierList(&sv.DocumentIdentifiers, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListDocumentVersionsOutput(v **ListDocumentVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -41789,17 +43549,17 @@ func awsAwsjson11_deserializeOpDocumentListCommandsOutput(v **ListCommandsOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListCommandsOutput + var sv *ListDocumentVersionsOutput if *v == nil { - sv = &ListCommandsOutput{} + sv = &ListDocumentVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Commands": - if err := awsAwsjson11_deserializeDocumentCommandList(&sv.Commands, value); err != nil { + case "DocumentVersions": + if err := awsAwsjson11_deserializeDocumentDocumentVersionList(&sv.DocumentVersions, value); err != nil { return err } @@ -41821,7 +43581,7 @@ func awsAwsjson11_deserializeOpDocumentListCommandsOutput(v **ListCommandsOutput return nil } -func awsAwsjson11_deserializeOpDocumentListComplianceItemsOutput(v **ListComplianceItemsOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentListInventoryEntriesOutput(v **ListInventoryEntriesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -41834,108 +43594,36 @@ func awsAwsjson11_deserializeOpDocumentListComplianceItemsOutput(v **ListComplia return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListComplianceItemsOutput + var sv *ListInventoryEntriesOutput if *v == nil { - sv = &ListComplianceItemsOutput{} + sv = &ListInventoryEntriesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ComplianceItems": - if err := awsAwsjson11_deserializeDocumentComplianceItemList(&sv.ComplianceItems, value); err != nil { - return err - } - - case "NextToken": + case "CaptureTime": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected InventoryItemCaptureTime to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.CaptureTime = ptr.String(jtv) } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListComplianceSummariesOutput(v **ListComplianceSummariesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListComplianceSummariesOutput - if *v == nil { - sv = &ListComplianceSummariesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "ComplianceSummaryItems": - if err := awsAwsjson11_deserializeDocumentComplianceSummaryItemList(&sv.ComplianceSummaryItems, value); err != nil { + case "Entries": + if err := awsAwsjson11_deserializeDocumentInventoryItemEntryList(&sv.Entries, value); err != nil { return err } - case "NextToken": + case "InstanceId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected InstanceId to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListDocumentsOutput(v **ListDocumentsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListDocumentsOutput - if *v == nil { - sv = &ListDocumentsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "DocumentIdentifiers": - if err := awsAwsjson11_deserializeDocumentDocumentIdentifierList(&sv.DocumentIdentifiers, value); err != nil { - return err + sv.InstanceId = ptr.String(jtv) } case "NextToken": @@ -41947,49 +43635,22 @@ func awsAwsjson11_deserializeOpDocumentListDocumentsOutput(v **ListDocumentsOutp sv.NextToken = ptr.String(jtv) } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListDocumentVersionsOutput(v **ListDocumentVersionsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListDocumentVersionsOutput - if *v == nil { - sv = &ListDocumentVersionsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "DocumentVersions": - if err := awsAwsjson11_deserializeDocumentDocumentVersionList(&sv.DocumentVersions, value); err != nil { - return err + case "SchemaVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InventoryItemSchemaVersion to be of type string, got %T instead", value) + } + sv.SchemaVersion = ptr.String(jtv) } - case "NextToken": + case "TypeName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected InventoryItemTypeName to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.TypeName = ptr.String(jtv) } default: @@ -42001,7 +43662,7 @@ func awsAwsjson11_deserializeOpDocumentListDocumentVersionsOutput(v **ListDocume return nil } -func awsAwsjson11_deserializeOpDocumentListInventoryEntriesOutput(v **ListInventoryEntriesOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentListOpsItemEventsOutput(v **ListOpsItemEventsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -42014,63 +43675,27 @@ func awsAwsjson11_deserializeOpDocumentListInventoryEntriesOutput(v **ListInvent return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListInventoryEntriesOutput + var sv *ListOpsItemEventsOutput if *v == nil { - sv = &ListInventoryEntriesOutput{} + sv = &ListOpsItemEventsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "CaptureTime": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected InventoryItemCaptureTime to be of type string, got %T instead", value) - } - sv.CaptureTime = ptr.String(jtv) - } - - case "Entries": - if err := awsAwsjson11_deserializeDocumentInventoryItemEntryList(&sv.Entries, value); err != nil { - return err - } - - case "InstanceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected InstanceId to be of type string, got %T instead", value) - } - sv.InstanceId = ptr.String(jtv) - } - case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } - case "SchemaVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected InventoryItemSchemaVersion to be of type string, got %T instead", value) - } - sv.SchemaVersion = ptr.String(jtv) - } - - case "TypeName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected InventoryItemTypeName to be of type string, got %T instead", value) - } - sv.TypeName = ptr.String(jtv) + case "Summaries": + if err := awsAwsjson11_deserializeDocumentOpsItemEventSummaries(&sv.Summaries, value); err != nil { + return err } default: @@ -42840,6 +44465,46 @@ func awsAwsjson11_deserializeOpDocumentStartAutomationExecutionOutput(v **StartA return nil } +func awsAwsjson11_deserializeOpDocumentStartChangeRequestExecutionOutput(v **StartChangeRequestExecutionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartChangeRequestExecutionOutput + if *v == nil { + sv = &StartChangeRequestExecutionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AutomationExecutionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AutomationExecutionId to be of type string, got %T instead", value) + } + sv.AutomationExecutionId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentStartSessionOutput(v **StartSessionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -43077,6 +44742,37 @@ func awsAwsjson11_deserializeOpDocumentUpdateDocumentDefaultVersionOutput(v **Up return nil } +func awsAwsjson11_deserializeOpDocumentUpdateDocumentMetadataOutput(v **UpdateDocumentMetadataOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateDocumentMetadataOutput + if *v == nil { + sv = &UpdateDocumentMetadataOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentUpdateDocumentOutput(v **UpdateDocumentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/ssm/serializers.go b/service/ssm/serializers.go index 977ce50819f..bbb956399b3 100644 --- a/service/ssm/serializers.go +++ b/service/ssm/serializers.go @@ -4109,6 +4109,52 @@ func (m *awsAwsjson11_serializeOpListComplianceSummaries) HandleSerialize(ctx co return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpListDocumentMetadataHistory struct { +} + +func (*awsAwsjson11_serializeOpListDocumentMetadataHistory) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListDocumentMetadataHistory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListDocumentMetadataHistoryInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSSM.ListDocumentMetadataHistory") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListDocumentMetadataHistoryInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpListDocuments struct { } @@ -4247,6 +4293,52 @@ func (m *awsAwsjson11_serializeOpListInventoryEntries) HandleSerialize(ctx conte return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpListOpsItemEvents struct { +} + +func (*awsAwsjson11_serializeOpListOpsItemEvents) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListOpsItemEvents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListOpsItemEventsInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSSM.ListOpsItemEvents") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListOpsItemEventsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpListOpsMetadata struct { } @@ -5121,6 +5213,52 @@ func (m *awsAwsjson11_serializeOpStartAutomationExecution) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpStartChangeRequestExecution struct { +} + +func (*awsAwsjson11_serializeOpStartChangeRequestExecution) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpStartChangeRequestExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartChangeRequestExecutionInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSSM.StartChangeRequestExecution") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentStartChangeRequestExecutionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpStartSession struct { } @@ -5443,6 +5581,52 @@ func (m *awsAwsjson11_serializeOpUpdateDocumentDefaultVersion) HandleSerialize(c return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpUpdateDocumentMetadata struct { +} + +func (*awsAwsjson11_serializeOpUpdateDocumentMetadata) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateDocumentMetadata) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateDocumentMetadataInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSSM.UpdateDocumentMetadata") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateDocumentMetadataInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpUpdateMaintenanceWindow struct { } @@ -6423,6 +6607,13 @@ func awsAwsjson11_serializeDocumentCreateAssociationBatchRequestEntry(v *types.C ok.String(string(v.SyncCompliance)) } + if v.TargetLocations != nil { + ok := object.Key("TargetLocations") + if err := awsAwsjson11_serializeDocumentTargetLocations(v.TargetLocations, ok); err != nil { + return err + } + } + if v.Targets != nil { ok := object.Key("Targets") if err := awsAwsjson11_serializeDocumentTargets(v.Targets, ok); err != nil { @@ -6568,6 +6759,55 @@ func awsAwsjson11_serializeDocumentDocumentRequiresList(v []types.DocumentRequir return nil } +func awsAwsjson11_serializeDocumentDocumentReviewCommentList(v []types.DocumentReviewCommentSource, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentDocumentReviewCommentSource(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentDocumentReviewCommentSource(v *types.DocumentReviewCommentSource, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Content != nil { + ok := object.Key("Content") + ok.String(*v.Content) + } + + if len(v.Type) > 0 { + ok := object.Key("Type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsAwsjson11_serializeDocumentDocumentReviews(v *types.DocumentReviews, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Action) > 0 { + ok := object.Key("Action") + ok.String(string(v.Action)) + } + + if v.Comment != nil { + ok := object.Key("Comment") + if err := awsAwsjson11_serializeDocumentDocumentReviewCommentList(v.Comment, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeDocumentInstanceAssociationOutputLocation(v *types.InstanceAssociationOutputLocation, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7407,6 +7647,54 @@ func awsAwsjson11_serializeDocumentOpsItemDataValue(v *types.OpsItemDataValue, v return nil } +func awsAwsjson11_serializeDocumentOpsItemEventFilter(v *types.OpsItemEventFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Key) > 0 { + ok := object.Key("Key") + ok.String(string(v.Key)) + } + + if len(v.Operator) > 0 { + ok := object.Key("Operator") + ok.String(string(v.Operator)) + } + + if v.Values != nil { + ok := object.Key("Values") + if err := awsAwsjson11_serializeDocumentOpsItemEventFilterValues(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentOpsItemEventFilters(v []types.OpsItemEventFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentOpsItemEventFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentOpsItemEventFilterValues(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentOpsItemFilter(v *types.OpsItemFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -8131,6 +8419,72 @@ func awsAwsjson11_serializeDocumentResultAttributeList(v []types.ResultAttribute return nil } +func awsAwsjson11_serializeDocumentRunbook(v *types.Runbook, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DocumentName != nil { + ok := object.Key("DocumentName") + ok.String(*v.DocumentName) + } + + if v.DocumentVersion != nil { + ok := object.Key("DocumentVersion") + ok.String(*v.DocumentVersion) + } + + if v.MaxConcurrency != nil { + ok := object.Key("MaxConcurrency") + ok.String(*v.MaxConcurrency) + } + + if v.MaxErrors != nil { + ok := object.Key("MaxErrors") + ok.String(*v.MaxErrors) + } + + if v.Parameters != nil { + ok := object.Key("Parameters") + if err := awsAwsjson11_serializeDocumentAutomationParameterMap(v.Parameters, ok); err != nil { + return err + } + } + + if v.TargetLocations != nil { + ok := object.Key("TargetLocations") + if err := awsAwsjson11_serializeDocumentTargetLocations(v.TargetLocations, ok); err != nil { + return err + } + } + + if v.TargetParameterName != nil { + ok := object.Key("TargetParameterName") + ok.String(*v.TargetParameterName) + } + + if v.Targets != nil { + ok := object.Key("Targets") + if err := awsAwsjson11_serializeDocumentTargets(v.Targets, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentRunbooks(v []types.Runbook, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentRunbook(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeDocumentS3OutputLocation(v *types.S3OutputLocation, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -8610,6 +8964,13 @@ func awsAwsjson11_serializeOpDocumentCreateAssociationInput(v *CreateAssociation ok.String(string(v.SyncCompliance)) } + if v.TargetLocations != nil { + ok := object.Key("TargetLocations") + if err := awsAwsjson11_serializeDocumentTargetLocations(v.TargetLocations, ok); err != nil { + return err + } + } + if v.Targets != nil { ok := object.Key("Targets") if err := awsAwsjson11_serializeDocumentTargets(v.Targets, ok); err != nil { @@ -8751,6 +9112,16 @@ func awsAwsjson11_serializeOpDocumentCreateOpsItemInput(v *CreateOpsItemInput, v object := value.Object() defer object.Close() + if v.ActualEndTime != nil { + ok := object.Key("ActualEndTime") + ok.Double(smithytime.FormatEpochSeconds(*v.ActualEndTime)) + } + + if v.ActualStartTime != nil { + ok := object.Key("ActualStartTime") + ok.Double(smithytime.FormatEpochSeconds(*v.ActualStartTime)) + } + if v.Category != nil { ok := object.Key("Category") ok.String(*v.Category) @@ -8775,6 +9146,21 @@ func awsAwsjson11_serializeOpDocumentCreateOpsItemInput(v *CreateOpsItemInput, v } } + if v.OpsItemType != nil { + ok := object.Key("OpsItemType") + ok.String(*v.OpsItemType) + } + + if v.PlannedEndTime != nil { + ok := object.Key("PlannedEndTime") + ok.Double(smithytime.FormatEpochSeconds(*v.PlannedEndTime)) + } + + if v.PlannedStartTime != nil { + ok := object.Key("PlannedStartTime") + ok.Double(smithytime.FormatEpochSeconds(*v.PlannedStartTime)) + } + if v.Priority != nil { ok := object.Key("Priority") ok.Integer(*v.Priority) @@ -10733,6 +11119,38 @@ func awsAwsjson11_serializeOpDocumentListComplianceSummariesInput(v *ListComplia return nil } +func awsAwsjson11_serializeOpDocumentListDocumentMetadataHistoryInput(v *ListDocumentMetadataHistoryInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DocumentVersion != nil { + ok := object.Key("DocumentVersion") + ok.String(*v.DocumentVersion) + } + + if v.MaxResults != 0 { + ok := object.Key("MaxResults") + ok.Integer(v.MaxResults) + } + + if len(v.Metadata) > 0 { + ok := object.Key("Metadata") + ok.String(string(v.Metadata)) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListDocumentsInput(v *ListDocumentsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -10820,6 +11238,30 @@ func awsAwsjson11_serializeOpDocumentListInventoryEntriesInput(v *ListInventoryE return nil } +func awsAwsjson11_serializeOpDocumentListOpsItemEventsInput(v *ListOpsItemEventsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsAwsjson11_serializeDocumentOpsItemEventFilters(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 +} + func awsAwsjson11_serializeOpDocumentListOpsMetadataInput(v *ListOpsMetadataInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -11495,6 +11937,59 @@ func awsAwsjson11_serializeOpDocumentStartAutomationExecutionInput(v *StartAutom return nil } +func awsAwsjson11_serializeOpDocumentStartChangeRequestExecutionInput(v *StartChangeRequestExecutionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ChangeRequestName != nil { + ok := object.Key("ChangeRequestName") + ok.String(*v.ChangeRequestName) + } + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.DocumentName != nil { + ok := object.Key("DocumentName") + ok.String(*v.DocumentName) + } + + if v.DocumentVersion != nil { + ok := object.Key("DocumentVersion") + ok.String(*v.DocumentVersion) + } + + if v.Parameters != nil { + ok := object.Key("Parameters") + if err := awsAwsjson11_serializeDocumentAutomationParameterMap(v.Parameters, ok); err != nil { + return err + } + } + + if v.Runbooks != nil { + ok := object.Key("Runbooks") + if err := awsAwsjson11_serializeDocumentRunbooks(v.Runbooks, ok); err != nil { + return err + } + } + + if v.ScheduledTime != nil { + ok := object.Key("ScheduledTime") + ok.Double(smithytime.FormatEpochSeconds(*v.ScheduledTime)) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentStartSessionInput(v *StartSessionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -11626,6 +12121,13 @@ func awsAwsjson11_serializeOpDocumentUpdateAssociationInput(v *UpdateAssociation ok.String(string(v.SyncCompliance)) } + if v.TargetLocations != nil { + ok := object.Key("TargetLocations") + if err := awsAwsjson11_serializeDocumentTargetLocations(v.TargetLocations, ok); err != nil { + return err + } + } + if v.Targets != nil { ok := object.Key("Targets") if err := awsAwsjson11_serializeDocumentTargets(v.Targets, ok); err != nil { @@ -11721,6 +12223,30 @@ func awsAwsjson11_serializeOpDocumentUpdateDocumentInput(v *UpdateDocumentInput, return nil } +func awsAwsjson11_serializeOpDocumentUpdateDocumentMetadataInput(v *UpdateDocumentMetadataInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DocumentReviews != nil { + ok := object.Key("DocumentReviews") + if err := awsAwsjson11_serializeDocumentDocumentReviews(v.DocumentReviews, ok); err != nil { + return err + } + } + + if v.DocumentVersion != nil { + ok := object.Key("DocumentVersion") + ok.String(*v.DocumentVersion) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentUpdateMaintenanceWindowInput(v *UpdateMaintenanceWindowInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -11943,6 +12469,16 @@ func awsAwsjson11_serializeOpDocumentUpdateOpsItemInput(v *UpdateOpsItemInput, v object := value.Object() defer object.Close() + if v.ActualEndTime != nil { + ok := object.Key("ActualEndTime") + ok.Double(smithytime.FormatEpochSeconds(*v.ActualEndTime)) + } + + if v.ActualStartTime != nil { + ok := object.Key("ActualStartTime") + ok.Double(smithytime.FormatEpochSeconds(*v.ActualStartTime)) + } + if v.Category != nil { ok := object.Key("Category") ok.String(*v.Category) @@ -11979,6 +12515,16 @@ func awsAwsjson11_serializeOpDocumentUpdateOpsItemInput(v *UpdateOpsItemInput, v ok.String(*v.OpsItemId) } + if v.PlannedEndTime != nil { + ok := object.Key("PlannedEndTime") + ok.Double(smithytime.FormatEpochSeconds(*v.PlannedEndTime)) + } + + if v.PlannedStartTime != nil { + ok := object.Key("PlannedStartTime") + ok.Double(smithytime.FormatEpochSeconds(*v.PlannedStartTime)) + } + if v.Priority != nil { ok := object.Key("Priority") ok.Integer(*v.Priority) diff --git a/service/ssm/types/enums.go b/service/ssm/types/enums.go index dd2038959a8..ea3c9a5acb2 100644 --- a/service/ssm/types/enums.go +++ b/service/ssm/types/enums.go @@ -208,6 +208,8 @@ const ( AutomationExecutionFilterKeyAutomationType AutomationExecutionFilterKey = "AutomationType" AutomationExecutionFilterKeyTagKey AutomationExecutionFilterKey = "TagKey" AutomationExecutionFilterKeyTargetResourceGroup AutomationExecutionFilterKey = "TargetResourceGroup" + AutomationExecutionFilterKeyAutomationSubtype AutomationExecutionFilterKey = "AutomationSubtype" + AutomationExecutionFilterKeyOpsItemId AutomationExecutionFilterKey = "OpsItemId" ) // Values returns all known values for AutomationExecutionFilterKey. Note that this @@ -225,6 +227,8 @@ func (AutomationExecutionFilterKey) Values() []AutomationExecutionFilterKey { "AutomationType", "TagKey", "TargetResourceGroup", + "AutomationSubtype", + "OpsItemId", } } @@ -232,14 +236,24 @@ type AutomationExecutionStatus string // Enum values for AutomationExecutionStatus const ( - AutomationExecutionStatusPending AutomationExecutionStatus = "Pending" - AutomationExecutionStatusInprogress AutomationExecutionStatus = "InProgress" - AutomationExecutionStatusWaiting AutomationExecutionStatus = "Waiting" - AutomationExecutionStatusSuccess AutomationExecutionStatus = "Success" - AutomationExecutionStatusTimedout AutomationExecutionStatus = "TimedOut" - AutomationExecutionStatusCancelling AutomationExecutionStatus = "Cancelling" - AutomationExecutionStatusCancelled AutomationExecutionStatus = "Cancelled" - AutomationExecutionStatusFailed AutomationExecutionStatus = "Failed" + AutomationExecutionStatusPending AutomationExecutionStatus = "Pending" + AutomationExecutionStatusInprogress AutomationExecutionStatus = "InProgress" + AutomationExecutionStatusWaiting AutomationExecutionStatus = "Waiting" + AutomationExecutionStatusSuccess AutomationExecutionStatus = "Success" + AutomationExecutionStatusTimedout AutomationExecutionStatus = "TimedOut" + AutomationExecutionStatusCancelling AutomationExecutionStatus = "Cancelling" + AutomationExecutionStatusCancelled AutomationExecutionStatus = "Cancelled" + AutomationExecutionStatusFailed AutomationExecutionStatus = "Failed" + AutomationExecutionStatusPendingApproval AutomationExecutionStatus = "PendingApproval" + AutomationExecutionStatusApproved AutomationExecutionStatus = "Approved" + AutomationExecutionStatusRejected AutomationExecutionStatus = "Rejected" + AutomationExecutionStatusScheduled AutomationExecutionStatus = "Scheduled" + AutomationExecutionStatusRunbookInprogress AutomationExecutionStatus = "RunbookInProgress" + AutomationExecutionStatusPendingChangeCalendarOverride AutomationExecutionStatus = "PendingChangeCalendarOverride" + AutomationExecutionStatusChangeCalendarOverrideApproved AutomationExecutionStatus = "ChangeCalendarOverrideApproved" + AutomationExecutionStatusChangeCalendarOverrideRejected AutomationExecutionStatus = "ChangeCalendarOverrideRejected" + AutomationExecutionStatusCompletedWithSuccess AutomationExecutionStatus = "CompletedWithSuccess" + AutomationExecutionStatusCompletedWithFailure AutomationExecutionStatus = "CompletedWithFailure" ) // Values returns all known values for AutomationExecutionStatus. Note that this @@ -255,6 +269,32 @@ func (AutomationExecutionStatus) Values() []AutomationExecutionStatus { "Cancelling", "Cancelled", "Failed", + "PendingApproval", + "Approved", + "Rejected", + "Scheduled", + "RunbookInProgress", + "PendingChangeCalendarOverride", + "ChangeCalendarOverrideApproved", + "ChangeCalendarOverrideRejected", + "CompletedWithSuccess", + "CompletedWithFailure", + } +} + +type AutomationSubtype string + +// Enum values for AutomationSubtype +const ( + AutomationSubtypeChangerequest AutomationSubtype = "ChangeRequest" +) + +// Values returns all known values for AutomationSubtype. 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 (AutomationSubtype) Values() []AutomationSubtype { + return []AutomationSubtype{ + "ChangeRequest", } } @@ -587,8 +627,30 @@ func (DocumentHashType) Values() []DocumentHashType { } } +type DocumentMetadataEnum string + +// Enum values for DocumentMetadataEnum +const ( + DocumentMetadataEnumDocumentreviews DocumentMetadataEnum = "DocumentReviews" +) + +// Values returns all known values for DocumentMetadataEnum. 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 (DocumentMetadataEnum) Values() []DocumentMetadataEnum { + return []DocumentMetadataEnum{ + "DocumentReviews", + } +} + type DocumentParameterType string +// Enum values for DocumentParameterType +const ( + DocumentParameterTypeString DocumentParameterType = "String" + DocumentParameterTypeStringlist DocumentParameterType = "StringList" +) + // Values returns all known values for DocumentParameterType. 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. @@ -615,6 +677,44 @@ func (DocumentPermissionType) Values() []DocumentPermissionType { } } +type DocumentReviewAction string + +// Enum values for DocumentReviewAction +const ( + DocumentReviewActionSendforreview DocumentReviewAction = "SendForReview" + DocumentReviewActionUpdatereview DocumentReviewAction = "UpdateReview" + DocumentReviewActionApprove DocumentReviewAction = "Approve" + DocumentReviewActionReject DocumentReviewAction = "Reject" +) + +// Values returns all known values for DocumentReviewAction. 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 (DocumentReviewAction) Values() []DocumentReviewAction { + return []DocumentReviewAction{ + "SendForReview", + "UpdateReview", + "Approve", + "Reject", + } +} + +type DocumentReviewCommentType string + +// Enum values for DocumentReviewCommentType +const ( + DocumentReviewCommentTypeComment DocumentReviewCommentType = "Comment" +) + +// Values returns all known values for DocumentReviewCommentType. 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 (DocumentReviewCommentType) Values() []DocumentReviewCommentType { + return []DocumentReviewCommentType{ + "Comment", + } +} + type DocumentStatus string // Enum values for DocumentStatus @@ -652,6 +752,7 @@ const ( DocumentTypeApplicationconfigurationschema DocumentType = "ApplicationConfigurationSchema" DocumentTypeDeploymentstrategy DocumentType = "DeploymentStrategy" DocumentTypeChangecalendar DocumentType = "ChangeCalendar" + DocumentTypeChangetemplate DocumentType = "Automation.ChangeTemplate" ) // Values returns all known values for DocumentType. Note that this can be expanded @@ -668,6 +769,7 @@ func (DocumentType) Values() []DocumentType { "ApplicationConfigurationSchema", "DeploymentStrategy", "ChangeCalendar", + "Automation.ChangeTemplate", } } @@ -691,6 +793,13 @@ func (ExecutionMode) Values() []ExecutionMode { type Fault string +// Enum values for Fault +const ( + FaultClient Fault = "Client" + FaultServer Fault = "Server" + FaultUnknown Fault = "Unknown" +) + // Values returns all known values for Fault. 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. @@ -1049,25 +1158,68 @@ func (OpsItemDataType) Values() []OpsItemDataType { } } +type OpsItemEventFilterKey string + +// Enum values for OpsItemEventFilterKey +const ( + OpsItemEventFilterKeyOpsitemId OpsItemEventFilterKey = "OpsItemId" +) + +// Values returns all known values for OpsItemEventFilterKey. 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 (OpsItemEventFilterKey) Values() []OpsItemEventFilterKey { + return []OpsItemEventFilterKey{ + "OpsItemId", + } +} + +type OpsItemEventFilterOperator string + +// Enum values for OpsItemEventFilterOperator +const ( + OpsItemEventFilterOperatorEqual OpsItemEventFilterOperator = "Equal" +) + +// Values returns all known values for OpsItemEventFilterOperator. 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 (OpsItemEventFilterOperator) Values() []OpsItemEventFilterOperator { + return []OpsItemEventFilterOperator{ + "Equal", + } +} + type OpsItemFilterKey string // Enum values for OpsItemFilterKey const ( - OpsItemFilterKeyStatus OpsItemFilterKey = "Status" - OpsItemFilterKeyCreatedBy OpsItemFilterKey = "CreatedBy" - OpsItemFilterKeySource OpsItemFilterKey = "Source" - OpsItemFilterKeyPriority OpsItemFilterKey = "Priority" - OpsItemFilterKeyTitle OpsItemFilterKey = "Title" - OpsItemFilterKeyOpsitemId OpsItemFilterKey = "OpsItemId" - OpsItemFilterKeyCreatedTime OpsItemFilterKey = "CreatedTime" - OpsItemFilterKeyLastModifiedTime OpsItemFilterKey = "LastModifiedTime" - OpsItemFilterKeyOperationalData OpsItemFilterKey = "OperationalData" - OpsItemFilterKeyOperationalDataKey OpsItemFilterKey = "OperationalDataKey" - OpsItemFilterKeyOperationalDataValue OpsItemFilterKey = "OperationalDataValue" - OpsItemFilterKeyResourceId OpsItemFilterKey = "ResourceId" - OpsItemFilterKeyAutomationId OpsItemFilterKey = "AutomationId" - OpsItemFilterKeyCategory OpsItemFilterKey = "Category" - OpsItemFilterKeySeverity OpsItemFilterKey = "Severity" + OpsItemFilterKeyStatus OpsItemFilterKey = "Status" + OpsItemFilterKeyCreatedBy OpsItemFilterKey = "CreatedBy" + OpsItemFilterKeySource OpsItemFilterKey = "Source" + OpsItemFilterKeyPriority OpsItemFilterKey = "Priority" + OpsItemFilterKeyTitle OpsItemFilterKey = "Title" + OpsItemFilterKeyOpsitemId OpsItemFilterKey = "OpsItemId" + OpsItemFilterKeyCreatedTime OpsItemFilterKey = "CreatedTime" + OpsItemFilterKeyLastModifiedTime OpsItemFilterKey = "LastModifiedTime" + OpsItemFilterKeyActualStartTime OpsItemFilterKey = "ActualStartTime" + OpsItemFilterKeyActualEndTime OpsItemFilterKey = "ActualEndTime" + OpsItemFilterKeyPlannedStartTime OpsItemFilterKey = "PlannedStartTime" + OpsItemFilterKeyPlannedEndTime OpsItemFilterKey = "PlannedEndTime" + OpsItemFilterKeyOperationalData OpsItemFilterKey = "OperationalData" + OpsItemFilterKeyOperationalDataKey OpsItemFilterKey = "OperationalDataKey" + OpsItemFilterKeyOperationalDataValue OpsItemFilterKey = "OperationalDataValue" + OpsItemFilterKeyResourceId OpsItemFilterKey = "ResourceId" + OpsItemFilterKeyAutomationId OpsItemFilterKey = "AutomationId" + OpsItemFilterKeyCategory OpsItemFilterKey = "Category" + OpsItemFilterKeySeverity OpsItemFilterKey = "Severity" + OpsItemFilterKeyOpsitemType OpsItemFilterKey = "OpsItemType" + OpsItemFilterKeyChangeRequestRequesterArn OpsItemFilterKey = "ChangeRequestByRequesterArn" + OpsItemFilterKeyChangeRequestRequesterName OpsItemFilterKey = "ChangeRequestByRequesterName" + OpsItemFilterKeyChangeRequestApproverArn OpsItemFilterKey = "ChangeRequestByApproverArn" + OpsItemFilterKeyChangeRequestApproverName OpsItemFilterKey = "ChangeRequestByApproverName" + OpsItemFilterKeyChangeRequestTemplate OpsItemFilterKey = "ChangeRequestByTemplate" + OpsItemFilterKeyChangeRequestTargetsResourceGroup OpsItemFilterKey = "ChangeRequestByTargetsResourceGroup" ) // Values returns all known values for OpsItemFilterKey. Note that this can be @@ -1083,6 +1235,10 @@ func (OpsItemFilterKey) Values() []OpsItemFilterKey { "OpsItemId", "CreatedTime", "LastModifiedTime", + "ActualStartTime", + "ActualEndTime", + "PlannedStartTime", + "PlannedEndTime", "OperationalData", "OperationalDataKey", "OperationalDataValue", @@ -1090,6 +1246,13 @@ func (OpsItemFilterKey) Values() []OpsItemFilterKey { "AutomationId", "Category", "Severity", + "OpsItemType", + "ChangeRequestByRequesterArn", + "ChangeRequestByRequesterName", + "ChangeRequestByApproverArn", + "ChangeRequestByApproverName", + "ChangeRequestByTemplate", + "ChangeRequestByTargetsResourceGroup", } } @@ -1119,9 +1282,24 @@ type OpsItemStatus string // Enum values for OpsItemStatus const ( - OpsItemStatusOpen OpsItemStatus = "Open" - OpsItemStatusInProgress OpsItemStatus = "InProgress" - OpsItemStatusResolved OpsItemStatus = "Resolved" + OpsItemStatusOpen OpsItemStatus = "Open" + OpsItemStatusInProgress OpsItemStatus = "InProgress" + OpsItemStatusResolved OpsItemStatus = "Resolved" + OpsItemStatusPending OpsItemStatus = "Pending" + OpsItemStatusTimedOut OpsItemStatus = "TimedOut" + OpsItemStatusCancelling OpsItemStatus = "Cancelling" + OpsItemStatusCancelled OpsItemStatus = "Cancelled" + OpsItemStatusFailed OpsItemStatus = "Failed" + OpsItemStatusCompletedWithSuccess OpsItemStatus = "CompletedWithSuccess" + OpsItemStatusCompletedWithFailure OpsItemStatus = "CompletedWithFailure" + OpsItemStatusScheduled OpsItemStatus = "Scheduled" + OpsItemStatusRunbookInProgress OpsItemStatus = "RunbookInProgress" + OpsItemStatusPendingChangeCalendarOverride OpsItemStatus = "PendingChangeCalendarOverride" + OpsItemStatusChangeCalendarOverrideApproved OpsItemStatus = "ChangeCalendarOverrideApproved" + OpsItemStatusChangeCalendarOverrideRejected OpsItemStatus = "ChangeCalendarOverrideRejected" + OpsItemStatusPendingApproval OpsItemStatus = "PendingApproval" + OpsItemStatusApproved OpsItemStatus = "Approved" + OpsItemStatusRejected OpsItemStatus = "Rejected" ) // Values returns all known values for OpsItemStatus. Note that this can be @@ -1132,6 +1310,21 @@ func (OpsItemStatus) Values() []OpsItemStatus { "Open", "InProgress", "Resolved", + "Pending", + "TimedOut", + "Cancelling", + "Cancelled", + "Failed", + "CompletedWithSuccess", + "CompletedWithFailure", + "Scheduled", + "RunbookInProgress", + "PendingChangeCalendarOverride", + "ChangeCalendarOverrideApproved", + "ChangeCalendarOverrideRejected", + "PendingApproval", + "Approved", + "Rejected", } } @@ -1521,6 +1714,28 @@ func (ResourceTypeForTagging) Values() []ResourceTypeForTagging { } } +type ReviewStatus string + +// Enum values for ReviewStatus +const ( + ReviewStatusApproved ReviewStatus = "APPROVED" + ReviewStatusNotReviewed ReviewStatus = "NOT_REVIEWED" + ReviewStatusPending ReviewStatus = "PENDING" + ReviewStatusRejected ReviewStatus = "REJECTED" +) + +// Values returns all known values for ReviewStatus. 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 (ReviewStatus) Values() []ReviewStatus { + return []ReviewStatus{ + "APPROVED", + "NOT_REVIEWED", + "PENDING", + "REJECTED", + } +} + type SessionFilterKey string // Enum values for SessionFilterKey diff --git a/service/ssm/types/errors.go b/service/ssm/types/errors.go index 02d4369dcd8..d68d681095f 100644 --- a/service/ssm/types/errors.go +++ b/service/ssm/types/errors.go @@ -132,6 +132,28 @@ func (e *AssociationVersionLimitExceeded) ErrorCode() string { } func (e *AssociationVersionLimitExceeded) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// Indicates that the Change Manager change template used in the change request was +// rejected or is still in a pending state. +type AutomationDefinitionNotApprovedException struct { + Message *string +} + +func (e *AutomationDefinitionNotApprovedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AutomationDefinitionNotApprovedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AutomationDefinitionNotApprovedException) ErrorCode() string { + return "AutomationDefinitionNotApprovedException" +} +func (e *AutomationDefinitionNotApprovedException) ErrorFault() smithy.ErrorFault { + return smithy.FaultClient +} + // An Automation document with the specified name could not be found. type AutomationDefinitionNotFoundException struct { Message *string @@ -1598,7 +1620,7 @@ func (e *OpsMetadataInvalidArgumentException) ErrorFault() smithy.ErrorFault { } // The OpsMetadata object exceeds the maximum number of OpsMetadata keys that you -// can assign to an application in AppManager. +// can assign to an application in Application Manager. type OpsMetadataKeyLimitExceededException struct { Message *string } @@ -1620,7 +1642,7 @@ func (e *OpsMetadataKeyLimitExceededException) ErrorFault() smithy.ErrorFault { } // Your account reached the maximum number of OpsMetadata objects allowed by -// AppManager. The maximum is 200 OpsMetadata objects. Delete one or more +// Application Manager. The maximum is 200 OpsMetadata objects. Delete one or more // OpsMetadata object and try again. type OpsMetadataLimitExceededException struct { Message *string diff --git a/service/ssm/types/types.go b/service/ssm/types/types.go index d2be2009f4d..bd5e6c69ec3 100644 --- a/service/ssm/types/types.go +++ b/service/ssm/types/types.go @@ -187,6 +187,10 @@ type AssociationDescription struct { // use AUTO mode. SyncCompliance AssociationSyncCompliance + // The combination of AWS Regions and AWS accounts where you want to run the + // association. + TargetLocations []TargetLocation + // The instances targeted by the request. Targets []Target } @@ -412,6 +416,10 @@ type AssociationVersionInfo struct { // use AUTO mode. SyncCompliance AssociationSyncCompliance + // The combination of AWS Regions and AWS accounts where you wanted to run the + // association when this association version was created. + TargetLocations []TargetLocation + // The targets specified for the association when the association version was // created. Targets []Target @@ -481,12 +489,22 @@ type AttachmentsSource struct { // execution. type AutomationExecution struct { + // The ID of a State Manager association used in the Automation operation. + AssociationId *string + // The execution ID. AutomationExecutionId *string // The execution status of the Automation. AutomationExecutionStatus AutomationExecutionStatus + // The subtype of the Automation operation. Currently, the only supported value is + // ChangeRequest. + AutomationSubtype AutomationSubtype + + // The name of the Change Manager change request. + ChangeRequestName *string + // The action of the step that is currently running. CurrentAction *string @@ -521,6 +539,10 @@ type AutomationExecution struct { // The automation execution mode. Mode ExecutionMode + // The ID of an OpsItem that is created to represent a Change Manager change + // request. + OpsItemId *string + // The list of execution outputs as defined in the automation document. Outputs map[string][]string @@ -538,6 +560,15 @@ type AutomationExecution struct { // A list of resolved targets in the rate control execution. ResolvedTargets *ResolvedTargets + // Information about the Automation runbooks (Automation documents) that are run as + // part of a runbook workflow. The Automation runbooks specified for the runbook + // workflow can't run until all required approvals for the change request have been + // received. + Runbooks []Runbook + + // The date and time the Automation operation is scheduled to start. + ScheduledTime *time.Time + // A list of details about the current state of all steps that comprise an // execution. An Automation document contains a list of steps that are run in // order. @@ -586,12 +617,19 @@ type AutomationExecutionFilter struct { // Details about a specific Automation execution. type AutomationExecutionMetadata struct { + // The ID of a State Manager association used in the Automation operation. + AssociationId *string + // The execution ID. AutomationExecutionId *string // The status of the execution. AutomationExecutionStatus AutomationExecutionStatus + // The subtype of the Automation operation. Currently, the only supported value is + // ChangeRequest. + AutomationSubtype AutomationSubtype + // Use this filter with DescribeAutomationExecutions. Specify either Local or // CrossAccount. CrossAccount is an Automation that runs in multiple AWS Regions // and accounts. For more information, see Running Automation workflows in multiple @@ -600,6 +638,9 @@ type AutomationExecutionMetadata struct { // in the AWS Systems Manager User Guide. AutomationType AutomationType + // The name of the Change Manager change request. + ChangeRequestName *string + // The action of the step that is currently running. CurrentAction *string @@ -637,6 +678,10 @@ type AutomationExecutionMetadata struct { // The Automation execution mode. Mode ExecutionMode + // The ID of an OpsItem that is created to represent a Change Manager change + // request. + OpsItemId *string + // The list of execution outputs as defined in the Automation document. Outputs map[string][]string @@ -646,6 +691,15 @@ type AutomationExecutionMetadata struct { // A list of targets that resolved during the execution. ResolvedTargets *ResolvedTargets + // Information about the Automation runbooks (Automation documents) that are run + // during a runbook workflow in Change Manager. The Automation runbooks specified + // for the runbook workflow can't run until all required approvals for the change + // request have been received. + Runbooks []Runbook + + // The date and time the Automation operation is scheduled to start. + ScheduledTime *time.Time + // The list of execution outputs as defined in the Automation document. Target *string @@ -1297,6 +1351,10 @@ type CreateAssociationBatchRequestEntry struct { // use AUTO mode. SyncCompliance AssociationSyncCompliance + // Use this action to create an association in multiple Regions and multiple + // accounts. + TargetLocations []TargetLocation + // The instances targeted by the request. Targets []Target } @@ -1327,10 +1385,16 @@ type DocumentDefaultVersionDescription struct { // Describes a Systems Manager document. type DocumentDescription struct { + // The version of the document currently approved for use in the organization. + ApprovedVersion *string + // Details about the document attachments, including names, locations, sizes, and // so on. AttachmentsInformation []AttachmentInformation + // The user in your organization who created the document. + Author *string + // The date when the document was created. CreatedDate *time.Time @@ -1369,6 +1433,9 @@ type DocumentDescription struct { // A description of the parameters for a document. Parameters []DocumentParameter + // The version of the document that is currently under review. + PendingReviewVersion *string + // The list of OS platforms compatible with this Systems Manager document. PlatformTypes []PlatformType @@ -1377,6 +1444,12 @@ type DocumentDescription struct { // document. Requires []DocumentRequires + // Details about the review of a document. + ReviewInformation []ReviewInformation + + // The current status of the review. + ReviewStatus ReviewStatus + // The schema version. SchemaVersion *string @@ -1423,6 +1496,9 @@ type DocumentFilter struct { // Describes the name of a Systems Manager document. type DocumentIdentifier struct { + // The user in your organization who created the document. + Author *string + // The document format, either JSON or YAML. DocumentFormat DocumentFormat @@ -1446,6 +1522,9 @@ type DocumentIdentifier struct { // document. Requires []DocumentRequires + // The current status of a document review. + ReviewStatus ReviewStatus + // The schema version. SchemaVersion *string @@ -1536,6 +1615,13 @@ type DocumentKeyValuesFilter struct { Values []string } +// Details about the response to a document review request. +type DocumentMetadataResponseInfo struct { + + // Details about a reviewer's response to a document review request. + ReviewerResponse []DocumentReviewerResponseSource +} + // Parameters specified in a System Manager document that run on the server when // the command is run. type DocumentParameter struct { @@ -1568,6 +1654,56 @@ type DocumentRequires struct { Version *string } +// Information about comments added to a document review request. +type DocumentReviewCommentSource struct { + + // The content of a comment entered by a user who requests a review of a new + // document version, or who reviews the new version. + Content *string + + // The type of information added to a review request. Currently, only the value + // Comment is supported. + Type DocumentReviewCommentType +} + +// Information about a reviewer's response to a document review request. +type DocumentReviewerResponseSource struct { + + // The comment entered by a reviewer as part of their document review response. + Comment []DocumentReviewCommentSource + + // The date and time that a reviewer entered a response to a document review + // request. + CreateTime *time.Time + + // The current review status of a new custom SSM document created by a member of + // your organization, or of the latest version of an existing SSM document. Only + // one version of a document can be in the APPROVED state at a time. When a new + // version is approved, the status of the previous version changes to REJECTED. + // Only one version of a document can be in review, or PENDING, at a time. + ReviewStatus ReviewStatus + + // The user in your organization assigned to review a document request. + Reviewer *string + + // The date and time that a reviewer last updated a response to a document review + // request. + UpdatedTime *time.Time +} + +// Information about a document approval review. +type DocumentReviews struct { + + // The action to take on a document approval review request. + // + // This member is required. + Action DocumentReviewAction + + // A comment entered by a user in your organization about the document review + // request. + Comment []DocumentReviewCommentSource +} + // Version information about the document. type DocumentVersionInfo struct { @@ -1586,6 +1722,10 @@ type DocumentVersionInfo struct { // The document name. Name *string + // The current status of the approval review for the latest version of the + // document. + ReviewStatus ReviewStatus + // The status of the Systems Manager document, such as Creating, Active, Failed, // and Deleting. Status DocumentStatus @@ -1774,7 +1914,7 @@ type InstanceInformation struct { // The date the association was last run. LastAssociationExecutionDate *time.Time - // The date and time when agent last pinged Systems Manager service. + // The date and time when the agent last pinged the Systems Manager service. LastPingDateTime *time.Time // The last date the association was successfully run. @@ -2643,10 +2783,10 @@ type MaintenanceWindowTaskParameterValueExpression struct { Values []string } -// Metadata to assign to an AppManager application. +// Metadata to assign to an Application Manager application. type MetadataValue struct { - // Metadata value to assign to an AppManager application. + // Metadata value to assign to an Application Manager application. Value *string } @@ -2751,6 +2891,14 @@ type OpsFilter struct { // the AWS Systems Manager User Guide. type OpsItem struct { + // The time a runbook workflow ended. Currently reported only for the OpsItem type + // /aws/changerequest. + ActualEndTime *time.Time + + // The time a runbook workflow started. Currently reported only for the OpsItem + // type /aws/changerequest. + ActualStartTime *time.Time + // An OpsItem category. Category options include: Availability, Cost, Performance, // Recovery, Security. Category *string @@ -2796,6 +2944,18 @@ type OpsItem struct { // The ID of the OpsItem. OpsItemId *string + // The type of OpsItem. Currently, the only valid values are /aws/changerequest and + // /aws/issue. + OpsItemType *string + + // The time specified in a change request for a runbook workflow to end. Currently + // supported only for the OpsItem type /aws/changerequest. + PlannedEndTime *time.Time + + // The time specified in a change request for a runbook workflow to start. + // Currently supported only for the OpsItem type /aws/changerequest. + PlannedStartTime *time.Time + // The importance of this OpsItem in relation to other OpsItems in the system. Priority *int32 @@ -2837,6 +2997,52 @@ type OpsItemDataValue struct { Value *string } +// Describes a filter for a specific list of OpsItem events. You can filter event +// information by using tags. You specify tags by using a key-value pair mapping. +type OpsItemEventFilter struct { + + // The name of the filter key. Currently, the only supported value is OpsItemId. + // + // This member is required. + Key OpsItemEventFilterKey + + // The operator used by the filter call. Currently, the only supported value is + // Equal. + // + // This member is required. + Operator OpsItemEventFilterOperator + + // The values for the filter, consisting of one or more OpsItem IDs. + // + // This member is required. + Values []string +} + +// Summary information about an OpsItem event. +type OpsItemEventSummary struct { + + // Information about the user or resource that created the OpsItem event. + CreatedBy *OpsItemIdentity + + // The date and time the OpsItem event was created. + CreatedTime *time.Time + + // Specific information about the OpsItem event. + Detail *string + + // The type of information provided as a detail. + DetailType *string + + // The ID of the OpsItem event. + EventId *string + + // The ID of the OpsItem. + OpsItemId *string + + // The source of the OpsItem event. + Source *string +} + // Describes an OpsItem filter. type OpsItemFilter struct { @@ -2856,6 +3062,13 @@ type OpsItemFilter struct { Values []string } +// Information about the user or resource that created an OpsItem event. +type OpsItemIdentity struct { + + // The Amazon Resource Name (ARN) of the IAM entity that created the OpsItem event. + Arn *string +} + // A notification about the OpsItem. type OpsItemNotification struct { @@ -2867,6 +3080,14 @@ type OpsItemNotification struct { // A count of OpsItems. type OpsItemSummary struct { + // The time a runbook workflow ended. Currently reported only for the OpsItem type + // /aws/changerequest. + ActualEndTime *time.Time + + // The time a runbook workflow started. Currently reported only for the OpsItem + // type /aws/changerequest. + ActualStartTime *time.Time + // A list of OpsItems by category. Category *string @@ -2889,6 +3110,18 @@ type OpsItemSummary struct { // The ID of the OpsItem. OpsItemId *string + // The type of OpsItem. Currently, the only valid values are /aws/changerequest and + // /aws/issue. + OpsItemType *string + + // The time specified in a change request for a runbook workflow to end. Currently + // supported only for the OpsItem type /aws/changerequest. + PlannedEndTime *time.Time + + // The time specified in a change request for a runbook workflow to start. + // Currently supported only for the OpsItem type /aws/changerequest. + PlannedStartTime *time.Time + // The importance of this OpsItem in relation to other OpsItems in the system. Priority *int32 @@ -2906,7 +3139,7 @@ type OpsItemSummary struct { Title *string } -// Operational metadata for an application in AppManager. +// Operational metadata for an application in Application Manager. type OpsMetadata struct { // The date the OpsMetadata objects was created. @@ -2921,7 +3154,7 @@ type OpsMetadata struct { // The Amazon Resource Name (ARN) of the OpsMetadata Object or blob. OpsMetadataArn *string - // The ID of the AppManager application. + // The ID of the Application Manager application. ResourceId *string } @@ -3686,6 +3919,62 @@ type ResultAttribute struct { TypeName *string } +// Information about the result of a document review request. +type ReviewInformation struct { + + // The time that the reviewer took action on the document review request. + ReviewedTime *time.Time + + // The reviewer assigned to take action on the document review request. + Reviewer *string + + // The current status of the document review request. + Status ReviewStatus +} + +// Information about an Automation runbook (Automation document) used in a runbook +// workflow in Change Manager. The Automation runbooks specified for the runbook +// workflow can't run until all required approvals for the change request have been +// received. +type Runbook struct { + + // The name of the Automation runbook (Automation document) used in a runbook + // workflow. + // + // This member is required. + DocumentName *string + + // The version of the Automation runbook (Automation document) used in a runbook + // workflow. + DocumentVersion *string + + // The MaxConcurrency value specified by the user when the operation started, + // indicating the maximum number of resources that the runbook operation can run on + // at the same time. + MaxConcurrency *string + + // The MaxErrors value specified by the user when the execution started, indicating + // the maximum number of errors that can occur during the operation before the + // updates are stopped or rolled back. + MaxErrors *string + + // The key-value map of execution parameters, which were supplied when calling + // StartChangeRequestExecution. + Parameters map[string][]string + + // Information about the AWS Regions and accounts targeted by the current Runbook + // operation. + TargetLocations []TargetLocation + + // The name of the parameter used as the target resource for the rate-controlled + // runbook workflow. Required if you specify Targets. + TargetParameterName *string + + // A key-value mapping to target resources that the Runbook operation performs + // tasks on. Required if you specify TargetParameterName. + Targets []Target +} + // An S3 bucket where you want to store the results of this request. type S3OutputLocation struct { @@ -4004,7 +4293,14 @@ type Tag struct { } // An array of search criteria that targets instances using a Key,Value combination -// that you specify. Supported formats include the following. +// that you specify. One or more targets must be specified for maintenance window +// Run Command-type tasks. Depending on the task, targets are optional for other +// maintenance window task types (Automation, AWS Lambda, and AWS Step Functions). +// For more information about running tasks that do not specify targets, see see +// Registering maintenance window tasks without targets +// (https://docs.aws.amazon.com/systems-manager/latest/userguide/maintenance-windows-targetless-tasks.html) +// in the AWS Systems Manager User Guide. Supported formats include the +// following. // // * // Key=InstanceIds,Values=instance-id-1,instance-id-2,instance-id-3 @@ -4079,14 +4375,15 @@ type TargetLocation struct { // The AWS accounts targeted by the current Automation execution. Accounts []string - // The Automation execution role used by the currently running Automation. + // The Automation execution role used by the currently running Automation. If not + // specified, the default value is AWS-SystemsManager-AutomationExecutionRole. ExecutionRoleName *string // The AWS Regions targeted by the current Automation execution. Regions []string // The maximum number of AWS accounts and AWS regions allowed to run the Automation - // concurrently + // concurrently. TargetLocationMaxConcurrency *string // The maximum number of errors allowed before the system stops queueing additional diff --git a/service/ssm/validators.go b/service/ssm/validators.go index 660a03be4c9..792a8c97e16 100644 --- a/service/ssm/validators.go +++ b/service/ssm/validators.go @@ -1530,6 +1530,26 @@ func (m *validateOpListCommands) HandleInitialize(ctx context.Context, in middle return next.HandleInitialize(ctx, in) } +type validateOpListDocumentMetadataHistory struct { +} + +func (*validateOpListDocumentMetadataHistory) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListDocumentMetadataHistory) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListDocumentMetadataHistoryInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListDocumentMetadataHistoryInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListDocuments struct { } @@ -1590,6 +1610,26 @@ func (m *validateOpListInventoryEntries) HandleInitialize(ctx context.Context, i return next.HandleInitialize(ctx, in) } +type validateOpListOpsItemEvents struct { +} + +func (*validateOpListOpsItemEvents) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListOpsItemEvents) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListOpsItemEventsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListOpsItemEventsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListOpsMetadata struct { } @@ -1930,6 +1970,26 @@ func (m *validateOpStartAutomationExecution) HandleInitialize(ctx context.Contex return next.HandleInitialize(ctx, in) } +type validateOpStartChangeRequestExecution struct { +} + +func (*validateOpStartChangeRequestExecution) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartChangeRequestExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartChangeRequestExecutionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartChangeRequestExecutionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpStartSession struct { } @@ -2070,6 +2130,26 @@ func (m *validateOpUpdateDocument) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpUpdateDocumentMetadata struct { +} + +func (*validateOpUpdateDocumentMetadata) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateDocumentMetadata) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateDocumentMetadataInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateDocumentMetadataInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateMaintenanceWindow struct { } @@ -2554,6 +2634,10 @@ func addOpListCommandsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListCommands{}, middleware.After) } +func addOpListDocumentMetadataHistoryValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListDocumentMetadataHistory{}, middleware.After) +} + func addOpListDocumentsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListDocuments{}, middleware.After) } @@ -2566,6 +2650,10 @@ func addOpListInventoryEntriesValidationMiddleware(stack *middleware.Stack) erro return stack.Initialize.Add(&validateOpListInventoryEntries{}, middleware.After) } +func addOpListOpsItemEventsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListOpsItemEvents{}, middleware.After) +} + func addOpListOpsMetadataValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListOpsMetadata{}, middleware.After) } @@ -2634,6 +2722,10 @@ func addOpStartAutomationExecutionValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpStartAutomationExecution{}, middleware.After) } +func addOpStartChangeRequestExecutionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartChangeRequestExecution{}, middleware.After) +} + func addOpStartSessionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartSession{}, middleware.After) } @@ -2662,6 +2754,10 @@ func addOpUpdateDocumentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateDocument{}, middleware.After) } +func addOpUpdateDocumentMetadataValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateDocumentMetadata{}, middleware.After) +} + func addOpUpdateMaintenanceWindowValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateMaintenanceWindow{}, middleware.After) } @@ -3046,6 +3142,21 @@ func validateDocumentRequiresList(v []types.DocumentRequires) error { } } +func validateDocumentReviews(v *types.DocumentReviews) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DocumentReviews"} + if len(v.Action) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Action")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateInstanceInformationFilter(v *types.InstanceInformationFilter) error { if v == nil { return nil @@ -3397,6 +3508,44 @@ func validateOpsFilterList(v []types.OpsFilter) error { } } +func validateOpsItemEventFilter(v *types.OpsItemEventFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "OpsItemEventFilter"} + if len(v.Key) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if v.Values == nil { + invalidParams.Add(smithy.NewErrParamRequired("Values")) + } + if len(v.Operator) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Operator")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpsItemEventFilters(v []types.OpsItemEventFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "OpsItemEventFilters"} + for i := range v { + if err := validateOpsItemEventFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpsItemFilter(v *types.OpsItemFilter) error { if v == nil { return nil @@ -3839,6 +3988,38 @@ func validateResultAttributeList(v []types.ResultAttribute) error { } } +func validateRunbook(v *types.Runbook) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Runbook"} + if v.DocumentName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DocumentName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRunbooks(v []types.Runbook) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Runbooks"} + for i := range v { + if err := validateRunbook(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateSessionFilter(v *types.SessionFilter) error { if v == nil { return nil @@ -5293,6 +5474,24 @@ func validateOpListCommandsInput(v *ListCommandsInput) error { } } +func validateOpListDocumentMetadataHistoryInput(v *ListDocumentMetadataHistoryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListDocumentMetadataHistoryInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.Metadata) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Metadata")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListDocumentsInput(v *ListDocumentsInput) error { if v == nil { return nil @@ -5348,6 +5547,23 @@ func validateOpListInventoryEntriesInput(v *ListInventoryEntriesInput) error { } } +func validateOpListOpsItemEventsInput(v *ListOpsItemEventsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListOpsItemEventsInput"} + if v.Filters != nil { + if err := validateOpsItemEventFilters(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListOpsMetadataInput(v *ListOpsMetadataInput) error { if v == nil { return nil @@ -5543,21 +5759,12 @@ func validateOpRegisterTaskWithMaintenanceWindowInput(v *RegisterTaskWithMainten if v.WindowId == nil { invalidParams.Add(smithy.NewErrParamRequired("WindowId")) } - if v.Targets == nil { - invalidParams.Add(smithy.NewErrParamRequired("Targets")) - } if v.TaskArn == nil { invalidParams.Add(smithy.NewErrParamRequired("TaskArn")) } if len(v.TaskType) == 0 { invalidParams.Add(smithy.NewErrParamRequired("TaskType")) } - if v.MaxConcurrency == nil { - invalidParams.Add(smithy.NewErrParamRequired("MaxConcurrency")) - } - if v.MaxErrors == nil { - invalidParams.Add(smithy.NewErrParamRequired("MaxErrors")) - } if v.LoggingInfo != nil { if err := validateLoggingInfo(v.LoggingInfo); err != nil { invalidParams.AddNested("LoggingInfo", err.(smithy.InvalidParamsError)) @@ -5689,6 +5896,33 @@ func validateOpStartAutomationExecutionInput(v *StartAutomationExecutionInput) e } } +func validateOpStartChangeRequestExecutionInput(v *StartChangeRequestExecutionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartChangeRequestExecutionInput"} + if v.DocumentName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DocumentName")) + } + if v.Runbooks == nil { + invalidParams.Add(smithy.NewErrParamRequired("Runbooks")) + } else if v.Runbooks != nil { + if err := validateRunbooks(v.Runbooks); err != nil { + invalidParams.AddNested("Runbooks", err.(smithy.InvalidParamsError)) + } + } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpStartSessionInput(v *StartSessionInput) error { if v == nil { return nil @@ -5810,6 +6044,28 @@ func validateOpUpdateDocumentInput(v *UpdateDocumentInput) error { } } +func validateOpUpdateDocumentMetadataInput(v *UpdateDocumentMetadataInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateDocumentMetadataInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.DocumentReviews == nil { + invalidParams.Add(smithy.NewErrParamRequired("DocumentReviews")) + } else if v.DocumentReviews != nil { + if err := validateDocumentReviews(v.DocumentReviews); err != nil { + invalidParams.AddNested("DocumentReviews", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateMaintenanceWindowInput(v *UpdateMaintenanceWindowInput) error { if v == nil { return nil diff --git a/service/storagegateway/types/enums.go b/service/storagegateway/types/enums.go index 5bc13bfccac..0ec818707c4 100644 --- a/service/storagegateway/types/enums.go +++ b/service/storagegateway/types/enums.go @@ -4,6 +4,17 @@ package types type ActiveDirectoryStatus string +// Enum values for ActiveDirectoryStatus +const ( + ActiveDirectoryStatusAccessDenied ActiveDirectoryStatus = "ACCESS_DENIED" + ActiveDirectoryStatusDetached ActiveDirectoryStatus = "DETACHED" + ActiveDirectoryStatusJoined ActiveDirectoryStatus = "JOINED" + ActiveDirectoryStatusJoining ActiveDirectoryStatus = "JOINING" + ActiveDirectoryStatusNetworkError ActiveDirectoryStatus = "NETWORK_ERROR" + ActiveDirectoryStatusTimeout ActiveDirectoryStatus = "TIMEOUT" + ActiveDirectoryStatusUnknownError ActiveDirectoryStatus = "UNKNOWN_ERROR" +) + // Values returns all known values for ActiveDirectoryStatus. 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. @@ -21,6 +32,13 @@ func (ActiveDirectoryStatus) Values() []ActiveDirectoryStatus { type AvailabilityMonitorTestStatus string +// Enum values for AvailabilityMonitorTestStatus +const ( + AvailabilityMonitorTestStatusComplete AvailabilityMonitorTestStatus = "COMPLETE" + AvailabilityMonitorTestStatusFailed AvailabilityMonitorTestStatus = "FAILED" + AvailabilityMonitorTestStatusPending AvailabilityMonitorTestStatus = "PENDING" +) + // Values returns all known values for AvailabilityMonitorTestStatus. 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 @@ -35,6 +53,12 @@ func (AvailabilityMonitorTestStatus) Values() []AvailabilityMonitorTestStatus { type CaseSensitivity string +// Enum values for CaseSensitivity +const ( + CaseSensitivityClientspecified CaseSensitivity = "ClientSpecified" + CaseSensitivityCasesensitive CaseSensitivity = "CaseSensitive" +) + // Values returns all known values for CaseSensitivity. 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. @@ -47,6 +71,72 @@ func (CaseSensitivity) Values() []CaseSensitivity { type ErrorCode string +// Enum values for ErrorCode +const ( + ErrorCodeActivationkeyexpired ErrorCode = "ActivationKeyExpired" + ErrorCodeActivationkeyinvalid ErrorCode = "ActivationKeyInvalid" + ErrorCodeActivationkeynotfound ErrorCode = "ActivationKeyNotFound" + ErrorCodeGatewayinternalerror ErrorCode = "GatewayInternalError" + ErrorCodeGatewaynotconnected ErrorCode = "GatewayNotConnected" + ErrorCodeGatewaynotfound ErrorCode = "GatewayNotFound" + ErrorCodeGatewayproxynetworkconnectionbusy ErrorCode = "GatewayProxyNetworkConnectionBusy" + ErrorCodeAuthenticationfailure ErrorCode = "AuthenticationFailure" + ErrorCodeBandwidththrottleschedulenotfound ErrorCode = "BandwidthThrottleScheduleNotFound" + ErrorCodeBlocked ErrorCode = "Blocked" + ErrorCodeCannotexportsnapshot ErrorCode = "CannotExportSnapshot" + ErrorCodeChapcredentialnotfound ErrorCode = "ChapCredentialNotFound" + ErrorCodeDiskalreadyallocated ErrorCode = "DiskAlreadyAllocated" + ErrorCodeDiskdoesnotexist ErrorCode = "DiskDoesNotExist" + ErrorCodeDisksizegreaterthanvolumemaxsize ErrorCode = "DiskSizeGreaterThanVolumeMaxSize" + ErrorCodeDisksizelessthanvolumesize ErrorCode = "DiskSizeLessThanVolumeSize" + ErrorCodeDisksizenotgigaligned ErrorCode = "DiskSizeNotGigAligned" + ErrorCodeDuplicatecertificateinfo ErrorCode = "DuplicateCertificateInfo" + ErrorCodeDuplicateschedule ErrorCode = "DuplicateSchedule" + ErrorCodeEndpointnotfound ErrorCode = "EndpointNotFound" + ErrorCodeIamnotsupported ErrorCode = "IAMNotSupported" + ErrorCodeInitiatorinvalid ErrorCode = "InitiatorInvalid" + ErrorCodeInitiatornotfound ErrorCode = "InitiatorNotFound" + ErrorCodeInternalerror ErrorCode = "InternalError" + ErrorCodeInvalidgateway ErrorCode = "InvalidGateway" + ErrorCodeInvalidendpoint ErrorCode = "InvalidEndpoint" + ErrorCodeInvalidparameters ErrorCode = "InvalidParameters" + ErrorCodeInvalidschedule ErrorCode = "InvalidSchedule" + ErrorCodeLocalstoragelimitexceeded ErrorCode = "LocalStorageLimitExceeded" + ErrorCodeLunalreadyallocated ErrorCode = "LunAlreadyAllocated " + ErrorCodeLuninvalid ErrorCode = "LunInvalid" + ErrorCodeJoindomaininprogress ErrorCode = "JoinDomainInProgress" + ErrorCodeMaximumcontentlengthexceeded ErrorCode = "MaximumContentLengthExceeded" + ErrorCodeMaximumtapecartridgecountexceeded ErrorCode = "MaximumTapeCartridgeCountExceeded" + ErrorCodeMaximumvolumecountexceeded ErrorCode = "MaximumVolumeCountExceeded" + ErrorCodeNetworkconfigurationchanged ErrorCode = "NetworkConfigurationChanged" + ErrorCodeNodisksavailable ErrorCode = "NoDisksAvailable" + ErrorCodeNotimplemented ErrorCode = "NotImplemented" + ErrorCodeNotsupported ErrorCode = "NotSupported" + ErrorCodeOperationaborted ErrorCode = "OperationAborted" + ErrorCodeOutdatedgateway ErrorCode = "OutdatedGateway" + ErrorCodeParametersnotimplemented ErrorCode = "ParametersNotImplemented" + ErrorCodeRegioninvalid ErrorCode = "RegionInvalid" + ErrorCodeRequesttimeout ErrorCode = "RequestTimeout" + ErrorCodeServiceunavailable ErrorCode = "ServiceUnavailable" + ErrorCodeSnapshotdeleted ErrorCode = "SnapshotDeleted" + ErrorCodeSnapshotidinvalid ErrorCode = "SnapshotIdInvalid" + ErrorCodeSnapshotinprogress ErrorCode = "SnapshotInProgress" + ErrorCodeSnapshotnotfound ErrorCode = "SnapshotNotFound" + ErrorCodeSnapshotschedulenotfound ErrorCode = "SnapshotScheduleNotFound" + ErrorCodeStagingareafull ErrorCode = "StagingAreaFull" + ErrorCodeStoragefailure ErrorCode = "StorageFailure" + ErrorCodeTapecartridgenotfound ErrorCode = "TapeCartridgeNotFound" + ErrorCodeTargetalreadyexists ErrorCode = "TargetAlreadyExists" + ErrorCodeTargetinvalid ErrorCode = "TargetInvalid" + ErrorCodeTargetnotfound ErrorCode = "TargetNotFound" + ErrorCodeUnauthorizedoperation ErrorCode = "UnauthorizedOperation" + ErrorCodeVolumealreadyexists ErrorCode = "VolumeAlreadyExists" + ErrorCodeVolumeidinvalid ErrorCode = "VolumeIdInvalid" + ErrorCodeVolumeinuse ErrorCode = "VolumeInUse" + ErrorCodeVolumenotfound ErrorCode = "VolumeNotFound" + ErrorCodeVolumenotready ErrorCode = "VolumeNotReady" +) + // Values returns all known values for ErrorCode. 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. @@ -119,6 +209,12 @@ func (ErrorCode) Values() []ErrorCode { type FileShareType string +// Enum values for FileShareType +const ( + FileShareTypeNfs FileShareType = "NFS" + FileShareTypeSmb FileShareType = "SMB" +) + // Values returns all known values for FileShareType. 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. @@ -131,6 +227,15 @@ func (FileShareType) Values() []FileShareType { type HostEnvironment string +// Enum values for HostEnvironment +const ( + HostEnvironmentVmware HostEnvironment = "VMWARE" + HostEnvironmentHyperV HostEnvironment = "HYPER-V" + HostEnvironmentEc2 HostEnvironment = "EC2" + HostEnvironmentKvm HostEnvironment = "KVM" + HostEnvironmentOther HostEnvironment = "OTHER" +) + // Values returns all known values for HostEnvironment. 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. @@ -146,6 +251,17 @@ func (HostEnvironment) Values() []HostEnvironment { type ObjectACL string +// Enum values for ObjectACL +const ( + ObjectACLPrivate ObjectACL = "private" + ObjectACLPublicRead ObjectACL = "public-read" + ObjectACLPublicReadWrite ObjectACL = "public-read-write" + ObjectACLAuthenticatedRead ObjectACL = "authenticated-read" + ObjectACLBucketOwnerRead ObjectACL = "bucket-owner-read" + ObjectACLBucketOwnerFullControl ObjectACL = "bucket-owner-full-control" + ObjectACLAwsExecRead ObjectACL = "aws-exec-read" +) + // Values returns all known values for ObjectACL. 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. @@ -163,6 +279,12 @@ func (ObjectACL) Values() []ObjectACL { type PoolStatus string +// Enum values for PoolStatus +const ( + PoolStatusActive PoolStatus = "ACTIVE" + PoolStatusDeleted PoolStatus = "DELETED" +) + // Values returns all known values for PoolStatus. 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. @@ -175,6 +297,13 @@ func (PoolStatus) Values() []PoolStatus { type RetentionLockType string +// Enum values for RetentionLockType +const ( + RetentionLockTypeCompliance RetentionLockType = "COMPLIANCE" + RetentionLockTypeGovernance RetentionLockType = "GOVERNANCE" + RetentionLockTypeNone RetentionLockType = "NONE" +) + // Values returns all known values for RetentionLockType. 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. @@ -188,6 +317,13 @@ func (RetentionLockType) Values() []RetentionLockType { type SMBSecurityStrategy string +// Enum values for SMBSecurityStrategy +const ( + SMBSecurityStrategyClientspecified SMBSecurityStrategy = "ClientSpecified" + SMBSecurityStrategyMandatorysigning SMBSecurityStrategy = "MandatorySigning" + SMBSecurityStrategyMandatoryencryption SMBSecurityStrategy = "MandatoryEncryption" +) + // Values returns all known values for SMBSecurityStrategy. 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. @@ -201,6 +337,12 @@ func (SMBSecurityStrategy) Values() []SMBSecurityStrategy { type TapeStorageClass string +// Enum values for TapeStorageClass +const ( + TapeStorageClassDeepArchive TapeStorageClass = "DEEP_ARCHIVE" + TapeStorageClassGlacier TapeStorageClass = "GLACIER" +) + // Values returns all known values for TapeStorageClass. 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. diff --git a/service/swf/types/enums.go b/service/swf/types/enums.go index a246b852bba..86afca87eac 100644 --- a/service/swf/types/enums.go +++ b/service/swf/types/enums.go @@ -4,6 +4,14 @@ package types type ActivityTaskTimeoutType string +// Enum values for ActivityTaskTimeoutType +const ( + ActivityTaskTimeoutTypeStartToClose ActivityTaskTimeoutType = "START_TO_CLOSE" + ActivityTaskTimeoutTypeScheduleToStart ActivityTaskTimeoutType = "SCHEDULE_TO_START" + ActivityTaskTimeoutTypeScheduleToClose ActivityTaskTimeoutType = "SCHEDULE_TO_CLOSE" + ActivityTaskTimeoutTypeHeartbeat ActivityTaskTimeoutType = "HEARTBEAT" +) + // Values returns all known values for ActivityTaskTimeoutType. Note that this can // be expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. @@ -18,6 +26,12 @@ func (ActivityTaskTimeoutType) Values() []ActivityTaskTimeoutType { type CancelTimerFailedCause string +// Enum values for CancelTimerFailedCause +const ( + CancelTimerFailedCauseTimerIdUnknown CancelTimerFailedCause = "TIMER_ID_UNKNOWN" + CancelTimerFailedCauseOperationNotPermitted CancelTimerFailedCause = "OPERATION_NOT_PERMITTED" +) + // Values returns all known values for CancelTimerFailedCause. Note that this can // be expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. @@ -30,6 +44,12 @@ func (CancelTimerFailedCause) Values() []CancelTimerFailedCause { type CancelWorkflowExecutionFailedCause string +// Enum values for CancelWorkflowExecutionFailedCause +const ( + CancelWorkflowExecutionFailedCauseUnhandledDecision CancelWorkflowExecutionFailedCause = "UNHANDLED_DECISION" + CancelWorkflowExecutionFailedCauseOperationNotPermitted CancelWorkflowExecutionFailedCause = "OPERATION_NOT_PERMITTED" +) + // Values returns all known values for CancelWorkflowExecutionFailedCause. Note // that this can be expanded in the future, and so it is only as up to date as the // client. The ordering of this slice is not guaranteed to be stable across @@ -43,6 +63,13 @@ func (CancelWorkflowExecutionFailedCause) Values() []CancelWorkflowExecutionFail type ChildPolicy string +// Enum values for ChildPolicy +const ( + ChildPolicyTerminate ChildPolicy = "TERMINATE" + ChildPolicyRequestCancel ChildPolicy = "REQUEST_CANCEL" + ChildPolicyAbandon ChildPolicy = "ABANDON" +) + // Values returns all known values for ChildPolicy. Note that this can be expanded // in the future, and so it is only as up to date as the client. The ordering of // this slice is not guaranteed to be stable across updates. @@ -56,6 +83,16 @@ func (ChildPolicy) Values() []ChildPolicy { type CloseStatus string +// Enum values for CloseStatus +const ( + CloseStatusCompleted CloseStatus = "COMPLETED" + CloseStatusFailed CloseStatus = "FAILED" + CloseStatusCanceled CloseStatus = "CANCELED" + CloseStatusTerminated CloseStatus = "TERMINATED" + CloseStatusContinuedAsNew CloseStatus = "CONTINUED_AS_NEW" + CloseStatusTimedOut CloseStatus = "TIMED_OUT" +) + // Values returns all known values for CloseStatus. Note that this can be expanded // in the future, and so it is only as up to date as the client. The ordering of // this slice is not guaranteed to be stable across updates. @@ -72,6 +109,12 @@ func (CloseStatus) Values() []CloseStatus { type CompleteWorkflowExecutionFailedCause string +// Enum values for CompleteWorkflowExecutionFailedCause +const ( + CompleteWorkflowExecutionFailedCauseUnhandledDecision CompleteWorkflowExecutionFailedCause = "UNHANDLED_DECISION" + CompleteWorkflowExecutionFailedCauseOperationNotPermitted CompleteWorkflowExecutionFailedCause = "OPERATION_NOT_PERMITTED" +) + // Values returns all known values for CompleteWorkflowExecutionFailedCause. Note // that this can be expanded in the future, and so it is only as up to date as the // client. The ordering of this slice is not guaranteed to be stable across @@ -85,6 +128,19 @@ func (CompleteWorkflowExecutionFailedCause) Values() []CompleteWorkflowExecution type ContinueAsNewWorkflowExecutionFailedCause string +// Enum values for ContinueAsNewWorkflowExecutionFailedCause +const ( + ContinueAsNewWorkflowExecutionFailedCauseUnhandledDecision ContinueAsNewWorkflowExecutionFailedCause = "UNHANDLED_DECISION" + ContinueAsNewWorkflowExecutionFailedCauseWorkflowTypeDeprecated ContinueAsNewWorkflowExecutionFailedCause = "WORKFLOW_TYPE_DEPRECATED" + ContinueAsNewWorkflowExecutionFailedCauseWorkflowTypeDoesNotExist ContinueAsNewWorkflowExecutionFailedCause = "WORKFLOW_TYPE_DOES_NOT_EXIST" + ContinueAsNewWorkflowExecutionFailedCauseDefaultExecutionStartToCloseTimeoutUndefined ContinueAsNewWorkflowExecutionFailedCause = "DEFAULT_EXECUTION_START_TO_CLOSE_TIMEOUT_UNDEFINED" + ContinueAsNewWorkflowExecutionFailedCauseDefaultTaskStartToCloseTimeoutUndefined ContinueAsNewWorkflowExecutionFailedCause = "DEFAULT_TASK_START_TO_CLOSE_TIMEOUT_UNDEFINED" + ContinueAsNewWorkflowExecutionFailedCauseDefaultTaskListUndefined ContinueAsNewWorkflowExecutionFailedCause = "DEFAULT_TASK_LIST_UNDEFINED" + ContinueAsNewWorkflowExecutionFailedCauseDefaultChildPolicyUndefined ContinueAsNewWorkflowExecutionFailedCause = "DEFAULT_CHILD_POLICY_UNDEFINED" + ContinueAsNewWorkflowExecutionFailedCauseContinueAsNewWorkflowExecutionRateExceeded ContinueAsNewWorkflowExecutionFailedCause = "CONTINUE_AS_NEW_WORKFLOW_EXECUTION_RATE_EXCEEDED" + ContinueAsNewWorkflowExecutionFailedCauseOperationNotPermitted ContinueAsNewWorkflowExecutionFailedCause = "OPERATION_NOT_PERMITTED" +) + // Values returns all known values for ContinueAsNewWorkflowExecutionFailedCause. // Note that this can be expanded in the future, and so it is only as up to date as // the client. The ordering of this slice is not guaranteed to be stable across @@ -105,6 +161,11 @@ func (ContinueAsNewWorkflowExecutionFailedCause) Values() []ContinueAsNewWorkflo type DecisionTaskTimeoutType string +// Enum values for DecisionTaskTimeoutType +const ( + DecisionTaskTimeoutTypeStartToClose DecisionTaskTimeoutType = "START_TO_CLOSE" +) + // Values returns all known values for DecisionTaskTimeoutType. Note that this can // be expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. @@ -116,6 +177,23 @@ func (DecisionTaskTimeoutType) Values() []DecisionTaskTimeoutType { type DecisionType string +// Enum values for DecisionType +const ( + DecisionTypeScheduleactivitytask DecisionType = "ScheduleActivityTask" + DecisionTypeRequestcancelactivitytask DecisionType = "RequestCancelActivityTask" + DecisionTypeCompleteworkflowexecution DecisionType = "CompleteWorkflowExecution" + DecisionTypeFailworkflowexecution DecisionType = "FailWorkflowExecution" + DecisionTypeCancelworkflowexecution DecisionType = "CancelWorkflowExecution" + DecisionTypeContinueasnewworkflowexecution DecisionType = "ContinueAsNewWorkflowExecution" + DecisionTypeRecordmarker DecisionType = "RecordMarker" + DecisionTypeStarttimer DecisionType = "StartTimer" + DecisionTypeCanceltimer DecisionType = "CancelTimer" + DecisionTypeSignalexternalworkflowexecution DecisionType = "SignalExternalWorkflowExecution" + DecisionTypeRequestcancelexternalworkflowexecution DecisionType = "RequestCancelExternalWorkflowExecution" + DecisionTypeStartchildworkflowexecution DecisionType = "StartChildWorkflowExecution" + DecisionTypeSchedulelambdafunction DecisionType = "ScheduleLambdaFunction" +) + // Values returns all known values for DecisionType. Note that this can be expanded // in the future, and so it is only as up to date as the client. The ordering of // this slice is not guaranteed to be stable across updates. @@ -139,6 +217,64 @@ func (DecisionType) Values() []DecisionType { type EventType string +// Enum values for EventType +const ( + EventTypeWorkflowexecutionstarted EventType = "WorkflowExecutionStarted" + EventTypeWorkflowexecutioncancelrequested EventType = "WorkflowExecutionCancelRequested" + EventTypeWorkflowexecutioncompleted EventType = "WorkflowExecutionCompleted" + EventTypeCompleteworkflowexecutionfailed EventType = "CompleteWorkflowExecutionFailed" + EventTypeWorkflowexecutionfailed EventType = "WorkflowExecutionFailed" + EventTypeFailworkflowexecutionfailed EventType = "FailWorkflowExecutionFailed" + EventTypeWorkflowexecutiontimedout EventType = "WorkflowExecutionTimedOut" + EventTypeWorkflowexecutioncanceled EventType = "WorkflowExecutionCanceled" + EventTypeCancelworkflowexecutionfailed EventType = "CancelWorkflowExecutionFailed" + EventTypeWorkflowexecutioncontinuedasnew EventType = "WorkflowExecutionContinuedAsNew" + EventTypeContinueasnewworkflowexecutionfailed EventType = "ContinueAsNewWorkflowExecutionFailed" + EventTypeWorkflowexecutionterminated EventType = "WorkflowExecutionTerminated" + EventTypeDecisiontaskscheduled EventType = "DecisionTaskScheduled" + EventTypeDecisiontaskstarted EventType = "DecisionTaskStarted" + EventTypeDecisiontaskcompleted EventType = "DecisionTaskCompleted" + EventTypeDecisiontasktimedout EventType = "DecisionTaskTimedOut" + EventTypeActivitytaskscheduled EventType = "ActivityTaskScheduled" + EventTypeScheduleactivitytaskfailed EventType = "ScheduleActivityTaskFailed" + EventTypeActivitytaskstarted EventType = "ActivityTaskStarted" + EventTypeActivitytaskcompleted EventType = "ActivityTaskCompleted" + EventTypeActivitytaskfailed EventType = "ActivityTaskFailed" + EventTypeActivitytasktimedout EventType = "ActivityTaskTimedOut" + EventTypeActivitytaskcanceled EventType = "ActivityTaskCanceled" + EventTypeActivitytaskcancelrequested EventType = "ActivityTaskCancelRequested" + EventTypeRequestcancelactivitytaskfailed EventType = "RequestCancelActivityTaskFailed" + EventTypeWorkflowexecutionsignaled EventType = "WorkflowExecutionSignaled" + EventTypeMarkerrecorded EventType = "MarkerRecorded" + EventTypeRecordmarkerfailed EventType = "RecordMarkerFailed" + EventTypeTimerstarted EventType = "TimerStarted" + EventTypeStarttimerfailed EventType = "StartTimerFailed" + EventTypeTimerfired EventType = "TimerFired" + EventTypeTimercanceled EventType = "TimerCanceled" + EventTypeCanceltimerfailed EventType = "CancelTimerFailed" + EventTypeStartchildworkflowexecutioninitiated EventType = "StartChildWorkflowExecutionInitiated" + EventTypeStartchildworkflowexecutionfailed EventType = "StartChildWorkflowExecutionFailed" + EventTypeChildworkflowexecutionstarted EventType = "ChildWorkflowExecutionStarted" + EventTypeChildworkflowexecutioncompleted EventType = "ChildWorkflowExecutionCompleted" + EventTypeChildworkflowexecutionfailed EventType = "ChildWorkflowExecutionFailed" + EventTypeChildworkflowexecutiontimedout EventType = "ChildWorkflowExecutionTimedOut" + EventTypeChildworkflowexecutioncanceled EventType = "ChildWorkflowExecutionCanceled" + EventTypeChildworkflowexecutionterminated EventType = "ChildWorkflowExecutionTerminated" + EventTypeSignalexternalworkflowexecutioninitiated EventType = "SignalExternalWorkflowExecutionInitiated" + EventTypeSignalexternalworkflowexecutionfailed EventType = "SignalExternalWorkflowExecutionFailed" + EventTypeExternalworkflowexecutionsignaled EventType = "ExternalWorkflowExecutionSignaled" + EventTypeRequestcancelexternalworkflowexecutioninitiated EventType = "RequestCancelExternalWorkflowExecutionInitiated" + EventTypeRequestcancelexternalworkflowexecutionfailed EventType = "RequestCancelExternalWorkflowExecutionFailed" + EventTypeExternalworkflowexecutioncancelrequested EventType = "ExternalWorkflowExecutionCancelRequested" + EventTypeLambdafunctionscheduled EventType = "LambdaFunctionScheduled" + EventTypeLambdafunctionstarted EventType = "LambdaFunctionStarted" + EventTypeLambdafunctioncompleted EventType = "LambdaFunctionCompleted" + EventTypeLambdafunctionfailed EventType = "LambdaFunctionFailed" + EventTypeLambdafunctiontimedout EventType = "LambdaFunctionTimedOut" + EventTypeSchedulelambdafunctionfailed EventType = "ScheduleLambdaFunctionFailed" + EventTypeStartlambdafunctionfailed EventType = "StartLambdaFunctionFailed" +) + // Values returns all known values for EventType. Note that this can be expanded in // the future, and so it is only as up to date as the client. The ordering of this // slice is not guaranteed to be stable across updates. @@ -203,6 +339,12 @@ func (EventType) Values() []EventType { type ExecutionStatus string +// Enum values for ExecutionStatus +const ( + ExecutionStatusOpen ExecutionStatus = "OPEN" + ExecutionStatusClosed ExecutionStatus = "CLOSED" +) + // Values returns all known values for ExecutionStatus. Note that this can be // expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. @@ -215,6 +357,12 @@ func (ExecutionStatus) Values() []ExecutionStatus { type FailWorkflowExecutionFailedCause string +// Enum values for FailWorkflowExecutionFailedCause +const ( + FailWorkflowExecutionFailedCauseUnhandledDecision FailWorkflowExecutionFailedCause = "UNHANDLED_DECISION" + FailWorkflowExecutionFailedCauseOperationNotPermitted FailWorkflowExecutionFailedCause = "OPERATION_NOT_PERMITTED" +) + // Values returns all known values for FailWorkflowExecutionFailedCause. Note that // this can be expanded in the future, and so it is only as up to date as the // client. The ordering of this slice is not guaranteed to be stable across @@ -228,6 +376,11 @@ func (FailWorkflowExecutionFailedCause) Values() []FailWorkflowExecutionFailedCa type LambdaFunctionTimeoutType string +// Enum values for LambdaFunctionTimeoutType +const ( + LambdaFunctionTimeoutTypeStartToClose LambdaFunctionTimeoutType = "START_TO_CLOSE" +) + // Values returns all known values for LambdaFunctionTimeoutType. Note that this // can be expanded in the future, and so it is only as up to date as the client. // The ordering of this slice is not guaranteed to be stable across updates. @@ -239,6 +392,11 @@ func (LambdaFunctionTimeoutType) Values() []LambdaFunctionTimeoutType { type RecordMarkerFailedCause string +// Enum values for RecordMarkerFailedCause +const ( + RecordMarkerFailedCauseOperationNotPermitted RecordMarkerFailedCause = "OPERATION_NOT_PERMITTED" +) + // Values returns all known values for RecordMarkerFailedCause. Note that this can // be expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. @@ -250,6 +408,12 @@ func (RecordMarkerFailedCause) Values() []RecordMarkerFailedCause { type RegistrationStatus string +// Enum values for RegistrationStatus +const ( + RegistrationStatusRegistered RegistrationStatus = "REGISTERED" + RegistrationStatusDeprecated RegistrationStatus = "DEPRECATED" +) + // Values returns all known values for RegistrationStatus. Note that this can be // expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. @@ -262,6 +426,12 @@ func (RegistrationStatus) Values() []RegistrationStatus { type RequestCancelActivityTaskFailedCause string +// Enum values for RequestCancelActivityTaskFailedCause +const ( + RequestCancelActivityTaskFailedCauseActivityIdUnknown RequestCancelActivityTaskFailedCause = "ACTIVITY_ID_UNKNOWN" + RequestCancelActivityTaskFailedCauseOperationNotPermitted RequestCancelActivityTaskFailedCause = "OPERATION_NOT_PERMITTED" +) + // Values returns all known values for RequestCancelActivityTaskFailedCause. Note // that this can be expanded in the future, and so it is only as up to date as the // client. The ordering of this slice is not guaranteed to be stable across @@ -275,6 +445,13 @@ func (RequestCancelActivityTaskFailedCause) Values() []RequestCancelActivityTask type RequestCancelExternalWorkflowExecutionFailedCause string +// Enum values for RequestCancelExternalWorkflowExecutionFailedCause +const ( + RequestCancelExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution RequestCancelExternalWorkflowExecutionFailedCause = "UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION" + RequestCancelExternalWorkflowExecutionFailedCauseRequestCancelExternalWorkflowExecutionRateExceeded RequestCancelExternalWorkflowExecutionFailedCause = "REQUEST_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_RATE_EXCEEDED" + RequestCancelExternalWorkflowExecutionFailedCauseOperationNotPermitted RequestCancelExternalWorkflowExecutionFailedCause = "OPERATION_NOT_PERMITTED" +) + // Values returns all known values for // RequestCancelExternalWorkflowExecutionFailedCause. Note that this can be // expanded in the future, and so it is only as up to date as the client. The @@ -289,6 +466,21 @@ func (RequestCancelExternalWorkflowExecutionFailedCause) Values() []RequestCance type ScheduleActivityTaskFailedCause string +// Enum values for ScheduleActivityTaskFailedCause +const ( + ScheduleActivityTaskFailedCauseActivityTypeDeprecated ScheduleActivityTaskFailedCause = "ACTIVITY_TYPE_DEPRECATED" + ScheduleActivityTaskFailedCauseActivityTypeDoesNotExist ScheduleActivityTaskFailedCause = "ACTIVITY_TYPE_DOES_NOT_EXIST" + ScheduleActivityTaskFailedCauseActivityIdAlreadyInUse ScheduleActivityTaskFailedCause = "ACTIVITY_ID_ALREADY_IN_USE" + ScheduleActivityTaskFailedCauseOpenActivitiesLimitExceeded ScheduleActivityTaskFailedCause = "OPEN_ACTIVITIES_LIMIT_EXCEEDED" + ScheduleActivityTaskFailedCauseActivityCreationRateExceeded ScheduleActivityTaskFailedCause = "ACTIVITY_CREATION_RATE_EXCEEDED" + ScheduleActivityTaskFailedCauseDefaultScheduleToCloseTimeoutUndefined ScheduleActivityTaskFailedCause = "DEFAULT_SCHEDULE_TO_CLOSE_TIMEOUT_UNDEFINED" + ScheduleActivityTaskFailedCauseDefaultTaskListUndefined ScheduleActivityTaskFailedCause = "DEFAULT_TASK_LIST_UNDEFINED" + ScheduleActivityTaskFailedCauseDefaultScheduleToStartTimeoutUndefined ScheduleActivityTaskFailedCause = "DEFAULT_SCHEDULE_TO_START_TIMEOUT_UNDEFINED" + ScheduleActivityTaskFailedCauseDefaultStartToCloseTimeoutUndefined ScheduleActivityTaskFailedCause = "DEFAULT_START_TO_CLOSE_TIMEOUT_UNDEFINED" + ScheduleActivityTaskFailedCauseDefaultHeartbeatTimeoutUndefined ScheduleActivityTaskFailedCause = "DEFAULT_HEARTBEAT_TIMEOUT_UNDEFINED" + ScheduleActivityTaskFailedCauseOperationNotPermitted ScheduleActivityTaskFailedCause = "OPERATION_NOT_PERMITTED" +) + // Values returns all known values for ScheduleActivityTaskFailedCause. Note that // this can be expanded in the future, and so it is only as up to date as the // client. The ordering of this slice is not guaranteed to be stable across @@ -311,6 +503,14 @@ func (ScheduleActivityTaskFailedCause) Values() []ScheduleActivityTaskFailedCaus type ScheduleLambdaFunctionFailedCause string +// Enum values for ScheduleLambdaFunctionFailedCause +const ( + ScheduleLambdaFunctionFailedCauseIdAlreadyInUse ScheduleLambdaFunctionFailedCause = "ID_ALREADY_IN_USE" + ScheduleLambdaFunctionFailedCauseOpenLambdaFunctionsLimitExceeded ScheduleLambdaFunctionFailedCause = "OPEN_LAMBDA_FUNCTIONS_LIMIT_EXCEEDED" + ScheduleLambdaFunctionFailedCauseLambdaFunctionCreationRateExceeded ScheduleLambdaFunctionFailedCause = "LAMBDA_FUNCTION_CREATION_RATE_EXCEEDED" + ScheduleLambdaFunctionFailedCauseLambdaServiceNotAvailableInRegion ScheduleLambdaFunctionFailedCause = "LAMBDA_SERVICE_NOT_AVAILABLE_IN_REGION" +) + // Values returns all known values for ScheduleLambdaFunctionFailedCause. Note that // this can be expanded in the future, and so it is only as up to date as the // client. The ordering of this slice is not guaranteed to be stable across @@ -326,6 +526,13 @@ func (ScheduleLambdaFunctionFailedCause) Values() []ScheduleLambdaFunctionFailed type SignalExternalWorkflowExecutionFailedCause string +// Enum values for SignalExternalWorkflowExecutionFailedCause +const ( + SignalExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution SignalExternalWorkflowExecutionFailedCause = "UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION" + SignalExternalWorkflowExecutionFailedCauseSignalExternalWorkflowExecutionRateExceeded SignalExternalWorkflowExecutionFailedCause = "SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_RATE_EXCEEDED" + SignalExternalWorkflowExecutionFailedCauseOperationNotPermitted SignalExternalWorkflowExecutionFailedCause = "OPERATION_NOT_PERMITTED" +) + // Values returns all known values for SignalExternalWorkflowExecutionFailedCause. // Note that this can be expanded in the future, and so it is only as up to date as // the client. The ordering of this slice is not guaranteed to be stable across @@ -340,6 +547,21 @@ func (SignalExternalWorkflowExecutionFailedCause) Values() []SignalExternalWorkf type StartChildWorkflowExecutionFailedCause string +// Enum values for StartChildWorkflowExecutionFailedCause +const ( + StartChildWorkflowExecutionFailedCauseWorkflowTypeDoesNotExist StartChildWorkflowExecutionFailedCause = "WORKFLOW_TYPE_DOES_NOT_EXIST" + StartChildWorkflowExecutionFailedCauseWorkflowTypeDeprecated StartChildWorkflowExecutionFailedCause = "WORKFLOW_TYPE_DEPRECATED" + StartChildWorkflowExecutionFailedCauseOpenChildrenLimitExceeded StartChildWorkflowExecutionFailedCause = "OPEN_CHILDREN_LIMIT_EXCEEDED" + StartChildWorkflowExecutionFailedCauseOpenWorkflowsLimitExceeded StartChildWorkflowExecutionFailedCause = "OPEN_WORKFLOWS_LIMIT_EXCEEDED" + StartChildWorkflowExecutionFailedCauseChildCreationRateExceeded StartChildWorkflowExecutionFailedCause = "CHILD_CREATION_RATE_EXCEEDED" + StartChildWorkflowExecutionFailedCauseWorkflowAlreadyRunning StartChildWorkflowExecutionFailedCause = "WORKFLOW_ALREADY_RUNNING" + StartChildWorkflowExecutionFailedCauseDefaultExecutionStartToCloseTimeoutUndefined StartChildWorkflowExecutionFailedCause = "DEFAULT_EXECUTION_START_TO_CLOSE_TIMEOUT_UNDEFINED" + StartChildWorkflowExecutionFailedCauseDefaultTaskListUndefined StartChildWorkflowExecutionFailedCause = "DEFAULT_TASK_LIST_UNDEFINED" + StartChildWorkflowExecutionFailedCauseDefaultTaskStartToCloseTimeoutUndefined StartChildWorkflowExecutionFailedCause = "DEFAULT_TASK_START_TO_CLOSE_TIMEOUT_UNDEFINED" + StartChildWorkflowExecutionFailedCauseDefaultChildPolicyUndefined StartChildWorkflowExecutionFailedCause = "DEFAULT_CHILD_POLICY_UNDEFINED" + StartChildWorkflowExecutionFailedCauseOperationNotPermitted StartChildWorkflowExecutionFailedCause = "OPERATION_NOT_PERMITTED" +) + // Values returns all known values for StartChildWorkflowExecutionFailedCause. Note // that this can be expanded in the future, and so it is only as up to date as the // client. The ordering of this slice is not guaranteed to be stable across @@ -362,6 +584,11 @@ func (StartChildWorkflowExecutionFailedCause) Values() []StartChildWorkflowExecu type StartLambdaFunctionFailedCause string +// Enum values for StartLambdaFunctionFailedCause +const ( + StartLambdaFunctionFailedCauseAssumeRoleFailed StartLambdaFunctionFailedCause = "ASSUME_ROLE_FAILED" +) + // Values returns all known values for StartLambdaFunctionFailedCause. Note that // this can be expanded in the future, and so it is only as up to date as the // client. The ordering of this slice is not guaranteed to be stable across @@ -374,6 +601,14 @@ func (StartLambdaFunctionFailedCause) Values() []StartLambdaFunctionFailedCause type StartTimerFailedCause string +// Enum values for StartTimerFailedCause +const ( + StartTimerFailedCauseTimerIdAlreadyInUse StartTimerFailedCause = "TIMER_ID_ALREADY_IN_USE" + StartTimerFailedCauseOpenTimersLimitExceeded StartTimerFailedCause = "OPEN_TIMERS_LIMIT_EXCEEDED" + StartTimerFailedCauseTimerCreationRateExceeded StartTimerFailedCause = "TIMER_CREATION_RATE_EXCEEDED" + StartTimerFailedCauseOperationNotPermitted StartTimerFailedCause = "OPERATION_NOT_PERMITTED" +) + // Values returns all known values for StartTimerFailedCause. Note that this can be // expanded in the future, and so it is only as up to date as the client. The // ordering of this slice is not guaranteed to be stable across updates. @@ -388,6 +623,11 @@ func (StartTimerFailedCause) Values() []StartTimerFailedCause { type WorkflowExecutionCancelRequestedCause string +// Enum values for WorkflowExecutionCancelRequestedCause +const ( + WorkflowExecutionCancelRequestedCauseChildPolicyApplied WorkflowExecutionCancelRequestedCause = "CHILD_POLICY_APPLIED" +) + // Values returns all known values for WorkflowExecutionCancelRequestedCause. Note // that this can be expanded in the future, and so it is only as up to date as the // client. The ordering of this slice is not guaranteed to be stable across @@ -400,6 +640,13 @@ func (WorkflowExecutionCancelRequestedCause) Values() []WorkflowExecutionCancelR type WorkflowExecutionTerminatedCause string +// Enum values for WorkflowExecutionTerminatedCause +const ( + WorkflowExecutionTerminatedCauseChildPolicyApplied WorkflowExecutionTerminatedCause = "CHILD_POLICY_APPLIED" + WorkflowExecutionTerminatedCauseEventLimitExceeded WorkflowExecutionTerminatedCause = "EVENT_LIMIT_EXCEEDED" + WorkflowExecutionTerminatedCauseOperatorInitiated WorkflowExecutionTerminatedCause = "OPERATOR_INITIATED" +) + // Values returns all known values for WorkflowExecutionTerminatedCause. Note that // this can be expanded in the future, and so it is only as up to date as the // client. The ordering of this slice is not guaranteed to be stable across @@ -414,6 +661,11 @@ func (WorkflowExecutionTerminatedCause) Values() []WorkflowExecutionTerminatedCa type WorkflowExecutionTimeoutType string +// Enum values for WorkflowExecutionTimeoutType +const ( + WorkflowExecutionTimeoutTypeStartToClose WorkflowExecutionTimeoutType = "START_TO_CLOSE" +) + // Values returns all known values for WorkflowExecutionTimeoutType. Note that this // can be expanded in the future, and so it is only as up to date as the client. // The ordering of this slice is not guaranteed to be stable across updates. diff --git a/service/wellarchitected/LICENSE.txt b/service/wellarchitected/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/wellarchitected/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/service/wellarchitected/api_client.go b/service/wellarchitected/api_client.go new file mode 100644 index 00000000000..474d0786da1 --- /dev/null +++ b/service/wellarchitected/api_client.go @@ -0,0 +1,255 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "context" + cryptorand "crypto/rand" + "github.com/aws/aws-sdk-go-v2/aws" + 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" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyrand "github.com/aws/smithy-go/rand" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "time" +) + +const ServiceID = "WellArchitected" +const ServiceAPIVersion = "2020-03-31" + +// Client provides the API client to make operations call for AWS Well-Architected +// Tool. +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) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveDefaultEndpointConfiguration(&options) + + resolveIdempotencyTokenProvider(&options) + + for _, fn := range optFns { + fn(&options) + } + + client := &Client{ + options: options, + } + + return client +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + EndpointResolver EndpointResolver + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // Provides idempotency tokens values that will be automatically populated into + // idempotent API operations. + IdempotencyTokenProvider IdempotencyTokenProvider + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. + Retryer retry.Retryer + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient +} + +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) { + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + for _, fn := range optFns { + fn(&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 +} + +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) +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + Retryer: cfg.Retryer, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + } + resolveAWSEndpointResolver(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + if o.HTTPClient != nil { + return + } + o.HTTPClient = awshttp.NewBuildableClient() +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + o.Retryer = retry.NewStandard() +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil { + return + } + o.EndpointResolver = WithEndpointResolver(cfg.EndpointResolver, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddUserAgentKey("wellarchitected")(stack) +} + +func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: o.Credentials, + Signer: o.HTTPSignerV4, + LogSigning: o.ClientLogMode.IsSigning(), + }) + return stack.Finalize.Add(mw, middleware.After) +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func resolveIdempotencyTokenProvider(o *Options) { + if o.IdempotencyTokenProvider != nil { + return + } + o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) +} + +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// IdempotencyTokenProvider interface for providing idempotency token +type IdempotencyTokenProvider interface { + GetIdempotencyToken() (string, error) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} diff --git a/service/wellarchitected/api_op_AssociateLenses.go b/service/wellarchitected/api_op_AssociateLenses.go new file mode 100644 index 00000000000..0ee70b31632 --- /dev/null +++ b/service/wellarchitected/api_op_AssociateLenses.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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" +) + +// Associate a lens to a workload. +func (c *Client) AssociateLenses(ctx context.Context, params *AssociateLensesInput, optFns ...func(*Options)) (*AssociateLensesOutput, error) { + if params == nil { + params = &AssociateLensesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssociateLenses", params, optFns, addOperationAssociateLensesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssociateLensesOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input to associate lens reviews. +type AssociateLensesInput struct { + + // List of lens aliases to associate or disassociate with a workload. Identify a + // lens using its LensSummary$LensAlias. + // + // This member is required. + LensAliases []string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string +} + +type AssociateLensesOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationAssociateLensesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociateLenses{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociateLenses{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpAssociateLensesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateLenses(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opAssociateLenses(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "AssociateLenses", + } +} diff --git a/service/wellarchitected/api_op_CreateMilestone.go b/service/wellarchitected/api_op_CreateMilestone.go new file mode 100644 index 00000000000..2d2e3376984 --- /dev/null +++ b/service/wellarchitected/api_op_CreateMilestone.go @@ -0,0 +1,172 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Create a milestone for an existing workload. +func (c *Client) CreateMilestone(ctx context.Context, params *CreateMilestoneInput, optFns ...func(*Options)) (*CreateMilestoneOutput, error) { + if params == nil { + params = &CreateMilestoneInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateMilestone", params, optFns, addOperationCreateMilestoneMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateMilestoneOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input for milestone creation. +type CreateMilestoneInput struct { + + // A unique case-sensitive string used to ensure that this request is idempotent + // (executes only once). You should not reuse the same token for other requests. If + // you retry a request with the same client request token and the same parameters + // after it has completed successfully, the result of the original request is + // returned. This token is listed as required, however, if you do not specify it, + // the AWS SDKs automatically generate one for you. If you are not using the AWS + // SDK or the AWS CLI, you must provide this token or the request will fail. + // + // This member is required. + ClientRequestToken *string + + // The name of the milestone in a workload. Milestone names must be unique within a + // workload. + // + // This member is required. + MilestoneName *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string +} + +// Output of a create milestone call. +type CreateMilestoneOutput struct { + + // The milestone number. A workload can have a maximum of 100 milestones. + MilestoneNumber int32 + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCreateMilestoneMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateMilestone{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateMilestone{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opCreateMilestoneMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateMilestoneValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateMilestone(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateMilestone struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateMilestone) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateMilestone) 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.(*CreateMilestoneInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateMilestoneInput ") + } + + 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_opCreateMilestoneMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateMilestone{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateMilestone(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "CreateMilestone", + } +} diff --git a/service/wellarchitected/api_op_CreateWorkload.go b/service/wellarchitected/api_op_CreateWorkload.go new file mode 100644 index 00000000000..10dce549753 --- /dev/null +++ b/service/wellarchitected/api_op_CreateWorkload.go @@ -0,0 +1,282 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Create a new workload. The owner of a workload can share the workload with other +// AWS accounts and IAM users in the same AWS Region. Only the owner of a workload +// can delete it. For more information, see Defining a Workload +// (https://docs.aws.amazon.com/wellarchitected/latest/userguide/define-workload.html) +// in the AWS Well-Architected Tool User Guide. +func (c *Client) CreateWorkload(ctx context.Context, params *CreateWorkloadInput, optFns ...func(*Options)) (*CreateWorkloadOutput, error) { + if params == nil { + params = &CreateWorkloadInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateWorkload", params, optFns, addOperationCreateWorkloadMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateWorkloadOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input for workload creation. +type CreateWorkloadInput struct { + + // A unique case-sensitive string used to ensure that this request is idempotent + // (executes only once). You should not reuse the same token for other requests. If + // you retry a request with the same client request token and the same parameters + // after it has completed successfully, the result of the original request is + // returned. This token is listed as required, however, if you do not specify it, + // the AWS SDKs automatically generate one for you. If you are not using the AWS + // SDK or the AWS CLI, you must provide this token or the request will fail. + // + // This member is required. + ClientRequestToken *string + + // The description for the workload. + // + // This member is required. + Description *string + + // The environment for the workload. + // + // This member is required. + Environment types.WorkloadEnvironment + + // The list of lenses associated with the workload. Each lens is identified by its + // LensSummary$LensAlias. + // + // This member is required. + Lenses []string + + // The review owner of the workload. The name, email address, or identifier for the + // primary group or individual that owns the workload review process. + // + // This member is required. + ReviewOwner *string + + // The name of the workload. The name must be unique within an account within a + // Region. Spaces and capitalization are ignored when checking for uniqueness. + // + // This member is required. + WorkloadName *string + + // The list of AWS account IDs associated with the workload. + AccountIds []string + + // The URL of the architectural design for the workload. + ArchitecturalDesign *string + + // The list of AWS Regions associated with the workload, for example, us-east-2, or + // ca-central-1. + AwsRegions []string + + // The industry for the workload. + Industry *string + + // The industry type for the workload. If specified, must be one of the + // following: + // + // * Agriculture + // + // * Automobile + // + // * Defense + // + // * Design and Engineering + // + // * + // Digital Advertising + // + // * Education + // + // * Environmental Protection + // + // * Financial + // Services + // + // * Gaming + // + // * General Public Services + // + // * Healthcare + // + // * Hospitality + // + // * + // InfoTech + // + // * Justice and Public Safety + // + // * Life Sciences + // + // * Manufacturing + // + // * Media + // & Entertainment + // + // * Mining & Resources + // + // * Oil & Gas + // + // * Power & Utilities + // + // * + // Professional Services + // + // * Real Estate & Construction + // + // * Retail & Wholesale + // + // * + // Social Protection + // + // * Telecommunications + // + // * Travel, Transportation & Logistics + // + // * + // Other + IndustryType *string + + // The list of non-AWS Regions associated with the workload. + NonAwsRegions []string + + // The notes associated with the workload. + Notes *string + + // The priorities of the pillars, which are used to order items in the improvement + // plan. Each pillar is represented by its PillarReviewSummary$PillarId. + PillarPriorities []string +} + +// Output of a create workload call. +type CreateWorkloadOutput struct { + + // The ARN for the workload. + WorkloadArn *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCreateWorkloadMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateWorkload{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateWorkload{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opCreateWorkloadMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateWorkloadValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWorkload(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateWorkload struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateWorkload) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateWorkload) 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.(*CreateWorkloadInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateWorkloadInput ") + } + + 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_opCreateWorkloadMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateWorkload{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateWorkload(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "CreateWorkload", + } +} diff --git a/service/wellarchitected/api_op_CreateWorkloadShare.go b/service/wellarchitected/api_op_CreateWorkloadShare.go new file mode 100644 index 00000000000..c238b3f7fc8 --- /dev/null +++ b/service/wellarchitected/api_op_CreateWorkloadShare.go @@ -0,0 +1,182 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Create a workload share. The owner of a workload can share it with other AWS +// accounts and IAM users in the same AWS Region. Shared access to a workload is +// not removed until the workload invitation is deleted. For more information, see +// Sharing a Workload +// (https://docs.aws.amazon.com/wellarchitected/latest/userguide/workloads-sharing.html) +// in the AWS Well-Architected Tool User Guide. +func (c *Client) CreateWorkloadShare(ctx context.Context, params *CreateWorkloadShareInput, optFns ...func(*Options)) (*CreateWorkloadShareOutput, error) { + if params == nil { + params = &CreateWorkloadShareInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateWorkloadShare", params, optFns, addOperationCreateWorkloadShareMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateWorkloadShareOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input for Create Workload Share +type CreateWorkloadShareInput struct { + + // A unique case-sensitive string used to ensure that this request is idempotent + // (executes only once). You should not reuse the same token for other requests. If + // you retry a request with the same client request token and the same parameters + // after it has completed successfully, the result of the original request is + // returned. This token is listed as required, however, if you do not specify it, + // the AWS SDKs automatically generate one for you. If you are not using the AWS + // SDK or the AWS CLI, you must provide this token or the request will fail. + // + // This member is required. + ClientRequestToken *string + + // Permission granted on a workload share. + // + // This member is required. + PermissionType types.PermissionType + + // The AWS account ID or IAM role with which the workload is shared. + // + // This member is required. + SharedWith *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string +} + +// Input for Create Workload Share +type CreateWorkloadShareOutput struct { + + // The ID associated with the workload share. + ShareId *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCreateWorkloadShareMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateWorkloadShare{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateWorkloadShare{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opCreateWorkloadShareMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateWorkloadShareValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWorkloadShare(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateWorkloadShare struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateWorkloadShare) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateWorkloadShare) 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.(*CreateWorkloadShareInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateWorkloadShareInput ") + } + + 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_opCreateWorkloadShareMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateWorkloadShare{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateWorkloadShare(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "CreateWorkloadShare", + } +} diff --git a/service/wellarchitected/api_op_DeleteWorkload.go b/service/wellarchitected/api_op_DeleteWorkload.go new file mode 100644 index 00000000000..dc6c0f6d4d2 --- /dev/null +++ b/service/wellarchitected/api_op_DeleteWorkload.go @@ -0,0 +1,158 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Delete an existing workload. +func (c *Client) DeleteWorkload(ctx context.Context, params *DeleteWorkloadInput, optFns ...func(*Options)) (*DeleteWorkloadOutput, error) { + if params == nil { + params = &DeleteWorkloadInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteWorkload", params, optFns, addOperationDeleteWorkloadMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteWorkloadOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input for workload deletion. +type DeleteWorkloadInput struct { + + // A unique case-sensitive string used to ensure that this request is idempotent + // (executes only once). You should not reuse the same token for other requests. If + // you retry a request with the same client request token and the same parameters + // after it has completed successfully, the result of the original request is + // returned. This token is listed as required, however, if you do not specify it, + // the AWS SDKs automatically generate one for you. If you are not using the AWS + // SDK or the AWS CLI, you must provide this token or the request will fail. + // + // This member is required. + ClientRequestToken *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string +} + +type DeleteWorkloadOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteWorkloadMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteWorkload{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteWorkload{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opDeleteWorkloadMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteWorkloadValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteWorkload(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpDeleteWorkload struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpDeleteWorkload) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpDeleteWorkload) 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.(*DeleteWorkloadInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteWorkloadInput ") + } + + 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_opDeleteWorkloadMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteWorkload{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opDeleteWorkload(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "DeleteWorkload", + } +} diff --git a/service/wellarchitected/api_op_DeleteWorkloadShare.go b/service/wellarchitected/api_op_DeleteWorkloadShare.go new file mode 100644 index 00000000000..d6c13832bb5 --- /dev/null +++ b/service/wellarchitected/api_op_DeleteWorkloadShare.go @@ -0,0 +1,163 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Delete a workload share. +func (c *Client) DeleteWorkloadShare(ctx context.Context, params *DeleteWorkloadShareInput, optFns ...func(*Options)) (*DeleteWorkloadShareOutput, error) { + if params == nil { + params = &DeleteWorkloadShareInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteWorkloadShare", params, optFns, addOperationDeleteWorkloadShareMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteWorkloadShareOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input for Delete Workload Share +type DeleteWorkloadShareInput struct { + + // A unique case-sensitive string used to ensure that this request is idempotent + // (executes only once). You should not reuse the same token for other requests. If + // you retry a request with the same client request token and the same parameters + // after it has completed successfully, the result of the original request is + // returned. This token is listed as required, however, if you do not specify it, + // the AWS SDKs automatically generate one for you. If you are not using the AWS + // SDK or the AWS CLI, you must provide this token or the request will fail. + // + // This member is required. + ClientRequestToken *string + + // The ID associated with the workload share. + // + // This member is required. + ShareId *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string +} + +type DeleteWorkloadShareOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteWorkloadShareMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteWorkloadShare{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteWorkloadShare{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opDeleteWorkloadShareMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteWorkloadShareValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteWorkloadShare(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpDeleteWorkloadShare struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpDeleteWorkloadShare) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpDeleteWorkloadShare) 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.(*DeleteWorkloadShareInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteWorkloadShareInput ") + } + + 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_opDeleteWorkloadShareMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteWorkloadShare{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opDeleteWorkloadShare(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "DeleteWorkloadShare", + } +} diff --git a/service/wellarchitected/api_op_DisassociateLenses.go b/service/wellarchitected/api_op_DisassociateLenses.go new file mode 100644 index 00000000000..76df1f775b7 --- /dev/null +++ b/service/wellarchitected/api_op_DisassociateLenses.go @@ -0,0 +1,117 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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" +) + +// Disassociate a lens from a workload. The AWS Well-Architected Framework lens +// (wellarchitected) cannot be removed from a workload. +func (c *Client) DisassociateLenses(ctx context.Context, params *DisassociateLensesInput, optFns ...func(*Options)) (*DisassociateLensesOutput, error) { + if params == nil { + params = &DisassociateLensesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisassociateLenses", params, optFns, addOperationDisassociateLensesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisassociateLensesOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input to disassociate lens reviews. +type DisassociateLensesInput struct { + + // List of lens aliases to associate or disassociate with a workload. Identify a + // lens using its LensSummary$LensAlias. + // + // This member is required. + LensAliases []string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string +} + +type DisassociateLensesOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDisassociateLensesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateLenses{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateLenses{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDisassociateLensesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateLenses(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDisassociateLenses(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "DisassociateLenses", + } +} diff --git a/service/wellarchitected/api_op_GetAnswer.go b/service/wellarchitected/api_op_GetAnswer.go new file mode 100644 index 00000000000..2307930d47d --- /dev/null +++ b/service/wellarchitected/api_op_GetAnswer.go @@ -0,0 +1,140 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get lens review. +func (c *Client) GetAnswer(ctx context.Context, params *GetAnswerInput, optFns ...func(*Options)) (*GetAnswerOutput, error) { + if params == nil { + params = &GetAnswerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAnswer", params, optFns, addOperationGetAnswerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAnswerOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input to get answer. +type GetAnswerInput struct { + + // The alias of the lens, for example, serverless. Each lens is identified by its + // LensSummary$LensAlias. + // + // This member is required. + LensAlias *string + + // The ID of the question. + // + // This member is required. + QuestionId *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string + + // The milestone number. A workload can have a maximum of 100 milestones. + MilestoneNumber int32 +} + +// Output of a get answer call. +type GetAnswerOutput struct { + + // An answer of the question. + Answer *types.Answer + + // The alias of the lens, for example, serverless. Each lens is identified by its + // LensSummary$LensAlias. + LensAlias *string + + // The milestone number. A workload can have a maximum of 100 milestones. + MilestoneNumber int32 + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetAnswerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetAnswer{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetAnswer{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetAnswerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAnswer(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetAnswer(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "GetAnswer", + } +} diff --git a/service/wellarchitected/api_op_GetLensReview.go b/service/wellarchitected/api_op_GetLensReview.go new file mode 100644 index 00000000000..85086bad7c7 --- /dev/null +++ b/service/wellarchitected/api_op_GetLensReview.go @@ -0,0 +1,131 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get lens review. +func (c *Client) GetLensReview(ctx context.Context, params *GetLensReviewInput, optFns ...func(*Options)) (*GetLensReviewOutput, error) { + if params == nil { + params = &GetLensReviewInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetLensReview", params, optFns, addOperationGetLensReviewMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetLensReviewOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input to get lens review. +type GetLensReviewInput struct { + + // The alias of the lens, for example, serverless. Each lens is identified by its + // LensSummary$LensAlias. + // + // This member is required. + LensAlias *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string + + // The milestone number. A workload can have a maximum of 100 milestones. + MilestoneNumber int32 +} + +// Output of a get lens review call. +type GetLensReviewOutput struct { + + // A lens review of a question. + LensReview *types.LensReview + + // The milestone number. A workload can have a maximum of 100 milestones. + MilestoneNumber int32 + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetLensReviewMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetLensReview{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetLensReview{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetLensReviewValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLensReview(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetLensReview(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "GetLensReview", + } +} diff --git a/service/wellarchitected/api_op_GetLensReviewReport.go b/service/wellarchitected/api_op_GetLensReviewReport.go new file mode 100644 index 00000000000..5bec2e4520e --- /dev/null +++ b/service/wellarchitected/api_op_GetLensReviewReport.go @@ -0,0 +1,131 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get lens review report. +func (c *Client) GetLensReviewReport(ctx context.Context, params *GetLensReviewReportInput, optFns ...func(*Options)) (*GetLensReviewReportOutput, error) { + if params == nil { + params = &GetLensReviewReportInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetLensReviewReport", params, optFns, addOperationGetLensReviewReportMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetLensReviewReportOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input to get lens review report. +type GetLensReviewReportInput struct { + + // The alias of the lens, for example, serverless. Each lens is identified by its + // LensSummary$LensAlias. + // + // This member is required. + LensAlias *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string + + // The milestone number. A workload can have a maximum of 100 milestones. + MilestoneNumber int32 +} + +// Output of a get lens review report call. +type GetLensReviewReportOutput struct { + + // A report of a lens review. + LensReviewReport *types.LensReviewReport + + // The milestone number. A workload can have a maximum of 100 milestones. + MilestoneNumber int32 + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetLensReviewReportMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetLensReviewReport{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetLensReviewReport{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetLensReviewReportValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLensReviewReport(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetLensReviewReport(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "GetLensReviewReport", + } +} diff --git a/service/wellarchitected/api_op_GetLensVersionDifference.go b/service/wellarchitected/api_op_GetLensVersionDifference.go new file mode 100644 index 00000000000..e39eeca3585 --- /dev/null +++ b/service/wellarchitected/api_op_GetLensVersionDifference.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get lens version differences. +func (c *Client) GetLensVersionDifference(ctx context.Context, params *GetLensVersionDifferenceInput, optFns ...func(*Options)) (*GetLensVersionDifferenceOutput, error) { + if params == nil { + params = &GetLensVersionDifferenceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetLensVersionDifference", params, optFns, addOperationGetLensVersionDifferenceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetLensVersionDifferenceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetLensVersionDifferenceInput struct { + + // The base version of the lens. + // + // This member is required. + BaseLensVersion *string + + // The alias of the lens, for example, serverless. Each lens is identified by its + // LensSummary$LensAlias. + // + // This member is required. + LensAlias *string +} + +type GetLensVersionDifferenceOutput struct { + + // The base version of the lens. + BaseLensVersion *string + + // The latest version of the lens. + LatestLensVersion *string + + // The alias of the lens, for example, serverless. Each lens is identified by its + // LensSummary$LensAlias. + LensAlias *string + + // The differences between the base and latest versions of the lens. + VersionDifferences *types.VersionDifferences + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetLensVersionDifferenceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetLensVersionDifference{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetLensVersionDifference{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetLensVersionDifferenceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetLensVersionDifference(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetLensVersionDifference(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "GetLensVersionDifference", + } +} diff --git a/service/wellarchitected/api_op_GetMilestone.go b/service/wellarchitected/api_op_GetMilestone.go new file mode 100644 index 00000000000..7fb3b412aab --- /dev/null +++ b/service/wellarchitected/api_op_GetMilestone.go @@ -0,0 +1,124 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get a milestone for an existing workload. +func (c *Client) GetMilestone(ctx context.Context, params *GetMilestoneInput, optFns ...func(*Options)) (*GetMilestoneOutput, error) { + if params == nil { + params = &GetMilestoneInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetMilestone", params, optFns, addOperationGetMilestoneMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetMilestoneOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input to get a milestone. +type GetMilestoneInput struct { + + // The milestone number. A workload can have a maximum of 100 milestones. + // + // This member is required. + MilestoneNumber int32 + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string +} + +// Output of a get milestone call. +type GetMilestoneOutput struct { + + // A milestone return object. + Milestone *types.Milestone + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetMilestoneMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetMilestone{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetMilestone{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetMilestoneValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetMilestone(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetMilestone(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "GetMilestone", + } +} diff --git a/service/wellarchitected/api_op_GetWorkload.go b/service/wellarchitected/api_op_GetWorkload.go new file mode 100644 index 00000000000..4abc9fe9ed6 --- /dev/null +++ b/service/wellarchitected/api_op_GetWorkload.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Get an existing workload. +func (c *Client) GetWorkload(ctx context.Context, params *GetWorkloadInput, optFns ...func(*Options)) (*GetWorkloadOutput, error) { + if params == nil { + params = &GetWorkloadInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetWorkload", params, optFns, addOperationGetWorkloadMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetWorkloadOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input to get a workload. +type GetWorkloadInput struct { + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string +} + +// Output of a get workload call. +type GetWorkloadOutput struct { + + // A workload return object. + Workload *types.Workload + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetWorkloadMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetWorkload{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetWorkload{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetWorkloadValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetWorkload(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetWorkload(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "GetWorkload", + } +} diff --git a/service/wellarchitected/api_op_ListAnswers.go b/service/wellarchitected/api_op_ListAnswers.go new file mode 100644 index 00000000000..ecd2e0c9830 --- /dev/null +++ b/service/wellarchitected/api_op_ListAnswers.go @@ -0,0 +1,230 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List of answers. +func (c *Client) ListAnswers(ctx context.Context, params *ListAnswersInput, optFns ...func(*Options)) (*ListAnswersOutput, error) { + if params == nil { + params = &ListAnswersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAnswers", params, optFns, addOperationListAnswersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAnswersOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input to list answers. +type ListAnswersInput struct { + + // The alias of the lens, for example, serverless. Each lens is identified by its + // LensSummary$LensAlias. + // + // This member is required. + LensAlias *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string + + // The maximum number of results to return for this request. + MaxResults int32 + + // The milestone number. A workload can have a maximum of 100 milestones. + MilestoneNumber int32 + + // The token to use to retrieve the next set of results. + NextToken *string + + // The ID used to identify a pillar, for example, security. A pillar is identified + // by its PillarReviewSummary$PillarId. + PillarId *string +} + +// Output of a list answers call. +type ListAnswersOutput struct { + + // List of answer summaries of lens review in a workload. + AnswerSummaries []types.AnswerSummary + + // The alias of the lens, for example, serverless. Each lens is identified by its + // LensSummary$LensAlias. + LensAlias *string + + // The milestone number. A workload can have a maximum of 100 milestones. + MilestoneNumber int32 + + // The token to use to retrieve the next set of results. + NextToken *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListAnswersMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListAnswers{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAnswers{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListAnswersValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAnswers(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListAnswersAPIClient is a client that implements the ListAnswers operation. +type ListAnswersAPIClient interface { + ListAnswers(context.Context, *ListAnswersInput, ...func(*Options)) (*ListAnswersOutput, error) +} + +var _ ListAnswersAPIClient = (*Client)(nil) + +// ListAnswersPaginatorOptions is the paginator options for ListAnswers +type ListAnswersPaginatorOptions struct { + // The maximum number of results to return for this request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListAnswersPaginator is a paginator for ListAnswers +type ListAnswersPaginator struct { + options ListAnswersPaginatorOptions + client ListAnswersAPIClient + params *ListAnswersInput + nextToken *string + firstPage bool +} + +// NewListAnswersPaginator returns a new ListAnswersPaginator +func NewListAnswersPaginator(client ListAnswersAPIClient, params *ListAnswersInput, optFns ...func(*ListAnswersPaginatorOptions)) *ListAnswersPaginator { + options := ListAnswersPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListAnswersInput{} + } + + return &ListAnswersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListAnswersPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListAnswers page. +func (p *ListAnswersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListAnswersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListAnswers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListAnswers(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "ListAnswers", + } +} diff --git a/service/wellarchitected/api_op_ListLensReviewImprovements.go b/service/wellarchitected/api_op_ListLensReviewImprovements.go new file mode 100644 index 00000000000..3f809814e59 --- /dev/null +++ b/service/wellarchitected/api_op_ListLensReviewImprovements.go @@ -0,0 +1,234 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List lens review improvements. +func (c *Client) ListLensReviewImprovements(ctx context.Context, params *ListLensReviewImprovementsInput, optFns ...func(*Options)) (*ListLensReviewImprovementsOutput, error) { + if params == nil { + params = &ListLensReviewImprovementsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListLensReviewImprovements", params, optFns, addOperationListLensReviewImprovementsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListLensReviewImprovementsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input to list lens review improvements. +type ListLensReviewImprovementsInput struct { + + // The alias of the lens, for example, serverless. Each lens is identified by its + // LensSummary$LensAlias. + // + // This member is required. + LensAlias *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string + + // The maximum number of results to return for this request. + MaxResults int32 + + // The milestone number. A workload can have a maximum of 100 milestones. + MilestoneNumber int32 + + // The token to use to retrieve the next set of results. + NextToken *string + + // The ID used to identify a pillar, for example, security. A pillar is identified + // by its PillarReviewSummary$PillarId. + PillarId *string +} + +// Output of a list lens review improvements call. +type ListLensReviewImprovementsOutput struct { + + // List of improvement summaries of lens review in a workload. + ImprovementSummaries []types.ImprovementSummary + + // The alias of the lens, for example, serverless. Each lens is identified by its + // LensSummary$LensAlias. + LensAlias *string + + // The milestone number. A workload can have a maximum of 100 milestones. + MilestoneNumber int32 + + // The token to use to retrieve the next set of results. + NextToken *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListLensReviewImprovementsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListLensReviewImprovements{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListLensReviewImprovements{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListLensReviewImprovementsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListLensReviewImprovements(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListLensReviewImprovementsAPIClient is a client that implements the +// ListLensReviewImprovements operation. +type ListLensReviewImprovementsAPIClient interface { + ListLensReviewImprovements(context.Context, *ListLensReviewImprovementsInput, ...func(*Options)) (*ListLensReviewImprovementsOutput, error) +} + +var _ ListLensReviewImprovementsAPIClient = (*Client)(nil) + +// ListLensReviewImprovementsPaginatorOptions is the paginator options for +// ListLensReviewImprovements +type ListLensReviewImprovementsPaginatorOptions struct { + // The maximum number of results to return for this request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListLensReviewImprovementsPaginator is a paginator for +// ListLensReviewImprovements +type ListLensReviewImprovementsPaginator struct { + options ListLensReviewImprovementsPaginatorOptions + client ListLensReviewImprovementsAPIClient + params *ListLensReviewImprovementsInput + nextToken *string + firstPage bool +} + +// NewListLensReviewImprovementsPaginator returns a new +// ListLensReviewImprovementsPaginator +func NewListLensReviewImprovementsPaginator(client ListLensReviewImprovementsAPIClient, params *ListLensReviewImprovementsInput, optFns ...func(*ListLensReviewImprovementsPaginatorOptions)) *ListLensReviewImprovementsPaginator { + options := ListLensReviewImprovementsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLensReviewImprovementsInput{} + } + + return &ListLensReviewImprovementsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLensReviewImprovementsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListLensReviewImprovements page. +func (p *ListLensReviewImprovementsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLensReviewImprovementsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListLensReviewImprovements(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListLensReviewImprovements(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "ListLensReviewImprovements", + } +} diff --git a/service/wellarchitected/api_op_ListLensReviews.go b/service/wellarchitected/api_op_ListLensReviews.go new file mode 100644 index 00000000000..193d4e305ee --- /dev/null +++ b/service/wellarchitected/api_op_ListLensReviews.go @@ -0,0 +1,217 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List lens reviews. +func (c *Client) ListLensReviews(ctx context.Context, params *ListLensReviewsInput, optFns ...func(*Options)) (*ListLensReviewsOutput, error) { + if params == nil { + params = &ListLensReviewsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListLensReviews", params, optFns, addOperationListLensReviewsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListLensReviewsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input to list lens reviews. +type ListLensReviewsInput struct { + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string + + // The maximum number of results to return for this request. + MaxResults int32 + + // The milestone number. A workload can have a maximum of 100 milestones. + MilestoneNumber int32 + + // The token to use to retrieve the next set of results. + NextToken *string +} + +// Output of a list lens reviews call. +type ListLensReviewsOutput struct { + + // List of lens summaries of lens reviews of a workload. + LensReviewSummaries []types.LensReviewSummary + + // The milestone number. A workload can have a maximum of 100 milestones. + MilestoneNumber int32 + + // The token to use to retrieve the next set of results. + NextToken *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListLensReviewsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListLensReviews{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListLensReviews{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListLensReviewsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListLensReviews(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListLensReviewsAPIClient is a client that implements the ListLensReviews +// operation. +type ListLensReviewsAPIClient interface { + ListLensReviews(context.Context, *ListLensReviewsInput, ...func(*Options)) (*ListLensReviewsOutput, error) +} + +var _ ListLensReviewsAPIClient = (*Client)(nil) + +// ListLensReviewsPaginatorOptions is the paginator options for ListLensReviews +type ListLensReviewsPaginatorOptions struct { + // The maximum number of results to return for this request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListLensReviewsPaginator is a paginator for ListLensReviews +type ListLensReviewsPaginator struct { + options ListLensReviewsPaginatorOptions + client ListLensReviewsAPIClient + params *ListLensReviewsInput + nextToken *string + firstPage bool +} + +// NewListLensReviewsPaginator returns a new ListLensReviewsPaginator +func NewListLensReviewsPaginator(client ListLensReviewsAPIClient, params *ListLensReviewsInput, optFns ...func(*ListLensReviewsPaginatorOptions)) *ListLensReviewsPaginator { + options := ListLensReviewsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLensReviewsInput{} + } + + return &ListLensReviewsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLensReviewsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListLensReviews page. +func (p *ListLensReviewsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLensReviewsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListLensReviews(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListLensReviews(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "ListLensReviews", + } +} diff --git a/service/wellarchitected/api_op_ListLenses.go b/service/wellarchitected/api_op_ListLenses.go new file mode 100644 index 00000000000..f3cbe31f85a --- /dev/null +++ b/service/wellarchitected/api_op_ListLenses.go @@ -0,0 +1,199 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List the available lenses. +func (c *Client) ListLenses(ctx context.Context, params *ListLensesInput, optFns ...func(*Options)) (*ListLensesOutput, error) { + if params == nil { + params = &ListLensesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListLenses", params, optFns, addOperationListLensesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListLensesOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input to list lenses. +type ListLensesInput struct { + + // The maximum number of results to return for this request. + MaxResults int32 + + // The token to use to retrieve the next set of results. + NextToken *string +} + +// Output of a list lenses call. +type ListLensesOutput struct { + + // List of lens summaries of available lenses. + LensSummaries []types.LensSummary + + // The token to use to retrieve the next set of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListLensesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListLenses{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListLenses{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListLenses(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListLensesAPIClient is a client that implements the ListLenses operation. +type ListLensesAPIClient interface { + ListLenses(context.Context, *ListLensesInput, ...func(*Options)) (*ListLensesOutput, error) +} + +var _ ListLensesAPIClient = (*Client)(nil) + +// ListLensesPaginatorOptions is the paginator options for ListLenses +type ListLensesPaginatorOptions struct { + // The maximum number of results to return for this request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListLensesPaginator is a paginator for ListLenses +type ListLensesPaginator struct { + options ListLensesPaginatorOptions + client ListLensesAPIClient + params *ListLensesInput + nextToken *string + firstPage bool +} + +// NewListLensesPaginator returns a new ListLensesPaginator +func NewListLensesPaginator(client ListLensesAPIClient, params *ListLensesInput, optFns ...func(*ListLensesPaginatorOptions)) *ListLensesPaginator { + options := ListLensesPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListLensesInput{} + } + + return &ListLensesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLensesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListLenses page. +func (p *ListLensesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLensesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListLenses(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListLenses(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "ListLenses", + } +} diff --git a/service/wellarchitected/api_op_ListMilestones.go b/service/wellarchitected/api_op_ListMilestones.go new file mode 100644 index 00000000000..644e4d59f11 --- /dev/null +++ b/service/wellarchitected/api_op_ListMilestones.go @@ -0,0 +1,211 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List all milestones for an existing workload. +func (c *Client) ListMilestones(ctx context.Context, params *ListMilestonesInput, optFns ...func(*Options)) (*ListMilestonesOutput, error) { + if params == nil { + params = &ListMilestonesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListMilestones", params, optFns, addOperationListMilestonesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListMilestonesOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input to list all milestones for a workload. +type ListMilestonesInput struct { + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string + + // The maximum number of results to return for this request. + MaxResults int32 + + // The token to use to retrieve the next set of results. + NextToken *string +} + +// Output of a list milestones call. +type ListMilestonesOutput struct { + + // A list of milestone summaries. + MilestoneSummaries []types.MilestoneSummary + + // The token to use to retrieve the next set of results. + NextToken *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListMilestonesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListMilestones{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListMilestones{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListMilestonesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListMilestones(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListMilestonesAPIClient is a client that implements the ListMilestones +// operation. +type ListMilestonesAPIClient interface { + ListMilestones(context.Context, *ListMilestonesInput, ...func(*Options)) (*ListMilestonesOutput, error) +} + +var _ ListMilestonesAPIClient = (*Client)(nil) + +// ListMilestonesPaginatorOptions is the paginator options for ListMilestones +type ListMilestonesPaginatorOptions struct { + // The maximum number of results to return for this request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListMilestonesPaginator is a paginator for ListMilestones +type ListMilestonesPaginator struct { + options ListMilestonesPaginatorOptions + client ListMilestonesAPIClient + params *ListMilestonesInput + nextToken *string + firstPage bool +} + +// NewListMilestonesPaginator returns a new ListMilestonesPaginator +func NewListMilestonesPaginator(client ListMilestonesAPIClient, params *ListMilestonesInput, optFns ...func(*ListMilestonesPaginatorOptions)) *ListMilestonesPaginator { + options := ListMilestonesPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMilestonesInput{} + } + + return &ListMilestonesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMilestonesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMilestones page. +func (p *ListMilestonesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMilestonesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListMilestones(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListMilestones(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "ListMilestones", + } +} diff --git a/service/wellarchitected/api_op_ListNotifications.go b/service/wellarchitected/api_op_ListNotifications.go new file mode 100644 index 00000000000..8ec2675c204 --- /dev/null +++ b/service/wellarchitected/api_op_ListNotifications.go @@ -0,0 +1,201 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List lens notifications. +func (c *Client) ListNotifications(ctx context.Context, params *ListNotificationsInput, optFns ...func(*Options)) (*ListNotificationsOutput, error) { + if params == nil { + params = &ListNotificationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListNotifications", params, optFns, addOperationListNotificationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListNotificationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListNotificationsInput struct { + + // The maximum number of results to return for this request. + MaxResults int32 + + // The token to use to retrieve the next set of results. + NextToken *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string +} + +type ListNotificationsOutput struct { + + // The token to use to retrieve the next set of results. + NextToken *string + + // List of lens notification summaries in a workload. + NotificationSummaries []types.NotificationSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListNotificationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListNotifications{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListNotifications{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListNotifications(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListNotificationsAPIClient is a client that implements the ListNotifications +// operation. +type ListNotificationsAPIClient interface { + ListNotifications(context.Context, *ListNotificationsInput, ...func(*Options)) (*ListNotificationsOutput, error) +} + +var _ ListNotificationsAPIClient = (*Client)(nil) + +// ListNotificationsPaginatorOptions is the paginator options for ListNotifications +type ListNotificationsPaginatorOptions struct { + // The maximum number of results to return for this request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListNotificationsPaginator is a paginator for ListNotifications +type ListNotificationsPaginator struct { + options ListNotificationsPaginatorOptions + client ListNotificationsAPIClient + params *ListNotificationsInput + nextToken *string + firstPage bool +} + +// NewListNotificationsPaginator returns a new ListNotificationsPaginator +func NewListNotificationsPaginator(client ListNotificationsAPIClient, params *ListNotificationsInput, optFns ...func(*ListNotificationsPaginatorOptions)) *ListNotificationsPaginator { + options := ListNotificationsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListNotificationsInput{} + } + + return &ListNotificationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNotificationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListNotifications page. +func (p *ListNotificationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNotificationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListNotifications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListNotifications(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "ListNotifications", + } +} diff --git a/service/wellarchitected/api_op_ListShareInvitations.go b/service/wellarchitected/api_op_ListShareInvitations.go new file mode 100644 index 00000000000..fd11ada4109 --- /dev/null +++ b/service/wellarchitected/api_op_ListShareInvitations.go @@ -0,0 +1,205 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List the workload invitations. +func (c *Client) ListShareInvitations(ctx context.Context, params *ListShareInvitationsInput, optFns ...func(*Options)) (*ListShareInvitationsOutput, error) { + if params == nil { + params = &ListShareInvitationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListShareInvitations", params, optFns, addOperationListShareInvitationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListShareInvitationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input for List Share Invitations +type ListShareInvitationsInput struct { + + // The maximum number of results to return for this request. + MaxResults int32 + + // The token to use to retrieve the next set of results. + NextToken *string + + // An optional string added to the beginning of each workload name returned in the + // results. + WorkloadNamePrefix *string +} + +// Input for List Share Invitations +type ListShareInvitationsOutput struct { + + // The token to use to retrieve the next set of results. + NextToken *string + + // List of share invitation summaries in a workload. + ShareInvitationSummaries []types.ShareInvitationSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListShareInvitationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListShareInvitations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListShareInvitations{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListShareInvitations(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListShareInvitationsAPIClient is a client that implements the +// ListShareInvitations operation. +type ListShareInvitationsAPIClient interface { + ListShareInvitations(context.Context, *ListShareInvitationsInput, ...func(*Options)) (*ListShareInvitationsOutput, error) +} + +var _ ListShareInvitationsAPIClient = (*Client)(nil) + +// ListShareInvitationsPaginatorOptions is the paginator options for +// ListShareInvitations +type ListShareInvitationsPaginatorOptions struct { + // The maximum number of results to return for this request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListShareInvitationsPaginator is a paginator for ListShareInvitations +type ListShareInvitationsPaginator struct { + options ListShareInvitationsPaginatorOptions + client ListShareInvitationsAPIClient + params *ListShareInvitationsInput + nextToken *string + firstPage bool +} + +// NewListShareInvitationsPaginator returns a new ListShareInvitationsPaginator +func NewListShareInvitationsPaginator(client ListShareInvitationsAPIClient, params *ListShareInvitationsInput, optFns ...func(*ListShareInvitationsPaginatorOptions)) *ListShareInvitationsPaginator { + options := ListShareInvitationsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListShareInvitationsInput{} + } + + return &ListShareInvitationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListShareInvitationsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListShareInvitations page. +func (p *ListShareInvitationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListShareInvitationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListShareInvitations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListShareInvitations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "ListShareInvitations", + } +} diff --git a/service/wellarchitected/api_op_ListWorkloadShares.go b/service/wellarchitected/api_op_ListWorkloadShares.go new file mode 100644 index 00000000000..3390187cdf4 --- /dev/null +++ b/service/wellarchitected/api_op_ListWorkloadShares.go @@ -0,0 +1,215 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List the workload shares associated with the workload. +func (c *Client) ListWorkloadShares(ctx context.Context, params *ListWorkloadSharesInput, optFns ...func(*Options)) (*ListWorkloadSharesOutput, error) { + if params == nil { + params = &ListWorkloadSharesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListWorkloadShares", params, optFns, addOperationListWorkloadSharesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListWorkloadSharesOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input for List Workload Share +type ListWorkloadSharesInput struct { + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string + + // The maximum number of results to return for this request. + MaxResults int32 + + // The token to use to retrieve the next set of results. + NextToken *string + + // The AWS account ID or IAM role with which the workload is shared. + SharedWithPrefix *string +} + +// Input for List Workload Share +type ListWorkloadSharesOutput struct { + + // The token to use to retrieve the next set of results. + NextToken *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string + + // A list of workload share summaries. + WorkloadShareSummaries []types.WorkloadShareSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListWorkloadSharesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListWorkloadShares{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListWorkloadShares{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListWorkloadSharesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListWorkloadShares(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListWorkloadSharesAPIClient is a client that implements the ListWorkloadShares +// operation. +type ListWorkloadSharesAPIClient interface { + ListWorkloadShares(context.Context, *ListWorkloadSharesInput, ...func(*Options)) (*ListWorkloadSharesOutput, error) +} + +var _ ListWorkloadSharesAPIClient = (*Client)(nil) + +// ListWorkloadSharesPaginatorOptions is the paginator options for +// ListWorkloadShares +type ListWorkloadSharesPaginatorOptions struct { + // The maximum number of results to return for this request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListWorkloadSharesPaginator is a paginator for ListWorkloadShares +type ListWorkloadSharesPaginator struct { + options ListWorkloadSharesPaginatorOptions + client ListWorkloadSharesAPIClient + params *ListWorkloadSharesInput + nextToken *string + firstPage bool +} + +// NewListWorkloadSharesPaginator returns a new ListWorkloadSharesPaginator +func NewListWorkloadSharesPaginator(client ListWorkloadSharesAPIClient, params *ListWorkloadSharesInput, optFns ...func(*ListWorkloadSharesPaginatorOptions)) *ListWorkloadSharesPaginator { + options := ListWorkloadSharesPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorkloadSharesInput{} + } + + return &ListWorkloadSharesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkloadSharesPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListWorkloadShares page. +func (p *ListWorkloadSharesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkloadSharesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListWorkloadShares(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListWorkloadShares(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "ListWorkloadShares", + } +} diff --git a/service/wellarchitected/api_op_ListWorkloads.go b/service/wellarchitected/api_op_ListWorkloads.go new file mode 100644 index 00000000000..23cc7f3bc76 --- /dev/null +++ b/service/wellarchitected/api_op_ListWorkloads.go @@ -0,0 +1,203 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List workloads. Paginated. +func (c *Client) ListWorkloads(ctx context.Context, params *ListWorkloadsInput, optFns ...func(*Options)) (*ListWorkloadsOutput, error) { + if params == nil { + params = &ListWorkloadsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListWorkloads", params, optFns, addOperationListWorkloadsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListWorkloadsOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input to list all workloads. +type ListWorkloadsInput struct { + + // The maximum number of results to return for this request. + MaxResults int32 + + // The token to use to retrieve the next set of results. + NextToken *string + + // An optional string added to the beginning of each workload name returned in the + // results. + WorkloadNamePrefix *string +} + +// Output of a list workloads call. +type ListWorkloadsOutput struct { + + // The token to use to retrieve the next set of results. + NextToken *string + + // A list of workload summaries. + WorkloadSummaries []types.WorkloadSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListWorkloadsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListWorkloads{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListWorkloads{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListWorkloads(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListWorkloadsAPIClient is a client that implements the ListWorkloads operation. +type ListWorkloadsAPIClient interface { + ListWorkloads(context.Context, *ListWorkloadsInput, ...func(*Options)) (*ListWorkloadsOutput, error) +} + +var _ ListWorkloadsAPIClient = (*Client)(nil) + +// ListWorkloadsPaginatorOptions is the paginator options for ListWorkloads +type ListWorkloadsPaginatorOptions struct { + // The maximum number of results to return for this request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListWorkloadsPaginator is a paginator for ListWorkloads +type ListWorkloadsPaginator struct { + options ListWorkloadsPaginatorOptions + client ListWorkloadsAPIClient + params *ListWorkloadsInput + nextToken *string + firstPage bool +} + +// NewListWorkloadsPaginator returns a new ListWorkloadsPaginator +func NewListWorkloadsPaginator(client ListWorkloadsAPIClient, params *ListWorkloadsInput, optFns ...func(*ListWorkloadsPaginatorOptions)) *ListWorkloadsPaginator { + options := ListWorkloadsPaginatorOptions{} + if params.MaxResults != 0 { + options.Limit = params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListWorkloadsInput{} + } + + return &ListWorkloadsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkloadsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListWorkloads page. +func (p *ListWorkloadsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkloadsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + params.MaxResults = p.options.Limit + + result, err := p.client.ListWorkloads(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListWorkloads(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "ListWorkloads", + } +} diff --git a/service/wellarchitected/api_op_UpdateAnswer.go b/service/wellarchitected/api_op_UpdateAnswer.go new file mode 100644 index 00000000000..dd8e2510600 --- /dev/null +++ b/service/wellarchitected/api_op_UpdateAnswer.go @@ -0,0 +1,143 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update the answer. +func (c *Client) UpdateAnswer(ctx context.Context, params *UpdateAnswerInput, optFns ...func(*Options)) (*UpdateAnswerOutput, error) { + if params == nil { + params = &UpdateAnswerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateAnswer", params, optFns, addOperationUpdateAnswerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateAnswerOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input to update answer. +type UpdateAnswerInput struct { + + // The alias of the lens, for example, serverless. Each lens is identified by its + // LensSummary$LensAlias. + // + // This member is required. + LensAlias *string + + // The ID of the question. + // + // This member is required. + QuestionId *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string + + // Defines whether this question is applicable to a lens review. + IsApplicable bool + + // The notes associated with the workload. + Notes *string + + // List of selected choice IDs in a question answer. + SelectedChoices []string +} + +// Output of a update answer call. +type UpdateAnswerOutput struct { + + // An answer of the question. + Answer *types.Answer + + // The alias of the lens, for example, serverless. Each lens is identified by its + // LensSummary$LensAlias. + LensAlias *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationUpdateAnswerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateAnswer{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateAnswer{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateAnswerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateAnswer(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opUpdateAnswer(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "UpdateAnswer", + } +} diff --git a/service/wellarchitected/api_op_UpdateLensReview.go b/service/wellarchitected/api_op_UpdateLensReview.go new file mode 100644 index 00000000000..8e00310b350 --- /dev/null +++ b/service/wellarchitected/api_op_UpdateLensReview.go @@ -0,0 +1,131 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update lens review. +func (c *Client) UpdateLensReview(ctx context.Context, params *UpdateLensReviewInput, optFns ...func(*Options)) (*UpdateLensReviewOutput, error) { + if params == nil { + params = &UpdateLensReviewInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateLensReview", params, optFns, addOperationUpdateLensReviewMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateLensReviewOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input for update lens review. +type UpdateLensReviewInput struct { + + // The alias of the lens, for example, serverless. Each lens is identified by its + // LensSummary$LensAlias. + // + // This member is required. + LensAlias *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string + + // The notes associated with the workload. + LensNotes *string + + // List of pillar notes of a lens review in a workload. + PillarNotes map[string]string +} + +// Output of a update lens review call. +type UpdateLensReviewOutput struct { + + // A lens review of a question. + LensReview *types.LensReview + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationUpdateLensReviewMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateLensReview{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateLensReview{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateLensReviewValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateLensReview(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opUpdateLensReview(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "UpdateLensReview", + } +} diff --git a/service/wellarchitected/api_op_UpdateShareInvitation.go b/service/wellarchitected/api_op_UpdateShareInvitation.go new file mode 100644 index 00000000000..035fdb322d1 --- /dev/null +++ b/service/wellarchitected/api_op_UpdateShareInvitation.go @@ -0,0 +1,120 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update a workload invitation. +func (c *Client) UpdateShareInvitation(ctx context.Context, params *UpdateShareInvitationInput, optFns ...func(*Options)) (*UpdateShareInvitationOutput, error) { + if params == nil { + params = &UpdateShareInvitationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateShareInvitation", params, optFns, addOperationUpdateShareInvitationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateShareInvitationOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input for Update Share Invitation +type UpdateShareInvitationInput struct { + + // Share invitation action taken by contributor. + // + // This member is required. + ShareInvitationAction types.ShareInvitationAction + + // The ID assigned to the share invitation. + // + // This member is required. + ShareInvitationId *string +} + +type UpdateShareInvitationOutput struct { + + // The updated workload share invitation. + ShareInvitation *types.ShareInvitation + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationUpdateShareInvitationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateShareInvitation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateShareInvitation{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateShareInvitationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateShareInvitation(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opUpdateShareInvitation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "UpdateShareInvitation", + } +} diff --git a/service/wellarchitected/api_op_UpdateWorkload.go b/service/wellarchitected/api_op_UpdateWorkload.go new file mode 100644 index 00000000000..9e4c9d5a764 --- /dev/null +++ b/service/wellarchitected/api_op_UpdateWorkload.go @@ -0,0 +1,227 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update an existing workload. +func (c *Client) UpdateWorkload(ctx context.Context, params *UpdateWorkloadInput, optFns ...func(*Options)) (*UpdateWorkloadOutput, error) { + if params == nil { + params = &UpdateWorkloadInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateWorkload", params, optFns, addOperationUpdateWorkloadMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateWorkloadOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input to update a workload. +type UpdateWorkloadInput struct { + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string + + // The list of AWS account IDs associated with the workload. + AccountIds []string + + // The URL of the architectural design for the workload. + ArchitecturalDesign *string + + // The list of AWS Regions associated with the workload, for example, us-east-2, or + // ca-central-1. + AwsRegions []string + + // The description for the workload. + Description *string + + // The environment for the workload. + Environment types.WorkloadEnvironment + + // The improvement status for a workload. + ImprovementStatus types.WorkloadImprovementStatus + + // The industry for the workload. + Industry *string + + // The industry type for the workload. If specified, must be one of the + // following: + // + // * Agriculture + // + // * Automobile + // + // * Defense + // + // * Design and Engineering + // + // * + // Digital Advertising + // + // * Education + // + // * Environmental Protection + // + // * Financial + // Services + // + // * Gaming + // + // * General Public Services + // + // * Healthcare + // + // * Hospitality + // + // * + // InfoTech + // + // * Justice and Public Safety + // + // * Life Sciences + // + // * Manufacturing + // + // * Media + // & Entertainment + // + // * Mining & Resources + // + // * Oil & Gas + // + // * Power & Utilities + // + // * + // Professional Services + // + // * Real Estate & Construction + // + // * Retail & Wholesale + // + // * + // Social Protection + // + // * Telecommunications + // + // * Travel, Transportation & Logistics + // + // * + // Other + IndustryType *string + + // Flag indicating whether the workload owner has acknowledged that the Review + // owner field is required. If a Review owner is not added to the workload within + // 60 days of acknowledgement, access to the workload is restricted until an owner + // is added. + IsReviewOwnerUpdateAcknowledged bool + + // The list of non-AWS Regions associated with the workload. + NonAwsRegions []string + + // The notes associated with the workload. + Notes *string + + // The priorities of the pillars, which are used to order items in the improvement + // plan. Each pillar is represented by its PillarReviewSummary$PillarId. + PillarPriorities []string + + // The review owner of the workload. The name, email address, or identifier for the + // primary group or individual that owns the workload review process. + ReviewOwner *string + + // The name of the workload. The name must be unique within an account within a + // Region. Spaces and capitalization are ignored when checking for uniqueness. + WorkloadName *string +} + +// Output of an update workload call. +type UpdateWorkloadOutput struct { + + // A workload return object. + Workload *types.Workload + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationUpdateWorkloadMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateWorkload{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateWorkload{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateWorkloadValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateWorkload(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opUpdateWorkload(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "UpdateWorkload", + } +} diff --git a/service/wellarchitected/api_op_UpdateWorkloadShare.go b/service/wellarchitected/api_op_UpdateWorkloadShare.go new file mode 100644 index 00000000000..88a31e9e4ff --- /dev/null +++ b/service/wellarchitected/api_op_UpdateWorkloadShare.go @@ -0,0 +1,129 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update a workload share. +func (c *Client) UpdateWorkloadShare(ctx context.Context, params *UpdateWorkloadShareInput, optFns ...func(*Options)) (*UpdateWorkloadShareOutput, error) { + if params == nil { + params = &UpdateWorkloadShareInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateWorkloadShare", params, optFns, addOperationUpdateWorkloadShareMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateWorkloadShareOutput) + out.ResultMetadata = metadata + return out, nil +} + +// Input for Update Workload Share +type UpdateWorkloadShareInput struct { + + // Permission granted on a workload share. + // + // This member is required. + PermissionType types.PermissionType + + // The ID associated with the workload share. + // + // This member is required. + ShareId *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string +} + +// Input for Update Workload Share +type UpdateWorkloadShareOutput struct { + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string + + // A workload share return object. + WorkloadShare *types.WorkloadShare + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationUpdateWorkloadShareMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateWorkloadShare{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateWorkloadShare{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateWorkloadShareValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateWorkloadShare(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opUpdateWorkloadShare(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "UpdateWorkloadShare", + } +} diff --git a/service/wellarchitected/api_op_UpgradeLensReview.go b/service/wellarchitected/api_op_UpgradeLensReview.go new file mode 100644 index 00000000000..529acb32c0f --- /dev/null +++ b/service/wellarchitected/api_op_UpgradeLensReview.go @@ -0,0 +1,130 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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" +) + +// Upgrade lens review. +func (c *Client) UpgradeLensReview(ctx context.Context, params *UpgradeLensReviewInput, optFns ...func(*Options)) (*UpgradeLensReviewOutput, error) { + if params == nil { + params = &UpgradeLensReviewInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpgradeLensReview", params, optFns, addOperationUpgradeLensReviewMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpgradeLensReviewOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpgradeLensReviewInput struct { + + // The alias of the lens, for example, serverless. Each lens is identified by its + // LensSummary$LensAlias. + // + // This member is required. + LensAlias *string + + // The name of the milestone in a workload. Milestone names must be unique within a + // workload. + // + // This member is required. + MilestoneName *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + // + // This member is required. + WorkloadId *string + + // A unique case-sensitive string used to ensure that this request is idempotent + // (executes only once). You should not reuse the same token for other requests. If + // you retry a request with the same client request token and the same parameters + // after it has completed successfully, the result of the original request is + // returned. This token is listed as required, however, if you do not specify it, + // the AWS SDKs automatically generate one for you. If you are not using the AWS + // SDK or the AWS CLI, you must provide this token or the request will fail. + ClientRequestToken *string +} + +type UpgradeLensReviewOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationUpgradeLensReviewMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpgradeLensReview{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpgradeLensReview{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpgradeLensReviewValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpgradeLensReview(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opUpgradeLensReview(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "wellarchitected", + OperationName: "UpgradeLensReview", + } +} diff --git a/service/wellarchitected/deserializers.go b/service/wellarchitected/deserializers.go new file mode 100644 index 00000000000..eb341d36d7b --- /dev/null +++ b/service/wellarchitected/deserializers.go @@ -0,0 +1,7707 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/wellarchitected/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_deserializeOpAssociateLenses struct { +} + +func (*awsRestjson1_deserializeOpAssociateLenses) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpAssociateLenses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorAssociateLenses(response, &metadata) + } + output := &AssociateLensesOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorAssociateLenses(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpCreateMilestone struct { +} + +func (*awsRestjson1_deserializeOpCreateMilestone) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateMilestone) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateMilestone(response, &metadata) + } + output := &CreateMilestoneOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateMilestoneOutput(&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_deserializeOpErrorCreateMilestone(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateMilestoneOutput(v **CreateMilestoneOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateMilestoneOutput + if *v == nil { + sv = &CreateMilestoneOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MilestoneNumber": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MilestoneNumber = int32(i64) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateWorkload struct { +} + +func (*awsRestjson1_deserializeOpCreateWorkload) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateWorkload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateWorkload(response, &metadata) + } + output := &CreateWorkloadOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateWorkloadOutput(&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_deserializeOpErrorCreateWorkload(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateWorkloadOutput(v **CreateWorkloadOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateWorkloadOutput + if *v == nil { + sv = &CreateWorkloadOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "WorkloadArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadArn to be of type string, got %T instead", value) + } + sv.WorkloadArn = ptr.String(jtv) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateWorkloadShare struct { +} + +func (*awsRestjson1_deserializeOpCreateWorkloadShare) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateWorkloadShare) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateWorkloadShare(response, &metadata) + } + output := &CreateWorkloadShareOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateWorkloadShareOutput(&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_deserializeOpErrorCreateWorkloadShare(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateWorkloadShareOutput(v **CreateWorkloadShareOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateWorkloadShareOutput + if *v == nil { + sv = &CreateWorkloadShareOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ShareId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ShareId to be of type string, got %T instead", value) + } + sv.ShareId = ptr.String(jtv) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteWorkload struct { +} + +func (*awsRestjson1_deserializeOpDeleteWorkload) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteWorkload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteWorkload(response, &metadata) + } + output := &DeleteWorkloadOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteWorkload(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteWorkloadShare struct { +} + +func (*awsRestjson1_deserializeOpDeleteWorkloadShare) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteWorkloadShare) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteWorkloadShare(response, &metadata) + } + output := &DeleteWorkloadShareOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteWorkloadShare(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDisassociateLenses struct { +} + +func (*awsRestjson1_deserializeOpDisassociateLenses) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDisassociateLenses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDisassociateLenses(response, &metadata) + } + output := &DisassociateLensesOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDisassociateLenses(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpGetAnswer struct { +} + +func (*awsRestjson1_deserializeOpGetAnswer) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetAnswer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetAnswer(response, &metadata) + } + output := &GetAnswerOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetAnswerOutput(&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_deserializeOpErrorGetAnswer(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetAnswerOutput(v **GetAnswerOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetAnswerOutput + if *v == nil { + sv = &GetAnswerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Answer": + if err := awsRestjson1_deserializeDocumentAnswer(&sv.Answer, value); err != nil { + return err + } + + case "LensAlias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) + } + sv.LensAlias = ptr.String(jtv) + } + + case "MilestoneNumber": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MilestoneNumber = int32(i64) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetLensReview struct { +} + +func (*awsRestjson1_deserializeOpGetLensReview) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetLensReview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetLensReview(response, &metadata) + } + output := &GetLensReviewOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetLensReviewOutput(&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_deserializeOpErrorGetLensReview(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetLensReviewOutput(v **GetLensReviewOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetLensReviewOutput + if *v == nil { + sv = &GetLensReviewOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LensReview": + if err := awsRestjson1_deserializeDocumentLensReview(&sv.LensReview, value); err != nil { + return err + } + + case "MilestoneNumber": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MilestoneNumber = int32(i64) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetLensReviewReport struct { +} + +func (*awsRestjson1_deserializeOpGetLensReviewReport) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetLensReviewReport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetLensReviewReport(response, &metadata) + } + output := &GetLensReviewReportOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetLensReviewReportOutput(&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_deserializeOpErrorGetLensReviewReport(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetLensReviewReportOutput(v **GetLensReviewReportOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetLensReviewReportOutput + if *v == nil { + sv = &GetLensReviewReportOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LensReviewReport": + if err := awsRestjson1_deserializeDocumentLensReviewReport(&sv.LensReviewReport, value); err != nil { + return err + } + + case "MilestoneNumber": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MilestoneNumber = int32(i64) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetLensVersionDifference struct { +} + +func (*awsRestjson1_deserializeOpGetLensVersionDifference) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetLensVersionDifference) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetLensVersionDifference(response, &metadata) + } + output := &GetLensVersionDifferenceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetLensVersionDifferenceOutput(&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_deserializeOpErrorGetLensVersionDifference(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetLensVersionDifferenceOutput(v **GetLensVersionDifferenceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetLensVersionDifferenceOutput + if *v == nil { + sv = &GetLensVersionDifferenceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BaseLensVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) + } + sv.BaseLensVersion = ptr.String(jtv) + } + + case "LatestLensVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) + } + sv.LatestLensVersion = ptr.String(jtv) + } + + case "LensAlias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) + } + sv.LensAlias = ptr.String(jtv) + } + + case "VersionDifferences": + if err := awsRestjson1_deserializeDocumentVersionDifferences(&sv.VersionDifferences, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetMilestone struct { +} + +func (*awsRestjson1_deserializeOpGetMilestone) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetMilestone) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetMilestone(response, &metadata) + } + output := &GetMilestoneOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetMilestoneOutput(&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_deserializeOpErrorGetMilestone(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetMilestoneOutput(v **GetMilestoneOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetMilestoneOutput + if *v == nil { + sv = &GetMilestoneOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Milestone": + if err := awsRestjson1_deserializeDocumentMilestone(&sv.Milestone, value); err != nil { + return err + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetWorkload struct { +} + +func (*awsRestjson1_deserializeOpGetWorkload) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetWorkload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetWorkload(response, &metadata) + } + output := &GetWorkloadOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetWorkloadOutput(&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_deserializeOpErrorGetWorkload(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetWorkloadOutput(v **GetWorkloadOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetWorkloadOutput + if *v == nil { + sv = &GetWorkloadOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Workload": + if err := awsRestjson1_deserializeDocumentWorkload(&sv.Workload, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListAnswers struct { +} + +func (*awsRestjson1_deserializeOpListAnswers) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListAnswers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListAnswers(response, &metadata) + } + output := &ListAnswersOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListAnswersOutput(&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_deserializeOpErrorListAnswers(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListAnswersOutput(v **ListAnswersOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListAnswersOutput + if *v == nil { + sv = &ListAnswersOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AnswerSummaries": + if err := awsRestjson1_deserializeDocumentAnswerSummaries(&sv.AnswerSummaries, value); err != nil { + return err + } + + case "LensAlias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) + } + sv.LensAlias = ptr.String(jtv) + } + + case "MilestoneNumber": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MilestoneNumber = int32(i64) + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListLenses struct { +} + +func (*awsRestjson1_deserializeOpListLenses) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListLenses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListLenses(response, &metadata) + } + output := &ListLensesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListLensesOutput(&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_deserializeOpErrorListLenses(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListLensesOutput(v **ListLensesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListLensesOutput + if *v == nil { + sv = &ListLensesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LensSummaries": + if err := awsRestjson1_deserializeDocumentLensSummaries(&sv.LensSummaries, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListLensReviewImprovements struct { +} + +func (*awsRestjson1_deserializeOpListLensReviewImprovements) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListLensReviewImprovements) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListLensReviewImprovements(response, &metadata) + } + output := &ListLensReviewImprovementsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListLensReviewImprovementsOutput(&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_deserializeOpErrorListLensReviewImprovements(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListLensReviewImprovementsOutput(v **ListLensReviewImprovementsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListLensReviewImprovementsOutput + if *v == nil { + sv = &ListLensReviewImprovementsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ImprovementSummaries": + if err := awsRestjson1_deserializeDocumentImprovementSummaries(&sv.ImprovementSummaries, value); err != nil { + return err + } + + case "LensAlias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) + } + sv.LensAlias = ptr.String(jtv) + } + + case "MilestoneNumber": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MilestoneNumber = int32(i64) + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListLensReviews struct { +} + +func (*awsRestjson1_deserializeOpListLensReviews) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListLensReviews) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListLensReviews(response, &metadata) + } + output := &ListLensReviewsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListLensReviewsOutput(&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_deserializeOpErrorListLensReviews(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListLensReviewsOutput(v **ListLensReviewsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListLensReviewsOutput + if *v == nil { + sv = &ListLensReviewsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LensReviewSummaries": + if err := awsRestjson1_deserializeDocumentLensReviewSummaries(&sv.LensReviewSummaries, value); err != nil { + return err + } + + case "MilestoneNumber": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MilestoneNumber = int32(i64) + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListMilestones struct { +} + +func (*awsRestjson1_deserializeOpListMilestones) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListMilestones) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListMilestones(response, &metadata) + } + output := &ListMilestonesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListMilestonesOutput(&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_deserializeOpErrorListMilestones(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListMilestonesOutput(v **ListMilestonesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListMilestonesOutput + if *v == nil { + sv = &ListMilestonesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MilestoneSummaries": + if err := awsRestjson1_deserializeDocumentMilestoneSummaries(&sv.MilestoneSummaries, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListNotifications struct { +} + +func (*awsRestjson1_deserializeOpListNotifications) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListNotifications) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListNotifications(response, &metadata) + } + output := &ListNotificationsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListNotificationsOutput(&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_deserializeOpErrorListNotifications(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListNotificationsOutput(v **ListNotificationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListNotificationsOutput + if *v == nil { + sv = &ListNotificationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "NotificationSummaries": + if err := awsRestjson1_deserializeDocumentNotificationSummaries(&sv.NotificationSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListShareInvitations struct { +} + +func (*awsRestjson1_deserializeOpListShareInvitations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListShareInvitations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListShareInvitations(response, &metadata) + } + output := &ListShareInvitationsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListShareInvitationsOutput(&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_deserializeOpErrorListShareInvitations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListShareInvitationsOutput(v **ListShareInvitationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListShareInvitationsOutput + if *v == nil { + sv = &ListShareInvitationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "ShareInvitationSummaries": + if err := awsRestjson1_deserializeDocumentShareInvitationSummaries(&sv.ShareInvitationSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListWorkloads struct { +} + +func (*awsRestjson1_deserializeOpListWorkloads) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListWorkloads) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListWorkloads(response, &metadata) + } + output := &ListWorkloadsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListWorkloadsOutput(&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_deserializeOpErrorListWorkloads(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListWorkloadsOutput(v **ListWorkloadsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListWorkloadsOutput + if *v == nil { + sv = &ListWorkloadsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "WorkloadSummaries": + if err := awsRestjson1_deserializeDocumentWorkloadSummaries(&sv.WorkloadSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListWorkloadShares struct { +} + +func (*awsRestjson1_deserializeOpListWorkloadShares) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListWorkloadShares) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListWorkloadShares(response, &metadata) + } + output := &ListWorkloadSharesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListWorkloadSharesOutput(&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_deserializeOpErrorListWorkloadShares(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListWorkloadSharesOutput(v **ListWorkloadSharesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListWorkloadSharesOutput + if *v == nil { + sv = &ListWorkloadSharesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + case "WorkloadShareSummaries": + if err := awsRestjson1_deserializeDocumentWorkloadShareSummaries(&sv.WorkloadShareSummaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateAnswer struct { +} + +func (*awsRestjson1_deserializeOpUpdateAnswer) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateAnswer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateAnswer(response, &metadata) + } + output := &UpdateAnswerOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentUpdateAnswerOutput(&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_deserializeOpErrorUpdateAnswer(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateAnswerOutput(v **UpdateAnswerOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateAnswerOutput + if *v == nil { + sv = &UpdateAnswerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Answer": + if err := awsRestjson1_deserializeDocumentAnswer(&sv.Answer, value); err != nil { + return err + } + + case "LensAlias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) + } + sv.LensAlias = ptr.String(jtv) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateLensReview struct { +} + +func (*awsRestjson1_deserializeOpUpdateLensReview) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateLensReview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateLensReview(response, &metadata) + } + output := &UpdateLensReviewOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentUpdateLensReviewOutput(&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_deserializeOpErrorUpdateLensReview(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateLensReviewOutput(v **UpdateLensReviewOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateLensReviewOutput + if *v == nil { + sv = &UpdateLensReviewOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LensReview": + if err := awsRestjson1_deserializeDocumentLensReview(&sv.LensReview, value); err != nil { + return err + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateShareInvitation struct { +} + +func (*awsRestjson1_deserializeOpUpdateShareInvitation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateShareInvitation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateShareInvitation(response, &metadata) + } + output := &UpdateShareInvitationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentUpdateShareInvitationOutput(&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_deserializeOpErrorUpdateShareInvitation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateShareInvitationOutput(v **UpdateShareInvitationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateShareInvitationOutput + if *v == nil { + sv = &UpdateShareInvitationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ShareInvitation": + if err := awsRestjson1_deserializeDocumentShareInvitation(&sv.ShareInvitation, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateWorkload struct { +} + +func (*awsRestjson1_deserializeOpUpdateWorkload) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateWorkload) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateWorkload(response, &metadata) + } + output := &UpdateWorkloadOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentUpdateWorkloadOutput(&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_deserializeOpErrorUpdateWorkload(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateWorkloadOutput(v **UpdateWorkloadOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateWorkloadOutput + if *v == nil { + sv = &UpdateWorkloadOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Workload": + if err := awsRestjson1_deserializeDocumentWorkload(&sv.Workload, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateWorkloadShare struct { +} + +func (*awsRestjson1_deserializeOpUpdateWorkloadShare) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateWorkloadShare) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateWorkloadShare(response, &metadata) + } + output := &UpdateWorkloadShareOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentUpdateWorkloadShareOutput(&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_deserializeOpErrorUpdateWorkloadShare(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateWorkloadShareOutput(v **UpdateWorkloadShareOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateWorkloadShareOutput + if *v == nil { + sv = &UpdateWorkloadShareOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + case "WorkloadShare": + if err := awsRestjson1_deserializeDocumentWorkloadShare(&sv.WorkloadShare, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpgradeLensReview struct { +} + +func (*awsRestjson1_deserializeOpUpgradeLensReview) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpgradeLensReview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpgradeLensReview(response, &metadata) + } + output := &UpgradeLensReviewOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpgradeLensReview(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_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_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceQuotaExceededException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_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_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 ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAnswer(v **types.Answer, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Answer + if *v == nil { + sv = &types.Answer{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Choices": + if err := awsRestjson1_deserializeDocumentChoices(&sv.Choices, value); err != nil { + return err + } + + case "HelpfulResourceUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected HelpfulResourceUrl to be of type string, got %T instead", value) + } + sv.HelpfulResourceUrl = ptr.String(jtv) + } + + case "ImprovementPlanUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImprovementPlanUrl to be of type string, got %T instead", value) + } + sv.ImprovementPlanUrl = ptr.String(jtv) + } + + case "IsApplicable": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected IsApplicable to be of type *bool, got %T instead", value) + } + sv.IsApplicable = jtv + } + + case "Notes": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Notes to be of type string, got %T instead", value) + } + sv.Notes = ptr.String(jtv) + } + + case "PillarId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) + } + sv.PillarId = ptr.String(jtv) + } + + case "QuestionDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionDescription to be of type string, got %T instead", value) + } + sv.QuestionDescription = ptr.String(jtv) + } + + case "QuestionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionId to be of type string, got %T instead", value) + } + sv.QuestionId = ptr.String(jtv) + } + + case "QuestionTitle": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionTitle to be of type string, got %T instead", value) + } + sv.QuestionTitle = ptr.String(jtv) + } + + case "Risk": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Risk to be of type string, got %T instead", value) + } + sv.Risk = types.Risk(jtv) + } + + case "SelectedChoices": + if err := awsRestjson1_deserializeDocumentSelectedChoices(&sv.SelectedChoices, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAnswerSummaries(v *[]types.AnswerSummary, 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.AnswerSummary + if *v == nil { + cv = []types.AnswerSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AnswerSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAnswerSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAnswerSummary(v **types.AnswerSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AnswerSummary + if *v == nil { + sv = &types.AnswerSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Choices": + if err := awsRestjson1_deserializeDocumentChoices(&sv.Choices, value); err != nil { + return err + } + + case "IsApplicable": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected IsApplicable to be of type *bool, got %T instead", value) + } + sv.IsApplicable = jtv + } + + case "PillarId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) + } + sv.PillarId = ptr.String(jtv) + } + + case "QuestionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionId to be of type string, got %T instead", value) + } + sv.QuestionId = ptr.String(jtv) + } + + case "QuestionTitle": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionTitle to be of type string, got %T instead", value) + } + sv.QuestionTitle = ptr.String(jtv) + } + + case "Risk": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Risk to be of type string, got %T instead", value) + } + sv.Risk = types.Risk(jtv) + } + + case "SelectedChoices": + if err := awsRestjson1_deserializeDocumentSelectedChoices(&sv.SelectedChoices, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentChoice(v **types.Choice, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Choice + if *v == nil { + sv = &types.Choice{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ChoiceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ChoiceId to be of type string, got %T instead", value) + } + sv.ChoiceId = ptr.String(jtv) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ChoiceDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "Title": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ChoiceTitle to be of type string, got %T instead", value) + } + sv.Title = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentChoices(v *[]types.Choice, 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.Choice + if *v == nil { + cv = []types.Choice{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Choice + destAddr := &col + if err := awsRestjson1_deserializeDocumentChoice(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "ResourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionResourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "ResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentImprovementSummaries(v *[]types.ImprovementSummary, 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.ImprovementSummary + if *v == nil { + cv = []types.ImprovementSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ImprovementSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentImprovementSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentImprovementSummary(v **types.ImprovementSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ImprovementSummary + if *v == nil { + sv = &types.ImprovementSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ImprovementPlanUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ImprovementPlanUrl to be of type string, got %T instead", value) + } + sv.ImprovementPlanUrl = ptr.String(jtv) + } + + case "PillarId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) + } + sv.PillarId = ptr.String(jtv) + } + + case "QuestionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionId to be of type string, got %T instead", value) + } + sv.QuestionId = ptr.String(jtv) + } + + case "QuestionTitle": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionTitle to be of type string, got %T instead", value) + } + sv.QuestionTitle = ptr.String(jtv) + } + + case "Risk": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Risk to be of type string, got %T instead", value) + } + sv.Risk = types.Risk(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 ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLensReview(v **types.LensReview, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LensReview + if *v == nil { + sv = &types.LensReview{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LensAlias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) + } + sv.LensAlias = ptr.String(jtv) + } + + case "LensName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensName to be of type string, got %T instead", value) + } + sv.LensName = ptr.String(jtv) + } + + case "LensStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensStatus to be of type string, got %T instead", value) + } + sv.LensStatus = types.LensStatus(jtv) + } + + case "LensVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) + } + sv.LensVersion = ptr.String(jtv) + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "Notes": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Notes to be of type string, got %T instead", value) + } + sv.Notes = ptr.String(jtv) + } + + case "PillarReviewSummaries": + if err := awsRestjson1_deserializeDocumentPillarReviewSummaries(&sv.PillarReviewSummaries, value); err != nil { + return err + } + + case "RiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { + return err + } + + case "UpdatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLensReviewReport(v **types.LensReviewReport, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LensReviewReport + if *v == nil { + sv = &types.LensReviewReport{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Base64String": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Base64String to be of type string, got %T instead", value) + } + sv.Base64String = ptr.String(jtv) + } + + case "LensAlias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) + } + sv.LensAlias = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLensReviewSummaries(v *[]types.LensReviewSummary, 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.LensReviewSummary + if *v == nil { + cv = []types.LensReviewSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LensReviewSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentLensReviewSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentLensReviewSummary(v **types.LensReviewSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LensReviewSummary + if *v == nil { + sv = &types.LensReviewSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LensAlias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) + } + sv.LensAlias = ptr.String(jtv) + } + + case "LensName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensName to be of type string, got %T instead", value) + } + sv.LensName = ptr.String(jtv) + } + + case "LensStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensStatus to be of type string, got %T instead", value) + } + sv.LensStatus = types.LensStatus(jtv) + } + + case "LensVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) + } + sv.LensVersion = ptr.String(jtv) + } + + case "RiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { + return err + } + + case "UpdatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLensSummaries(v *[]types.LensSummary, 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.LensSummary + if *v == nil { + cv = []types.LensSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LensSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentLensSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentLensSummary(v **types.LensSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LensSummary + if *v == nil { + sv = &types.LensSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "LensAlias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) + } + sv.LensAlias = ptr.String(jtv) + } + + case "LensName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensName to be of type string, got %T instead", value) + } + sv.LensName = ptr.String(jtv) + } + + case "LensVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) + } + sv.LensVersion = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLensUpgradeSummary(v **types.LensUpgradeSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.LensUpgradeSummary + if *v == nil { + sv = &types.LensUpgradeSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CurrentLensVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) + } + sv.CurrentLensVersion = ptr.String(jtv) + } + + case "LatestLensVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensVersion to be of type string, got %T instead", value) + } + sv.LatestLensVersion = ptr.String(jtv) + } + + case "LensAlias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LensAlias to be of type string, got %T instead", value) + } + sv.LensAlias = ptr.String(jtv) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + case "WorkloadName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadName to be of type string, got %T instead", value) + } + sv.WorkloadName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentMilestone(v **types.Milestone, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Milestone + if *v == nil { + sv = &types.Milestone{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MilestoneName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MilestoneName to be of type string, got %T instead", value) + } + sv.MilestoneName = ptr.String(jtv) + } + + case "MilestoneNumber": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MilestoneNumber = int32(i64) + } + + case "RecordedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.RecordedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "Workload": + if err := awsRestjson1_deserializeDocumentWorkload(&sv.Workload, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentMilestoneSummaries(v *[]types.MilestoneSummary, 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.MilestoneSummary + if *v == nil { + cv = []types.MilestoneSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.MilestoneSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentMilestoneSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentMilestoneSummary(v **types.MilestoneSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.MilestoneSummary + if *v == nil { + sv = &types.MilestoneSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MilestoneName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MilestoneName to be of type string, got %T instead", value) + } + sv.MilestoneName = ptr.String(jtv) + } + + case "MilestoneNumber": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected MilestoneNumber to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MilestoneNumber = int32(i64) + } + + case "RecordedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.RecordedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "WorkloadSummary": + if err := awsRestjson1_deserializeDocumentWorkloadSummary(&sv.WorkloadSummary, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentNotificationSummaries(v *[]types.NotificationSummary, 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.NotificationSummary + if *v == nil { + cv = []types.NotificationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.NotificationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentNotificationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentNotificationSummary(v **types.NotificationSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.NotificationSummary + if *v == nil { + sv = &types.NotificationSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LensUpgradeSummary": + if err := awsRestjson1_deserializeDocumentLensUpgradeSummary(&sv.LensUpgradeSummary, value); err != nil { + return err + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationType to be of type string, got %T instead", value) + } + sv.Type = types.NotificationType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPillarDifference(v **types.PillarDifference, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PillarDifference + if *v == nil { + sv = &types.PillarDifference{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DifferenceStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DifferenceStatus to be of type string, got %T instead", value) + } + sv.DifferenceStatus = types.DifferenceStatus(jtv) + } + + case "PillarId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) + } + sv.PillarId = ptr.String(jtv) + } + + case "QuestionDifferences": + if err := awsRestjson1_deserializeDocumentQuestionDifferences(&sv.QuestionDifferences, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPillarDifferences(v *[]types.PillarDifference, 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.PillarDifference + if *v == nil { + cv = []types.PillarDifference{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PillarDifference + destAddr := &col + if err := awsRestjson1_deserializeDocumentPillarDifference(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPillarReviewSummaries(v *[]types.PillarReviewSummary, 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.PillarReviewSummary + if *v == nil { + cv = []types.PillarReviewSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PillarReviewSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentPillarReviewSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPillarReviewSummary(v **types.PillarReviewSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.PillarReviewSummary + if *v == nil { + sv = &types.PillarReviewSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Notes": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Notes to be of type string, got %T instead", value) + } + sv.Notes = ptr.String(jtv) + } + + case "PillarId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PillarId to be of type string, got %T instead", value) + } + sv.PillarId = ptr.String(jtv) + } + + case "PillarName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PillarName to be of type string, got %T instead", value) + } + sv.PillarName = ptr.String(jtv) + } + + case "RiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentQuestionDifference(v **types.QuestionDifference, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.QuestionDifference + if *v == nil { + sv = &types.QuestionDifference{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DifferenceStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DifferenceStatus to be of type string, got %T instead", value) + } + sv.DifferenceStatus = types.DifferenceStatus(jtv) + } + + case "QuestionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionId to be of type string, got %T instead", value) + } + sv.QuestionId = ptr.String(jtv) + } + + case "QuestionTitle": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuestionTitle to be of type string, got %T instead", value) + } + sv.QuestionTitle = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentQuestionDifferences(v *[]types.QuestionDifference, 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.QuestionDifference + if *v == nil { + cv = []types.QuestionDifference{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.QuestionDifference + destAddr := &col + if err := awsRestjson1_deserializeDocumentQuestionDifference(&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 ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "ResourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionResourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "ResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRiskCounts(v *map[string]int32, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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]int32 + if *v == nil { + mv = map[string]int32{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal int32 + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Count to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + parsedVal = int32(i64) + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentSelectedChoices(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 ChoiceId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ServiceQuotaExceededException + if *v == nil { + sv = &types.ServiceQuotaExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "QuotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuotaCode to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "ResourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionResourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "ResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + case "ServiceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceCode to be of type string, got %T instead", value) + } + sv.ServiceCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentShareInvitation(v **types.ShareInvitation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ShareInvitation + if *v == nil { + sv = &types.ShareInvitation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ShareInvitationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ShareInvitationId to be of type string, got %T instead", value) + } + sv.ShareInvitationId = ptr.String(jtv) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentShareInvitationSummaries(v *[]types.ShareInvitationSummary, 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.ShareInvitationSummary + if *v == nil { + cv = []types.ShareInvitationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ShareInvitationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentShareInvitationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentShareInvitationSummary(v **types.ShareInvitationSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ShareInvitationSummary + if *v == nil { + sv = &types.ShareInvitationSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PermissionType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PermissionType to be of type string, got %T instead", value) + } + sv.PermissionType = types.PermissionType(jtv) + } + + case "SharedBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) + } + sv.SharedBy = ptr.String(jtv) + } + + case "SharedWith": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SharedWith to be of type string, got %T instead", value) + } + sv.SharedWith = ptr.String(jtv) + } + + case "ShareInvitationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ShareInvitationId to be of type string, got %T instead", value) + } + sv.ShareInvitationId = ptr.String(jtv) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + case "WorkloadName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadName to be of type string, got %T instead", value) + } + sv.WorkloadName = 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 ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "QuotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuotaCode to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "ServiceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceCode to be of type string, got %T instead", value) + } + sv.ServiceCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Fields": + if err := awsRestjson1_deserializeDocumentValidationExceptionFieldList(&sv.Fields, value); err != nil { + return err + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "Reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value) + } + sv.Reason = types.ValidationExceptionReason(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationExceptionField + if *v == nil { + sv = &types.ValidationExceptionField{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValidationExceptionFieldName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.ValidationExceptionField + if *v == nil { + cv = []types.ValidationExceptionField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ValidationExceptionField + destAddr := &col + if err := awsRestjson1_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentVersionDifferences(v **types.VersionDifferences, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.VersionDifferences + if *v == nil { + sv = &types.VersionDifferences{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PillarDifferences": + if err := awsRestjson1_deserializeDocumentPillarDifferences(&sv.PillarDifferences, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentWorkload(v **types.Workload, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Workload + if *v == nil { + sv = &types.Workload{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AccountIds": + if err := awsRestjson1_deserializeDocumentWorkloadAccountIds(&sv.AccountIds, value); err != nil { + return err + } + + case "ArchitecturalDesign": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadArchitecturalDesign to be of type string, got %T instead", value) + } + sv.ArchitecturalDesign = ptr.String(jtv) + } + + case "AwsRegions": + if err := awsRestjson1_deserializeDocumentWorkloadAwsRegions(&sv.AwsRegions, value); err != nil { + return err + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "Environment": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadEnvironment to be of type string, got %T instead", value) + } + sv.Environment = types.WorkloadEnvironment(jtv) + } + + case "ImprovementStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadImprovementStatus to be of type string, got %T instead", value) + } + sv.ImprovementStatus = types.WorkloadImprovementStatus(jtv) + } + + case "Industry": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadIndustry to be of type string, got %T instead", value) + } + sv.Industry = ptr.String(jtv) + } + + case "IndustryType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadIndustryType to be of type string, got %T instead", value) + } + sv.IndustryType = ptr.String(jtv) + } + + case "IsReviewOwnerUpdateAcknowledged": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected IsReviewOwnerUpdateAcknowledged to be of type *bool, got %T instead", value) + } + sv.IsReviewOwnerUpdateAcknowledged = jtv + } + + case "Lenses": + if err := awsRestjson1_deserializeDocumentWorkloadLenses(&sv.Lenses, value); err != nil { + return err + } + + case "NonAwsRegions": + if err := awsRestjson1_deserializeDocumentWorkloadNonAwsRegions(&sv.NonAwsRegions, value); err != nil { + return err + } + + case "Notes": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Notes to be of type string, got %T instead", value) + } + sv.Notes = ptr.String(jtv) + } + + case "Owner": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) + } + sv.Owner = ptr.String(jtv) + } + + case "PillarPriorities": + if err := awsRestjson1_deserializeDocumentWorkloadPillarPriorities(&sv.PillarPriorities, value); err != nil { + return err + } + + case "ReviewOwner": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadReviewOwner to be of type string, got %T instead", value) + } + sv.ReviewOwner = ptr.String(jtv) + } + + case "ReviewRestrictionDate": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ReviewRestrictionDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "RiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { + return err + } + + case "ShareInvitationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ShareInvitationId to be of type string, got %T instead", value) + } + sv.ShareInvitationId = ptr.String(jtv) + } + + case "UpdatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "WorkloadArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadArn to be of type string, got %T instead", value) + } + sv.WorkloadArn = ptr.String(jtv) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + case "WorkloadName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadName to be of type string, got %T instead", value) + } + sv.WorkloadName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentWorkloadAccountIds(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 AwsAccountId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentWorkloadAwsRegions(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 AwsRegion to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentWorkloadLenses(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 LensAlias to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentWorkloadNonAwsRegions(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 WorkloadNonAwsRegion to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentWorkloadPillarPriorities(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 PillarId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentWorkloadShare(v **types.WorkloadShare, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.WorkloadShare + if *v == nil { + sv = &types.WorkloadShare{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PermissionType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PermissionType to be of type string, got %T instead", value) + } + sv.PermissionType = types.PermissionType(jtv) + } + + case "SharedBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) + } + sv.SharedBy = ptr.String(jtv) + } + + case "SharedWith": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SharedWith to be of type string, got %T instead", value) + } + sv.SharedWith = ptr.String(jtv) + } + + case "ShareId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ShareId to be of type string, got %T instead", value) + } + sv.ShareId = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ShareStatus to be of type string, got %T instead", value) + } + sv.Status = types.ShareStatus(jtv) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + case "WorkloadName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadName to be of type string, got %T instead", value) + } + sv.WorkloadName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentWorkloadShareSummaries(v *[]types.WorkloadShareSummary, 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.WorkloadShareSummary + if *v == nil { + cv = []types.WorkloadShareSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.WorkloadShareSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentWorkloadShareSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentWorkloadShareSummary(v **types.WorkloadShareSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.WorkloadShareSummary + if *v == nil { + sv = &types.WorkloadShareSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PermissionType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PermissionType to be of type string, got %T instead", value) + } + sv.PermissionType = types.PermissionType(jtv) + } + + case "SharedWith": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SharedWith to be of type string, got %T instead", value) + } + sv.SharedWith = ptr.String(jtv) + } + + case "ShareId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ShareId to be of type string, got %T instead", value) + } + sv.ShareId = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ShareStatus to be of type string, got %T instead", value) + } + sv.Status = types.ShareStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentWorkloadSummaries(v *[]types.WorkloadSummary, 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.WorkloadSummary + if *v == nil { + cv = []types.WorkloadSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.WorkloadSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentWorkloadSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentWorkloadSummary(v **types.WorkloadSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.WorkloadSummary + if *v == nil { + sv = &types.WorkloadSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ImprovementStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadImprovementStatus to be of type string, got %T instead", value) + } + sv.ImprovementStatus = types.WorkloadImprovementStatus(jtv) + } + + case "Lenses": + if err := awsRestjson1_deserializeDocumentWorkloadLenses(&sv.Lenses, value); err != nil { + return err + } + + case "Owner": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) + } + sv.Owner = ptr.String(jtv) + } + + case "RiskCounts": + if err := awsRestjson1_deserializeDocumentRiskCounts(&sv.RiskCounts, value); err != nil { + return err + } + + case "UpdatedAt": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "WorkloadArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadArn to be of type string, got %T instead", value) + } + sv.WorkloadArn = ptr.String(jtv) + } + + case "WorkloadId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadId to be of type string, got %T instead", value) + } + sv.WorkloadId = ptr.String(jtv) + } + + case "WorkloadName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkloadName to be of type string, got %T instead", value) + } + sv.WorkloadName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/wellarchitected/doc.go b/service/wellarchitected/doc.go new file mode 100644 index 00000000000..e346a527c46 --- /dev/null +++ b/service/wellarchitected/doc.go @@ -0,0 +1,102 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package wellarchitected provides the API client, operations, and parameter types +// for AWS Well-Architected Tool. +// +// AWS Well-Architected Tool This is the AWS Well-Architected Tool API Reference. +// The AWS Well-Architected Tool API provides programmatic access to the AWS +// Well-Architected Tool (http://aws.amazon.com/well-architected-tool) in the AWS +// Management Console (https://console.aws.amazon.com/wellarchitected). Managing +// workloads: +// +// * CreateWorkload: Define a new workload. +// +// * ListWorkloads: List +// workloads. +// +// * GetWorkload: Get the properties of a workload. +// +// * UpdateWorkload: +// Update the properties of a workload. +// +// * DeleteWorkload: Delete a +// workload. +// +// Managing milestones: +// +// * CreateMilestone: Create a milestone. +// +// * +// ListMilestones: List milestones. +// +// * GetMilestone: Get the properties of a +// milestone. +// +// Managing lenses: +// +// * ListLenses: List the available lenses. +// +// * +// AssociateLenses: Add one or more lenses to a workload. +// +// * DisassociateLenses: +// Remove one or more lenses from a workload. +// +// * ListNotifications: List lens +// notifications for a workload. +// +// * GetLensVersionDifference: Get the differences +// between the version of a lens used in a workload and the latest version. +// +// * +// UpgradeLensReview: Upgrade a workload to use the latest version of a +// lens. +// +// Managing reviews: +// +// * ListLensReviews: List reviews associated with a +// workload. +// +// * GetLensReview: Get pillar and risk data associated with a workload +// review. +// +// * GetLensReviewReport: Get the report associated with a workload +// review. +// +// * UpdateLensReview: Update the notes associated with a workload +// review. +// +// * ListAnswers: List the questions and answers in a workload review. +// +// * +// UpdateAnswer: Update the answer to a specific question in a workload review. +// +// * +// ListLensReviewImprovements: List the improvement plan associated with a workload +// review. +// +// Managing workload shares: +// +// * ListWorkloadShares: List the workload +// shares associated with a workload. +// +// * CreateWorkloadShare: Create a workload +// share. +// +// * UpdateWorkloadShare: Update a workload share. +// +// * DeleteWorkloadShare: +// Delete a workload share. +// +// Managing workload share invitations: +// +// * +// ListShareInvitations: List workload share invitations. +// +// * UpdateShareInvitation: +// Update a workload share invitation. +// +// For information about the AWS +// Well-Architected Tool, see the AWS Well-Architected Tool User Guide +// (https://docs.aws.amazon.com/wellarchitected/latest/userguide/intro.html). +package wellarchitected diff --git a/service/wellarchitected/endpoints.go b/service/wellarchitected/endpoints.go new file mode 100644 index 00000000000..7e2a7381903 --- /dev/null +++ b/service/wellarchitected/endpoints.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +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/wellarchitected/internal/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/url" +) + +// 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() +} + +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") + } + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), m.Options) + 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 = "wellarchitected" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + 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.EndpointResolver + 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) + 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) +} + +// 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. +// awsResolver and fallbackResolver must not be nil +func WithEndpointResolver(awsResolver aws.EndpointResolver, fallbackResolver EndpointResolver) EndpointResolver { + return &wrappedEndpointResolver{ + awsResolver: awsResolver, + resolver: fallbackResolver, + } +} diff --git a/service/wellarchitected/go.mod b/service/wellarchitected/go.mod new file mode 100644 index 00000000000..67e1816b0b5 --- /dev/null +++ b/service/wellarchitected/go.mod @@ -0,0 +1,10 @@ +module github.com/aws/aws-sdk-go-v2/service/wellarchitected + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v0.30.1-0.20201222223005-ee883de66531 + github.com/aws/smithy-go v0.4.1-0.20201222001052-74df8ddd8c79 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ diff --git a/service/wellarchitected/go.sum b/service/wellarchitected/go.sum new file mode 100644 index 00000000000..934e2b5c702 --- /dev/null +++ b/service/wellarchitected/go.sum @@ -0,0 +1,14 @@ +github.com/aws/smithy-go v0.4.1-0.20201222001052-74df8ddd8c79 h1:Ufuk/0gkbBZVZ7jlujsyzn5ruWhdTFBcZDCVIy60tsQ= +github.com/aws/smithy-go v0.4.1-0.20201222001052-74df8ddd8c79/go.mod h1:EzMw8dbp/YJL4A5/sbhGddag+NPT7q084agLbB9LgIw= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/wellarchitected/internal/endpoints/endpoints.go b/service/wellarchitected/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..fb0e13ab1af --- /dev/null +++ b/service/wellarchitected/internal/endpoints/endpoints.go @@ -0,0 +1,91 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + DisableHTTPS bool +} + +// Resolver WellArchitected 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 := endpoints.Options{ + DisableHTTPS: options.DisableHTTPS, + } + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: endpoints.Endpoint{ + Hostname: "wellarchitected.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-cn", + Defaults: endpoints.Endpoint{ + Hostname: "wellarchitected.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: endpoints.Endpoint{ + Hostname: "wellarchitected.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: endpoints.Endpoint{ + Hostname: "wellarchitected.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: endpoints.Endpoint{ + Hostname: "wellarchitected.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + RegionRegex: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), + IsRegionalized: true, + }, +} diff --git a/service/wellarchitected/internal/endpoints/endpoints_test.go b/service/wellarchitected/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/wellarchitected/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/wellarchitected/protocol_test.go b/service/wellarchitected/protocol_test.go new file mode 100644 index 00000000000..d9133d8893f --- /dev/null +++ b/service/wellarchitected/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected diff --git a/service/wellarchitected/serializers.go b/service/wellarchitected/serializers.go new file mode 100644 index 00000000000..d5087be2640 --- /dev/null +++ b/service/wellarchitected/serializers.go @@ -0,0 +1,2564 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "bytes" + "context" + "fmt" + 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_serializeOpAssociateLenses struct { +} + +func (*awsRestjson1_serializeOpAssociateLenses) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpAssociateLenses) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AssociateLensesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/associateLenses") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsAssociateLensesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentAssociateLensesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsAssociateLensesInput(v *AssociateLensesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentAssociateLensesInput(v *AssociateLensesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LensAliases != nil { + ok := object.Key("LensAliases") + if err := awsRestjson1_serializeDocumentLensAliases(v.LensAliases, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateMilestone struct { +} + +func (*awsRestjson1_serializeOpCreateMilestone) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateMilestone) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateMilestoneInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/milestones") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsCreateMilestoneInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateMilestoneInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateMilestoneInput(v *CreateMilestoneInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateMilestoneInput(v *CreateMilestoneInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.MilestoneName != nil { + ok := object.Key("MilestoneName") + ok.String(*v.MilestoneName) + } + + return nil +} + +type awsRestjson1_serializeOpCreateWorkload struct { +} + +func (*awsRestjson1_serializeOpCreateWorkload) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateWorkload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateWorkloadInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpDocumentCreateWorkloadInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateWorkloadInput(v *CreateWorkloadInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateWorkloadInput(v *CreateWorkloadInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountIds != nil { + ok := object.Key("AccountIds") + if err := awsRestjson1_serializeDocumentWorkloadAccountIds(v.AccountIds, ok); err != nil { + return err + } + } + + if v.ArchitecturalDesign != nil { + ok := object.Key("ArchitecturalDesign") + ok.String(*v.ArchitecturalDesign) + } + + if v.AwsRegions != nil { + ok := object.Key("AwsRegions") + if err := awsRestjson1_serializeDocumentWorkloadAwsRegions(v.AwsRegions, ok); err != nil { + return err + } + } + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if len(v.Environment) > 0 { + ok := object.Key("Environment") + ok.String(string(v.Environment)) + } + + if v.Industry != nil { + ok := object.Key("Industry") + ok.String(*v.Industry) + } + + if v.IndustryType != nil { + ok := object.Key("IndustryType") + ok.String(*v.IndustryType) + } + + if v.Lenses != nil { + ok := object.Key("Lenses") + if err := awsRestjson1_serializeDocumentWorkloadLenses(v.Lenses, ok); err != nil { + return err + } + } + + if v.NonAwsRegions != nil { + ok := object.Key("NonAwsRegions") + if err := awsRestjson1_serializeDocumentWorkloadNonAwsRegions(v.NonAwsRegions, ok); err != nil { + return err + } + } + + if v.Notes != nil { + ok := object.Key("Notes") + ok.String(*v.Notes) + } + + if v.PillarPriorities != nil { + ok := object.Key("PillarPriorities") + if err := awsRestjson1_serializeDocumentWorkloadPillarPriorities(v.PillarPriorities, ok); err != nil { + return err + } + } + + if v.ReviewOwner != nil { + ok := object.Key("ReviewOwner") + ok.String(*v.ReviewOwner) + } + + if v.WorkloadName != nil { + ok := object.Key("WorkloadName") + ok.String(*v.WorkloadName) + } + + return nil +} + +type awsRestjson1_serializeOpCreateWorkloadShare struct { +} + +func (*awsRestjson1_serializeOpCreateWorkloadShare) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateWorkloadShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateWorkloadShareInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/shares") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsCreateWorkloadShareInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateWorkloadShareInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsCreateWorkloadShareInput(v *CreateWorkloadShareInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateWorkloadShareInput(v *CreateWorkloadShareInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if len(v.PermissionType) > 0 { + ok := object.Key("PermissionType") + ok.String(string(v.PermissionType)) + } + + if v.SharedWith != nil { + ok := object.Key("SharedWith") + ok.String(*v.SharedWith) + } + + return nil +} + +type awsRestjson1_serializeOpDeleteWorkload struct { +} + +func (*awsRestjson1_serializeOpDeleteWorkload) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteWorkload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteWorkloadInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteWorkloadInput(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_serializeOpHttpBindingsDeleteWorkloadInput(v *DeleteWorkloadInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ClientRequestToken != nil { + encoder.SetQuery("ClientRequestToken").String(*v.ClientRequestToken) + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteWorkloadShare struct { +} + +func (*awsRestjson1_serializeOpDeleteWorkloadShare) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteWorkloadShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteWorkloadShareInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/shares/{ShareId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDeleteWorkloadShareInput(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_serializeOpHttpBindingsDeleteWorkloadShareInput(v *DeleteWorkloadShareInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ClientRequestToken != nil { + encoder.SetQuery("ClientRequestToken").String(*v.ClientRequestToken) + } + + if v.ShareId == nil || len(*v.ShareId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ShareId must not be empty")} + } + if v.ShareId != nil { + if err := encoder.SetURI("ShareId").String(*v.ShareId); err != nil { + return err + } + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDisassociateLenses struct { +} + +func (*awsRestjson1_serializeOpDisassociateLenses) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDisassociateLenses) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DisassociateLensesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/disassociateLenses") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsDisassociateLensesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDisassociateLensesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsDisassociateLensesInput(v *DisassociateLensesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDisassociateLensesInput(v *DisassociateLensesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LensAliases != nil { + ok := object.Key("LensAliases") + if err := awsRestjson1_serializeDocumentLensAliases(v.LensAliases, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetAnswer struct { +} + +func (*awsRestjson1_serializeOpGetAnswer) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetAnswer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetAnswerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/lensReviews/{LensAlias}/answers/{QuestionId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetAnswerInput(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_serializeOpHttpBindingsGetAnswerInput(v *GetAnswerInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.LensAlias == nil || len(*v.LensAlias) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member LensAlias must not be empty")} + } + if v.LensAlias != nil { + if err := encoder.SetURI("LensAlias").String(*v.LensAlias); err != nil { + return err + } + } + + if v.MilestoneNumber != 0 { + encoder.SetQuery("MilestoneNumber").Integer(v.MilestoneNumber) + } + + if v.QuestionId == nil || len(*v.QuestionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member QuestionId must not be empty")} + } + if v.QuestionId != nil { + if err := encoder.SetURI("QuestionId").String(*v.QuestionId); err != nil { + return err + } + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetLensReview struct { +} + +func (*awsRestjson1_serializeOpGetLensReview) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetLensReview) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetLensReviewInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/lensReviews/{LensAlias}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetLensReviewInput(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_serializeOpHttpBindingsGetLensReviewInput(v *GetLensReviewInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.LensAlias == nil || len(*v.LensAlias) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member LensAlias must not be empty")} + } + if v.LensAlias != nil { + if err := encoder.SetURI("LensAlias").String(*v.LensAlias); err != nil { + return err + } + } + + if v.MilestoneNumber != 0 { + encoder.SetQuery("MilestoneNumber").Integer(v.MilestoneNumber) + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetLensReviewReport struct { +} + +func (*awsRestjson1_serializeOpGetLensReviewReport) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetLensReviewReport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetLensReviewReportInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/lensReviews/{LensAlias}/report") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetLensReviewReportInput(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_serializeOpHttpBindingsGetLensReviewReportInput(v *GetLensReviewReportInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.LensAlias == nil || len(*v.LensAlias) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member LensAlias must not be empty")} + } + if v.LensAlias != nil { + if err := encoder.SetURI("LensAlias").String(*v.LensAlias); err != nil { + return err + } + } + + if v.MilestoneNumber != 0 { + encoder.SetQuery("MilestoneNumber").Integer(v.MilestoneNumber) + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetLensVersionDifference struct { +} + +func (*awsRestjson1_serializeOpGetLensVersionDifference) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetLensVersionDifference) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetLensVersionDifferenceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/lenses/{LensAlias}/versionDifference") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetLensVersionDifferenceInput(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_serializeOpHttpBindingsGetLensVersionDifferenceInput(v *GetLensVersionDifferenceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.BaseLensVersion != nil { + encoder.SetQuery("BaseLensVersion").String(*v.BaseLensVersion) + } + + if v.LensAlias == nil || len(*v.LensAlias) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member LensAlias must not be empty")} + } + if v.LensAlias != nil { + if err := encoder.SetURI("LensAlias").String(*v.LensAlias); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetMilestone struct { +} + +func (*awsRestjson1_serializeOpGetMilestone) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetMilestone) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetMilestoneInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/milestones/{MilestoneNumber}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetMilestoneInput(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_serializeOpHttpBindingsGetMilestoneInput(v *GetMilestoneInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MilestoneNumber == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member MilestoneNumber must not be empty")} + } + if v.MilestoneNumber != 0 { + if err := encoder.SetURI("MilestoneNumber").Integer(v.MilestoneNumber); err != nil { + return err + } + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetWorkload struct { +} + +func (*awsRestjson1_serializeOpGetWorkload) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetWorkload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetWorkloadInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsGetWorkloadInput(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_serializeOpHttpBindingsGetWorkloadInput(v *GetWorkloadInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListAnswers struct { +} + +func (*awsRestjson1_serializeOpListAnswers) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListAnswers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListAnswersInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/lensReviews/{LensAlias}/answers") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListAnswersInput(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_serializeOpHttpBindingsListAnswersInput(v *ListAnswersInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.LensAlias == nil || len(*v.LensAlias) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member LensAlias must not be empty")} + } + if v.LensAlias != nil { + if err := encoder.SetURI("LensAlias").String(*v.LensAlias); err != nil { + return err + } + } + + if v.MaxResults != 0 { + encoder.SetQuery("MaxResults").Integer(v.MaxResults) + } + + if v.MilestoneNumber != 0 { + encoder.SetQuery("MilestoneNumber").Integer(v.MilestoneNumber) + } + + if v.NextToken != nil { + encoder.SetQuery("NextToken").String(*v.NextToken) + } + + if v.PillarId != nil { + encoder.SetQuery("PillarId").String(*v.PillarId) + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListLenses struct { +} + +func (*awsRestjson1_serializeOpListLenses) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListLenses) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListLensesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/lenses") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListLensesInput(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_serializeOpHttpBindingsListLensesInput(v *ListLensesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != 0 { + encoder.SetQuery("MaxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("NextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListLensReviewImprovements struct { +} + +func (*awsRestjson1_serializeOpListLensReviewImprovements) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListLensReviewImprovements) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListLensReviewImprovementsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/lensReviews/{LensAlias}/improvements") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListLensReviewImprovementsInput(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_serializeOpHttpBindingsListLensReviewImprovementsInput(v *ListLensReviewImprovementsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.LensAlias == nil || len(*v.LensAlias) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member LensAlias must not be empty")} + } + if v.LensAlias != nil { + if err := encoder.SetURI("LensAlias").String(*v.LensAlias); err != nil { + return err + } + } + + if v.MaxResults != 0 { + encoder.SetQuery("MaxResults").Integer(v.MaxResults) + } + + if v.MilestoneNumber != 0 { + encoder.SetQuery("MilestoneNumber").Integer(v.MilestoneNumber) + } + + if v.NextToken != nil { + encoder.SetQuery("NextToken").String(*v.NextToken) + } + + if v.PillarId != nil { + encoder.SetQuery("PillarId").String(*v.PillarId) + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListLensReviews struct { +} + +func (*awsRestjson1_serializeOpListLensReviews) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListLensReviews) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListLensReviewsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/lensReviews") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListLensReviewsInput(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_serializeOpHttpBindingsListLensReviewsInput(v *ListLensReviewsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != 0 { + encoder.SetQuery("MaxResults").Integer(v.MaxResults) + } + + if v.MilestoneNumber != 0 { + encoder.SetQuery("MilestoneNumber").Integer(v.MilestoneNumber) + } + + if v.NextToken != nil { + encoder.SetQuery("NextToken").String(*v.NextToken) + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListMilestones struct { +} + +func (*awsRestjson1_serializeOpListMilestones) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListMilestones) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListMilestonesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/milestonesSummaries") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListMilestonesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListMilestonesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListMilestonesInput(v *ListMilestonesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListMilestonesInput(v *ListMilestonesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != 0 { + ok := object.Key("MaxResults") + ok.Integer(v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListNotifications struct { +} + +func (*awsRestjson1_serializeOpListNotifications) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListNotifications) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListNotificationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/notifications") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpDocumentListNotificationsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListNotificationsInput(v *ListNotificationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListNotificationsInput(v *ListNotificationsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != 0 { + ok := object.Key("MaxResults") + ok.Integer(v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.WorkloadId != nil { + ok := object.Key("WorkloadId") + ok.String(*v.WorkloadId) + } + + return nil +} + +type awsRestjson1_serializeOpListShareInvitations struct { +} + +func (*awsRestjson1_serializeOpListShareInvitations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListShareInvitations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListShareInvitationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/shareInvitations") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListShareInvitationsInput(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_serializeOpHttpBindingsListShareInvitationsInput(v *ListShareInvitationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != 0 { + encoder.SetQuery("MaxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("NextToken").String(*v.NextToken) + } + + if v.WorkloadNamePrefix != nil { + encoder.SetQuery("WorkloadNamePrefix").String(*v.WorkloadNamePrefix) + } + + return nil +} + +type awsRestjson1_serializeOpListWorkloads struct { +} + +func (*awsRestjson1_serializeOpListWorkloads) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListWorkloads) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListWorkloadsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloadsSummaries") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpDocumentListWorkloadsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsListWorkloadsInput(v *ListWorkloadsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListWorkloadsInput(v *ListWorkloadsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != 0 { + ok := object.Key("MaxResults") + ok.Integer(v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.WorkloadNamePrefix != nil { + ok := object.Key("WorkloadNamePrefix") + ok.String(*v.WorkloadNamePrefix) + } + + return nil +} + +type awsRestjson1_serializeOpListWorkloadShares struct { +} + +func (*awsRestjson1_serializeOpListWorkloadShares) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListWorkloadShares) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListWorkloadSharesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/shares") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsListWorkloadSharesInput(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_serializeOpHttpBindingsListWorkloadSharesInput(v *ListWorkloadSharesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != 0 { + encoder.SetQuery("MaxResults").Integer(v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("NextToken").String(*v.NextToken) + } + + if v.SharedWithPrefix != nil { + encoder.SetQuery("SharedWithPrefix").String(*v.SharedWithPrefix) + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateAnswer struct { +} + +func (*awsRestjson1_serializeOpUpdateAnswer) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateAnswer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateAnswerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/lensReviews/{LensAlias}/answers/{QuestionId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsUpdateAnswerInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateAnswerInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateAnswerInput(v *UpdateAnswerInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.LensAlias == nil || len(*v.LensAlias) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member LensAlias must not be empty")} + } + if v.LensAlias != nil { + if err := encoder.SetURI("LensAlias").String(*v.LensAlias); err != nil { + return err + } + } + + if v.QuestionId == nil || len(*v.QuestionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member QuestionId must not be empty")} + } + if v.QuestionId != nil { + if err := encoder.SetURI("QuestionId").String(*v.QuestionId); err != nil { + return err + } + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateAnswerInput(v *UpdateAnswerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.IsApplicable { + ok := object.Key("IsApplicable") + ok.Boolean(v.IsApplicable) + } + + if v.Notes != nil { + ok := object.Key("Notes") + ok.String(*v.Notes) + } + + if v.SelectedChoices != nil { + ok := object.Key("SelectedChoices") + if err := awsRestjson1_serializeDocumentSelectedChoices(v.SelectedChoices, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateLensReview struct { +} + +func (*awsRestjson1_serializeOpUpdateLensReview) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateLensReview) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateLensReviewInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/lensReviews/{LensAlias}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsUpdateLensReviewInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateLensReviewInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateLensReviewInput(v *UpdateLensReviewInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.LensAlias == nil || len(*v.LensAlias) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member LensAlias must not be empty")} + } + if v.LensAlias != nil { + if err := encoder.SetURI("LensAlias").String(*v.LensAlias); err != nil { + return err + } + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateLensReviewInput(v *UpdateLensReviewInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LensNotes != nil { + ok := object.Key("LensNotes") + ok.String(*v.LensNotes) + } + + if v.PillarNotes != nil { + ok := object.Key("PillarNotes") + if err := awsRestjson1_serializeDocumentPillarNotes(v.PillarNotes, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateShareInvitation struct { +} + +func (*awsRestjson1_serializeOpUpdateShareInvitation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateShareInvitation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateShareInvitationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/shareInvitations/{ShareInvitationId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsUpdateShareInvitationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateShareInvitationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateShareInvitationInput(v *UpdateShareInvitationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ShareInvitationId == nil || len(*v.ShareInvitationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ShareInvitationId must not be empty")} + } + if v.ShareInvitationId != nil { + if err := encoder.SetURI("ShareInvitationId").String(*v.ShareInvitationId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateShareInvitationInput(v *UpdateShareInvitationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.ShareInvitationAction) > 0 { + ok := object.Key("ShareInvitationAction") + ok.String(string(v.ShareInvitationAction)) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateWorkload struct { +} + +func (*awsRestjson1_serializeOpUpdateWorkload) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateWorkload) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateWorkloadInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsUpdateWorkloadInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateWorkloadInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateWorkloadInput(v *UpdateWorkloadInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateWorkloadInput(v *UpdateWorkloadInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountIds != nil { + ok := object.Key("AccountIds") + if err := awsRestjson1_serializeDocumentWorkloadAccountIds(v.AccountIds, ok); err != nil { + return err + } + } + + if v.ArchitecturalDesign != nil { + ok := object.Key("ArchitecturalDesign") + ok.String(*v.ArchitecturalDesign) + } + + if v.AwsRegions != nil { + ok := object.Key("AwsRegions") + if err := awsRestjson1_serializeDocumentWorkloadAwsRegions(v.AwsRegions, ok); err != nil { + return err + } + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if len(v.Environment) > 0 { + ok := object.Key("Environment") + ok.String(string(v.Environment)) + } + + if len(v.ImprovementStatus) > 0 { + ok := object.Key("ImprovementStatus") + ok.String(string(v.ImprovementStatus)) + } + + if v.Industry != nil { + ok := object.Key("Industry") + ok.String(*v.Industry) + } + + if v.IndustryType != nil { + ok := object.Key("IndustryType") + ok.String(*v.IndustryType) + } + + if v.IsReviewOwnerUpdateAcknowledged { + ok := object.Key("IsReviewOwnerUpdateAcknowledged") + ok.Boolean(v.IsReviewOwnerUpdateAcknowledged) + } + + if v.NonAwsRegions != nil { + ok := object.Key("NonAwsRegions") + if err := awsRestjson1_serializeDocumentWorkloadNonAwsRegions(v.NonAwsRegions, ok); err != nil { + return err + } + } + + if v.Notes != nil { + ok := object.Key("Notes") + ok.String(*v.Notes) + } + + if v.PillarPriorities != nil { + ok := object.Key("PillarPriorities") + if err := awsRestjson1_serializeDocumentWorkloadPillarPriorities(v.PillarPriorities, ok); err != nil { + return err + } + } + + if v.ReviewOwner != nil { + ok := object.Key("ReviewOwner") + ok.String(*v.ReviewOwner) + } + + if v.WorkloadName != nil { + ok := object.Key("WorkloadName") + ok.String(*v.WorkloadName) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateWorkloadShare struct { +} + +func (*awsRestjson1_serializeOpUpdateWorkloadShare) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateWorkloadShare) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateWorkloadShareInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/shares/{ShareId}") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + 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_serializeOpHttpBindingsUpdateWorkloadShareInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateWorkloadShareInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpdateWorkloadShareInput(v *UpdateWorkloadShareInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ShareId == nil || len(*v.ShareId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ShareId must not be empty")} + } + if v.ShareId != nil { + if err := encoder.SetURI("ShareId").String(*v.ShareId); err != nil { + return err + } + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateWorkloadShareInput(v *UpdateWorkloadShareInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.PermissionType) > 0 { + ok := object.Key("PermissionType") + ok.String(string(v.PermissionType)) + } + + return nil +} + +type awsRestjson1_serializeOpUpgradeLensReview struct { +} + +func (*awsRestjson1_serializeOpUpgradeLensReview) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpgradeLensReview) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpgradeLensReviewInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/workloads/{WorkloadId}/lensReviews/{LensAlias}/upgrade") + request.URL.Path = opPath + if len(request.URL.RawQuery) > 0 { + request.URL.RawQuery = "&" + opQuery + } else { + request.URL.RawQuery = opQuery + } + + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpgradeLensReviewInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpgradeLensReviewInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpHttpBindingsUpgradeLensReviewInput(v *UpgradeLensReviewInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.LensAlias == nil || len(*v.LensAlias) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member LensAlias must not be empty")} + } + if v.LensAlias != nil { + if err := encoder.SetURI("LensAlias").String(*v.LensAlias); err != nil { + return err + } + } + + if v.WorkloadId == nil || len(*v.WorkloadId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member WorkloadId must not be empty")} + } + if v.WorkloadId != nil { + if err := encoder.SetURI("WorkloadId").String(*v.WorkloadId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpgradeLensReviewInput(v *UpgradeLensReviewInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientRequestToken != nil { + ok := object.Key("ClientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.MilestoneName != nil { + ok := object.Key("MilestoneName") + ok.String(*v.MilestoneName) + } + + return nil +} + +func awsRestjson1_serializeDocumentLensAliases(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_serializeDocumentPillarNotes(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_serializeDocumentSelectedChoices(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_serializeDocumentWorkloadAccountIds(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_serializeDocumentWorkloadAwsRegions(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_serializeDocumentWorkloadLenses(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_serializeDocumentWorkloadNonAwsRegions(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_serializeDocumentWorkloadPillarPriorities(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 +} diff --git a/service/wellarchitected/types/enums.go b/service/wellarchitected/types/enums.go new file mode 100644 index 00000000000..6fbe8cf478e --- /dev/null +++ b/service/wellarchitected/types/enums.go @@ -0,0 +1,209 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type DifferenceStatus string + +// Enum values for DifferenceStatus +const ( + DifferenceStatusUpdated DifferenceStatus = "UPDATED" + DifferenceStatusNew DifferenceStatus = "NEW" + DifferenceStatusDeleted DifferenceStatus = "DELETED" +) + +// Values returns all known values for DifferenceStatus. 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 (DifferenceStatus) Values() []DifferenceStatus { + return []DifferenceStatus{ + "UPDATED", + "NEW", + "DELETED", + } +} + +type LensStatus string + +// Enum values for LensStatus +const ( + LensStatusCurrent LensStatus = "CURRENT" + LensStatusNotCurrent LensStatus = "NOT_CURRENT" + LensStatusDeprecated LensStatus = "DEPRECATED" +) + +// Values returns all known values for LensStatus. 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 (LensStatus) Values() []LensStatus { + return []LensStatus{ + "CURRENT", + "NOT_CURRENT", + "DEPRECATED", + } +} + +type NotificationType string + +// Enum values for NotificationType +const ( + NotificationTypeLensVersionUpgraded NotificationType = "LENS_VERSION_UPGRADED" + NotificationTypeLensVersionDeprecated NotificationType = "LENS_VERSION_DEPRECATED" +) + +// Values returns all known values for NotificationType. 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 (NotificationType) Values() []NotificationType { + return []NotificationType{ + "LENS_VERSION_UPGRADED", + "LENS_VERSION_DEPRECATED", + } +} + +type PermissionType string + +// Enum values for PermissionType +const ( + PermissionTypeReadonly PermissionType = "READONLY" + PermissionTypeContributor PermissionType = "CONTRIBUTOR" +) + +// Values returns all known values for PermissionType. 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 (PermissionType) Values() []PermissionType { + return []PermissionType{ + "READONLY", + "CONTRIBUTOR", + } +} + +type Risk string + +// Enum values for Risk +const ( + RiskUnanswered Risk = "UNANSWERED" + RiskHigh Risk = "HIGH" + RiskMedium Risk = "MEDIUM" + RiskNone Risk = "NONE" + RiskNotApplicable Risk = "NOT_APPLICABLE" +) + +// Values returns all known values for Risk. 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 (Risk) Values() []Risk { + return []Risk{ + "UNANSWERED", + "HIGH", + "MEDIUM", + "NONE", + "NOT_APPLICABLE", + } +} + +type ShareInvitationAction string + +// Enum values for ShareInvitationAction +const ( + ShareInvitationActionAccept ShareInvitationAction = "ACCEPT" + ShareInvitationActionReject ShareInvitationAction = "REJECT" +) + +// Values returns all known values for ShareInvitationAction. 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 (ShareInvitationAction) Values() []ShareInvitationAction { + return []ShareInvitationAction{ + "ACCEPT", + "REJECT", + } +} + +type ShareStatus string + +// Enum values for ShareStatus +const ( + ShareStatusAccepted ShareStatus = "ACCEPTED" + ShareStatusRejected ShareStatus = "REJECTED" + ShareStatusPending ShareStatus = "PENDING" + ShareStatusRevoked ShareStatus = "REVOKED" + ShareStatusExpired ShareStatus = "EXPIRED" +) + +// Values returns all known values for ShareStatus. 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 (ShareStatus) Values() []ShareStatus { + return []ShareStatus{ + "ACCEPTED", + "REJECTED", + "PENDING", + "REVOKED", + "EXPIRED", + } +} + +type ValidationExceptionReason string + +// Enum values for ValidationExceptionReason +const ( + ValidationExceptionReasonUnknownOperation ValidationExceptionReason = "UNKNOWN_OPERATION" + ValidationExceptionReasonCannotParse ValidationExceptionReason = "CANNOT_PARSE" + ValidationExceptionReasonFieldValidationFailed ValidationExceptionReason = "FIELD_VALIDATION_FAILED" + ValidationExceptionReasonOther ValidationExceptionReason = "OTHER" +) + +// Values returns all known values for ValidationExceptionReason. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// The ordering of this slice is not guaranteed to be stable across updates. +func (ValidationExceptionReason) Values() []ValidationExceptionReason { + return []ValidationExceptionReason{ + "UNKNOWN_OPERATION", + "CANNOT_PARSE", + "FIELD_VALIDATION_FAILED", + "OTHER", + } +} + +type WorkloadEnvironment string + +// Enum values for WorkloadEnvironment +const ( + WorkloadEnvironmentProduction WorkloadEnvironment = "PRODUCTION" + WorkloadEnvironmentPreproduction WorkloadEnvironment = "PREPRODUCTION" +) + +// Values returns all known values for WorkloadEnvironment. 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 (WorkloadEnvironment) Values() []WorkloadEnvironment { + return []WorkloadEnvironment{ + "PRODUCTION", + "PREPRODUCTION", + } +} + +type WorkloadImprovementStatus string + +// Enum values for WorkloadImprovementStatus +const ( + WorkloadImprovementStatusNotApplicable WorkloadImprovementStatus = "NOT_APPLICABLE" + WorkloadImprovementStatusNotStarted WorkloadImprovementStatus = "NOT_STARTED" + WorkloadImprovementStatusInProgress WorkloadImprovementStatus = "IN_PROGRESS" + WorkloadImprovementStatusComplete WorkloadImprovementStatus = "COMPLETE" + WorkloadImprovementStatusRiskAcknowledged WorkloadImprovementStatus = "RISK_ACKNOWLEDGED" +) + +// Values returns all known values for WorkloadImprovementStatus. 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 (WorkloadImprovementStatus) Values() []WorkloadImprovementStatus { + return []WorkloadImprovementStatus{ + "NOT_APPLICABLE", + "NOT_STARTED", + "IN_PROGRESS", + "COMPLETE", + "RISK_ACKNOWLEDGED", + } +} diff --git a/service/wellarchitected/types/errors.go b/service/wellarchitected/types/errors.go new file mode 100644 index 00000000000..7ac50968448 --- /dev/null +++ b/service/wellarchitected/types/errors.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// User does not have sufficient access to perform this action. +type AccessDeniedException struct { + Message *string +} + +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 { return "AccessDeniedException" } +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The resource already exists. +type ConflictException struct { + Message *string + + ResourceId *string + ResourceType *string +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { return "ConflictException" } +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// There is a problem with the AWS Well-Architected Tool API service. +type InternalServerException struct { + Message *string +} + +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 { return "InternalServerException" } +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The requested resource was not found. +type ResourceNotFoundException struct { + Message *string + + ResourceId *string + ResourceType *string +} + +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 { return "ResourceNotFoundException" } +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The user has reached their resource quota. +type ServiceQuotaExceededException struct { + Message *string + + ResourceId *string + ResourceType *string + QuotaCode *string + ServiceCode *string +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { return "ServiceQuotaExceededException" } +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Request was denied due to request throttling. +type ThrottlingException struct { + Message *string + + QuotaCode *string + ServiceCode *string +} + +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 { return "ThrottlingException" } +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The user input is not valid. +type ValidationException struct { + Message *string + + Reason ValidationExceptionReason + Fields []ValidationExceptionField +} + +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 { return "ValidationException" } +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/wellarchitected/types/types.go b/service/wellarchitected/types/types.go new file mode 100644 index 00000000000..0d6c17661b3 --- /dev/null +++ b/service/wellarchitected/types/types.go @@ -0,0 +1,564 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "time" +) + +// An answer of the question. +type Answer struct { + + // List of choices available for a question. + Choices []Choice + + // The helpful resource URL for a question. + HelpfulResourceUrl *string + + // The improvement plan URL for a question. + ImprovementPlanUrl *string + + // Defines whether this question is applicable to a lens review. + IsApplicable bool + + // The notes associated with the workload. + Notes *string + + // The ID used to identify a pillar, for example, security. A pillar is identified + // by its PillarReviewSummary$PillarId. + PillarId *string + + // The description of the question. + QuestionDescription *string + + // The ID of the question. + QuestionId *string + + // The title of the question. + QuestionTitle *string + + // The risk for a given workload, lens review, pillar, or question. + Risk Risk + + // List of selected choice IDs in a question answer. + SelectedChoices []string +} + +// An answer summary of a lens review in a workload. +type AnswerSummary struct { + + // List of choices available for a question. + Choices []Choice + + // Defines whether this question is applicable to a lens review. + IsApplicable bool + + // The ID used to identify a pillar, for example, security. A pillar is identified + // by its PillarReviewSummary$PillarId. + PillarId *string + + // The ID of the question. + QuestionId *string + + // The title of the question. + QuestionTitle *string + + // The risk for a given workload, lens review, pillar, or question. + Risk Risk + + // List of selected choice IDs in a question answer. + SelectedChoices []string +} + +// A choice available to answer question. +type Choice struct { + + // The ID of a choice. + ChoiceId *string + + // The description of a choice. + Description *string + + // The title of a choice. + Title *string +} + +// An improvement summary of a lens review in a workload. +type ImprovementSummary struct { + + // The improvement plan URL for a question. + ImprovementPlanUrl *string + + // The ID used to identify a pillar, for example, security. A pillar is identified + // by its PillarReviewSummary$PillarId. + PillarId *string + + // The ID of the question. + QuestionId *string + + // The title of the question. + QuestionTitle *string + + // The risk for a given workload, lens review, pillar, or question. + Risk Risk +} + +// A lens review of a question. +type LensReview struct { + + // The alias of the lens, for example, serverless. Each lens is identified by its + // LensSummary$LensAlias. + LensAlias *string + + // The full name of the lens. + LensName *string + + // The status of the lens. + LensStatus LensStatus + + // The version of the lens. + LensVersion *string + + // The token to use to retrieve the next set of results. + NextToken *string + + // The notes associated with the workload. + Notes *string + + // List of pillar review summaries of lens review in a workload. + PillarReviewSummaries []PillarReviewSummary + + // A map from risk names to the count of how questions have that rating. + RiskCounts map[string]int32 + + // The date and time recorded. + UpdatedAt *time.Time +} + +// A report of a lens review. +type LensReviewReport struct { + + // The Base64-encoded string representation of a lens review report. This data can + // be used to create a PDF file. + Base64String *string + + // The alias of the lens, for example, serverless. Each lens is identified by its + // LensSummary$LensAlias. + LensAlias *string +} + +// A lens review summary of a workload. +type LensReviewSummary struct { + + // The alias of the lens, for example, serverless. Each lens is identified by its + // LensSummary$LensAlias. + LensAlias *string + + // The full name of the lens. + LensName *string + + // The status of the lens. + LensStatus LensStatus + + // The version of the lens. + LensVersion *string + + // A map from risk names to the count of how questions have that rating. + RiskCounts map[string]int32 + + // The date and time recorded. + UpdatedAt *time.Time +} + +// A lens summary of a lens. +type LensSummary struct { + + // The description of the lens. + Description *string + + // The alias of the lens, for example, serverless. Each lens is identified by its + // LensSummary$LensAlias. + LensAlias *string + + // The full name of the lens. + LensName *string + + // The version of the lens. + LensVersion *string +} + +// Lens upgrade summary return object. +type LensUpgradeSummary struct { + + // The current version of the lens. + CurrentLensVersion *string + + // The latest version of the lens. + LatestLensVersion *string + + // The alias of the lens, for example, serverless. Each lens is identified by its + // LensSummary$LensAlias. + LensAlias *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string + + // The name of the workload. The name must be unique within an account within a + // Region. Spaces and capitalization are ignored when checking for uniqueness. + WorkloadName *string +} + +// A milestone return object. +type Milestone struct { + + // The name of the milestone in a workload. Milestone names must be unique within a + // workload. + MilestoneName *string + + // The milestone number. A workload can have a maximum of 100 milestones. + MilestoneNumber int32 + + // The date and time recorded. + RecordedAt *time.Time + + // A workload return object. + Workload *Workload +} + +// A milestone summary return object. +type MilestoneSummary struct { + + // The name of the milestone in a workload. Milestone names must be unique within a + // workload. + MilestoneName *string + + // The milestone number. A workload can have a maximum of 100 milestones. + MilestoneNumber int32 + + // The date and time recorded. + RecordedAt *time.Time + + // A workload summary return object. + WorkloadSummary *WorkloadSummary +} + +// A notification summary return object. +type NotificationSummary struct { + + // Summary of lens upgrade. + LensUpgradeSummary *LensUpgradeSummary + + // The type of notification. + Type NotificationType +} + +// A pillar difference return object. +type PillarDifference struct { + + // Indicates the type of change to the pillar. + DifferenceStatus DifferenceStatus + + // The ID used to identify a pillar, for example, security. A pillar is identified + // by its PillarReviewSummary$PillarId. + PillarId *string + + // List of question differences. + QuestionDifferences []QuestionDifference +} + +// A pillar review summary of a lens review. +type PillarReviewSummary struct { + + // The notes associated with the workload. + Notes *string + + // The ID used to identify a pillar, for example, security. A pillar is identified + // by its PillarReviewSummary$PillarId. + PillarId *string + + // The name of the pillar. + PillarName *string + + // A map from risk names to the count of how questions have that rating. + RiskCounts map[string]int32 +} + +// A question difference return object. +type QuestionDifference struct { + + // Indicates the type of change to the question. + DifferenceStatus DifferenceStatus + + // The ID of the question. + QuestionId *string + + // The title of the question. + QuestionTitle *string +} + +// The share invitation. +type ShareInvitation struct { + + // The ID assigned to the share invitation. + ShareInvitationId *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string +} + +// A share invitation summary return object. +type ShareInvitationSummary struct { + + // Permission granted on a workload share. + PermissionType PermissionType + + // The ID assigned to the share invitation. + ShareInvitationId *string + + // An AWS account ID. + SharedBy *string + + // The AWS account ID or IAM role with which the workload is shared. + SharedWith *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string + + // The name of the workload. The name must be unique within an account within a + // Region. Spaces and capitalization are ignored when checking for uniqueness. + WorkloadName *string +} + +// Stores information about a field passed inside a request that resulted in an +// exception. +type ValidationExceptionField struct { + + // Description of the error. + // + // This member is required. + Message *string + + // The field name for which validation failed. + // + // This member is required. + Name *string +} + +// The differences between the base and latest versions of the lens. +type VersionDifferences struct { + + // The differences between the base and latest versions of the lens. + PillarDifferences []PillarDifference +} + +// A workload return object. +type Workload struct { + + // The list of AWS account IDs associated with the workload. + AccountIds []string + + // The URL of the architectural design for the workload. + ArchitecturalDesign *string + + // The list of AWS Regions associated with the workload, for example, us-east-2, or + // ca-central-1. + AwsRegions []string + + // The description for the workload. + Description *string + + // The environment for the workload. + Environment WorkloadEnvironment + + // The improvement status for a workload. + ImprovementStatus WorkloadImprovementStatus + + // The industry for the workload. + Industry *string + + // The industry type for the workload. If specified, must be one of the + // following: + // + // * Agriculture + // + // * Automobile + // + // * Defense + // + // * Design and Engineering + // + // * + // Digital Advertising + // + // * Education + // + // * Environmental Protection + // + // * Financial + // Services + // + // * Gaming + // + // * General Public Services + // + // * Healthcare + // + // * Hospitality + // + // * + // InfoTech + // + // * Justice and Public Safety + // + // * Life Sciences + // + // * Manufacturing + // + // * Media + // & Entertainment + // + // * Mining & Resources + // + // * Oil & Gas + // + // * Power & Utilities + // + // * + // Professional Services + // + // * Real Estate & Construction + // + // * Retail & Wholesale + // + // * + // Social Protection + // + // * Telecommunications + // + // * Travel, Transportation & Logistics + // + // * + // Other + IndustryType *string + + // Flag indicating whether the workload owner has acknowledged that the Review + // owner field is required. If a Review owner is not added to the workload within + // 60 days of acknowledgement, access to the workload is restricted until an owner + // is added. + IsReviewOwnerUpdateAcknowledged bool + + // The list of lenses associated with the workload. Each lens is identified by its + // LensSummary$LensAlias. + Lenses []string + + // The list of non-AWS Regions associated with the workload. + NonAwsRegions []string + + // The notes associated with the workload. + Notes *string + + // An AWS account ID. + Owner *string + + // The priorities of the pillars, which are used to order items in the improvement + // plan. Each pillar is represented by its PillarReviewSummary$PillarId. + PillarPriorities []string + + // The review owner of the workload. The name, email address, or identifier for the + // primary group or individual that owns the workload review process. + ReviewOwner *string + + // The date and time recorded. + ReviewRestrictionDate *time.Time + + // A map from risk names to the count of how questions have that rating. + RiskCounts map[string]int32 + + // The ID assigned to the share invitation. + ShareInvitationId *string + + // The date and time recorded. + UpdatedAt *time.Time + + // The ARN for the workload. + WorkloadArn *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string + + // The name of the workload. The name must be unique within an account within a + // Region. Spaces and capitalization are ignored when checking for uniqueness. + WorkloadName *string +} + +// A workload share return object. +type WorkloadShare struct { + + // Permission granted on a workload share. + PermissionType PermissionType + + // The ID associated with the workload share. + ShareId *string + + // An AWS account ID. + SharedBy *string + + // The AWS account ID or IAM role with which the workload is shared. + SharedWith *string + + // The status of a workload share. + Status ShareStatus + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string + + // The name of the workload. The name must be unique within an account within a + // Region. Spaces and capitalization are ignored when checking for uniqueness. + WorkloadName *string +} + +// A workload share summary return object. +type WorkloadShareSummary struct { + + // Permission granted on a workload share. + PermissionType PermissionType + + // The ID associated with the workload share. + ShareId *string + + // The AWS account ID or IAM role with which the workload is shared. + SharedWith *string + + // The status of a workload share. + Status ShareStatus +} + +// A workload summary return object. +type WorkloadSummary struct { + + // The improvement status for a workload. + ImprovementStatus WorkloadImprovementStatus + + // The list of lenses associated with the workload. Each lens is identified by its + // LensSummary$LensAlias. + Lenses []string + + // An AWS account ID. + Owner *string + + // A map from risk names to the count of how questions have that rating. + RiskCounts map[string]int32 + + // The date and time recorded. + UpdatedAt *time.Time + + // The ARN for the workload. + WorkloadArn *string + + // The ID assigned to the workload. This ID is unique within an AWS Region. + WorkloadId *string + + // The name of the workload. The name must be unique within an account within a + // Region. Spaces and capitalization are ignored when checking for uniqueness. + WorkloadName *string +} diff --git a/service/wellarchitected/validators.go b/service/wellarchitected/validators.go new file mode 100644 index 00000000000..321f7df71dc --- /dev/null +++ b/service/wellarchitected/validators.go @@ -0,0 +1,1036 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package wellarchitected + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpAssociateLenses struct { +} + +func (*validateOpAssociateLenses) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssociateLenses) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssociateLensesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssociateLensesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateMilestone struct { +} + +func (*validateOpCreateMilestone) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateMilestone) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateMilestoneInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateMilestoneInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateWorkload struct { +} + +func (*validateOpCreateWorkload) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateWorkload) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateWorkloadInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateWorkloadInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateWorkloadShare struct { +} + +func (*validateOpCreateWorkloadShare) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateWorkloadShare) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateWorkloadShareInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateWorkloadShareInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteWorkload struct { +} + +func (*validateOpDeleteWorkload) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteWorkload) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteWorkloadInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteWorkloadInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteWorkloadShare struct { +} + +func (*validateOpDeleteWorkloadShare) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteWorkloadShare) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteWorkloadShareInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteWorkloadShareInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDisassociateLenses struct { +} + +func (*validateOpDisassociateLenses) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDisassociateLenses) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DisassociateLensesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDisassociateLensesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetAnswer struct { +} + +func (*validateOpGetAnswer) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetAnswer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetAnswerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetAnswerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetLensReview struct { +} + +func (*validateOpGetLensReview) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetLensReview) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetLensReviewInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetLensReviewInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetLensReviewReport struct { +} + +func (*validateOpGetLensReviewReport) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetLensReviewReport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetLensReviewReportInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetLensReviewReportInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetLensVersionDifference struct { +} + +func (*validateOpGetLensVersionDifference) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetLensVersionDifference) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetLensVersionDifferenceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetLensVersionDifferenceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetMilestone struct { +} + +func (*validateOpGetMilestone) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetMilestone) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetMilestoneInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetMilestoneInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetWorkload struct { +} + +func (*validateOpGetWorkload) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetWorkload) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetWorkloadInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetWorkloadInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListAnswers struct { +} + +func (*validateOpListAnswers) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListAnswers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListAnswersInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListAnswersInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListLensReviewImprovements struct { +} + +func (*validateOpListLensReviewImprovements) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListLensReviewImprovements) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListLensReviewImprovementsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListLensReviewImprovementsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListLensReviews struct { +} + +func (*validateOpListLensReviews) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListLensReviews) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListLensReviewsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListLensReviewsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListMilestones struct { +} + +func (*validateOpListMilestones) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListMilestones) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListMilestonesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListMilestonesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListWorkloadShares struct { +} + +func (*validateOpListWorkloadShares) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListWorkloadShares) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListWorkloadSharesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListWorkloadSharesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateAnswer struct { +} + +func (*validateOpUpdateAnswer) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateAnswer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateAnswerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateAnswerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateLensReview struct { +} + +func (*validateOpUpdateLensReview) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateLensReview) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateLensReviewInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateLensReviewInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateShareInvitation struct { +} + +func (*validateOpUpdateShareInvitation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateShareInvitation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateShareInvitationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateShareInvitationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateWorkload struct { +} + +func (*validateOpUpdateWorkload) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateWorkload) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateWorkloadInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateWorkloadInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateWorkloadShare struct { +} + +func (*validateOpUpdateWorkloadShare) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateWorkloadShare) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateWorkloadShareInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateWorkloadShareInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpgradeLensReview struct { +} + +func (*validateOpUpgradeLensReview) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpgradeLensReview) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpgradeLensReviewInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpgradeLensReviewInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpAssociateLensesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssociateLenses{}, middleware.After) +} + +func addOpCreateMilestoneValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateMilestone{}, middleware.After) +} + +func addOpCreateWorkloadValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateWorkload{}, middleware.After) +} + +func addOpCreateWorkloadShareValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateWorkloadShare{}, middleware.After) +} + +func addOpDeleteWorkloadValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteWorkload{}, middleware.After) +} + +func addOpDeleteWorkloadShareValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteWorkloadShare{}, middleware.After) +} + +func addOpDisassociateLensesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDisassociateLenses{}, middleware.After) +} + +func addOpGetAnswerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetAnswer{}, middleware.After) +} + +func addOpGetLensReviewValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetLensReview{}, middleware.After) +} + +func addOpGetLensReviewReportValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetLensReviewReport{}, middleware.After) +} + +func addOpGetLensVersionDifferenceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetLensVersionDifference{}, middleware.After) +} + +func addOpGetMilestoneValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetMilestone{}, middleware.After) +} + +func addOpGetWorkloadValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetWorkload{}, middleware.After) +} + +func addOpListAnswersValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAnswers{}, middleware.After) +} + +func addOpListLensReviewImprovementsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListLensReviewImprovements{}, middleware.After) +} + +func addOpListLensReviewsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListLensReviews{}, middleware.After) +} + +func addOpListMilestonesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListMilestones{}, middleware.After) +} + +func addOpListWorkloadSharesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListWorkloadShares{}, middleware.After) +} + +func addOpUpdateAnswerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateAnswer{}, middleware.After) +} + +func addOpUpdateLensReviewValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateLensReview{}, middleware.After) +} + +func addOpUpdateShareInvitationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateShareInvitation{}, middleware.After) +} + +func addOpUpdateWorkloadValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateWorkload{}, middleware.After) +} + +func addOpUpdateWorkloadShareValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateWorkloadShare{}, middleware.After) +} + +func addOpUpgradeLensReviewValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpgradeLensReview{}, middleware.After) +} + +func validateOpAssociateLensesInput(v *AssociateLensesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssociateLensesInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if v.LensAliases == nil { + invalidParams.Add(smithy.NewErrParamRequired("LensAliases")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateMilestoneInput(v *CreateMilestoneInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateMilestoneInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if v.MilestoneName == nil { + invalidParams.Add(smithy.NewErrParamRequired("MilestoneName")) + } + if v.ClientRequestToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientRequestToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateWorkloadInput(v *CreateWorkloadInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateWorkloadInput"} + if v.WorkloadName == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadName")) + } + if v.Description == nil { + invalidParams.Add(smithy.NewErrParamRequired("Description")) + } + if len(v.Environment) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Environment")) + } + if v.ReviewOwner == nil { + invalidParams.Add(smithy.NewErrParamRequired("ReviewOwner")) + } + if v.Lenses == nil { + invalidParams.Add(smithy.NewErrParamRequired("Lenses")) + } + if v.ClientRequestToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientRequestToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateWorkloadShareInput(v *CreateWorkloadShareInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateWorkloadShareInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if v.SharedWith == nil { + invalidParams.Add(smithy.NewErrParamRequired("SharedWith")) + } + if len(v.PermissionType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("PermissionType")) + } + if v.ClientRequestToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientRequestToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteWorkloadInput(v *DeleteWorkloadInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteWorkloadInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if v.ClientRequestToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientRequestToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteWorkloadShareInput(v *DeleteWorkloadShareInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteWorkloadShareInput"} + if v.ShareId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ShareId")) + } + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if v.ClientRequestToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientRequestToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDisassociateLensesInput(v *DisassociateLensesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DisassociateLensesInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if v.LensAliases == nil { + invalidParams.Add(smithy.NewErrParamRequired("LensAliases")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetAnswerInput(v *GetAnswerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetAnswerInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if v.LensAlias == nil { + invalidParams.Add(smithy.NewErrParamRequired("LensAlias")) + } + if v.QuestionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("QuestionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetLensReviewInput(v *GetLensReviewInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetLensReviewInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if v.LensAlias == nil { + invalidParams.Add(smithy.NewErrParamRequired("LensAlias")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetLensReviewReportInput(v *GetLensReviewReportInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetLensReviewReportInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if v.LensAlias == nil { + invalidParams.Add(smithy.NewErrParamRequired("LensAlias")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetLensVersionDifferenceInput(v *GetLensVersionDifferenceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetLensVersionDifferenceInput"} + if v.LensAlias == nil { + invalidParams.Add(smithy.NewErrParamRequired("LensAlias")) + } + if v.BaseLensVersion == nil { + invalidParams.Add(smithy.NewErrParamRequired("BaseLensVersion")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetMilestoneInput(v *GetMilestoneInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetMilestoneInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetWorkloadInput(v *GetWorkloadInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetWorkloadInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListAnswersInput(v *ListAnswersInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListAnswersInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if v.LensAlias == nil { + invalidParams.Add(smithy.NewErrParamRequired("LensAlias")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListLensReviewImprovementsInput(v *ListLensReviewImprovementsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListLensReviewImprovementsInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if v.LensAlias == nil { + invalidParams.Add(smithy.NewErrParamRequired("LensAlias")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListLensReviewsInput(v *ListLensReviewsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListLensReviewsInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListMilestonesInput(v *ListMilestonesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListMilestonesInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListWorkloadSharesInput(v *ListWorkloadSharesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListWorkloadSharesInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateAnswerInput(v *UpdateAnswerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateAnswerInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if v.LensAlias == nil { + invalidParams.Add(smithy.NewErrParamRequired("LensAlias")) + } + if v.QuestionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("QuestionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateLensReviewInput(v *UpdateLensReviewInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateLensReviewInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if v.LensAlias == nil { + invalidParams.Add(smithy.NewErrParamRequired("LensAlias")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateShareInvitationInput(v *UpdateShareInvitationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateShareInvitationInput"} + if v.ShareInvitationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ShareInvitationId")) + } + if len(v.ShareInvitationAction) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ShareInvitationAction")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateWorkloadInput(v *UpdateWorkloadInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateWorkloadInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateWorkloadShareInput(v *UpdateWorkloadShareInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateWorkloadShareInput"} + if v.ShareId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ShareId")) + } + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if len(v.PermissionType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("PermissionType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpgradeLensReviewInput(v *UpgradeLensReviewInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpgradeLensReviewInput"} + if v.WorkloadId == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkloadId")) + } + if v.LensAlias == nil { + invalidParams.Add(smithy.NewErrParamRequired("LensAlias")) + } + if v.MilestoneName == nil { + invalidParams.Add(smithy.NewErrParamRequired("MilestoneName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/workmail/api_client.go b/service/workmail/api_client.go index 78e1947271f..291456122ba 100644 --- a/service/workmail/api_client.go +++ b/service/workmail/api_client.go @@ -4,6 +4,7 @@ package workmail import ( "context" + cryptorand "crypto/rand" "github.com/aws/aws-sdk-go-v2/aws" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/retry" @@ -12,6 +13,7 @@ import ( smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/middleware" + smithyrand "github.com/aws/smithy-go/rand" smithyhttp "github.com/aws/smithy-go/transport/http" "net/http" "time" @@ -41,6 +43,8 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveDefaultEndpointConfiguration(&options) + resolveIdempotencyTokenProvider(&options) + for _, fn := range optFns { fn(&options) } @@ -73,6 +77,10 @@ type Options struct { // Signature Version 4 (SigV4) Signer HTTPSignerV4 HTTPSignerV4 + // Provides idempotency tokens values that will be automatically populated into + // idempotent API operations. + IdempotencyTokenProvider IdempotencyTokenProvider + // The logger writer interface to write logging messages to. Logger logging.Logger @@ -208,6 +216,13 @@ func newDefaultV4Signer(o Options) *v4.Signer { }) } +func resolveIdempotencyTokenProvider(o *Options) { + if o.IdempotencyTokenProvider != nil { + return + } + o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) +} + func addRetryMiddlewares(stack *middleware.Stack, o Options) error { mo := retry.AddRetryMiddlewaresOptions{ Retryer: o.Retryer, @@ -216,6 +231,11 @@ func addRetryMiddlewares(stack *middleware.Stack, o Options) error { return retry.AddRetryMiddlewares(stack, mo) } +// IdempotencyTokenProvider interface for providing idempotency token +type IdempotencyTokenProvider interface { + GetIdempotencyToken() (string, error) +} + func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) } diff --git a/service/workmail/api_op_CancelMailboxExportJob.go b/service/workmail/api_op_CancelMailboxExportJob.go new file mode 100644 index 00000000000..c44ef493005 --- /dev/null +++ b/service/workmail/api_op_CancelMailboxExportJob.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Cancels a mailbox export job. If the mailbox export job is near completion, it +// might not be possible to cancel it. +func (c *Client) CancelMailboxExportJob(ctx context.Context, params *CancelMailboxExportJobInput, optFns ...func(*Options)) (*CancelMailboxExportJobOutput, error) { + if params == nil { + params = &CancelMailboxExportJobInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CancelMailboxExportJob", params, optFns, addOperationCancelMailboxExportJobMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CancelMailboxExportJobOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CancelMailboxExportJobInput struct { + + // The idempotency token for the client request. + // + // This member is required. + ClientToken *string + + // The job ID. + // + // This member is required. + JobId *string + + // The organization ID. + // + // This member is required. + OrganizationId *string +} + +type CancelMailboxExportJobOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCancelMailboxExportJobMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCancelMailboxExportJob{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCancelMailboxExportJob{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opCancelMailboxExportJobMiddleware(stack, options); err != nil { + return err + } + if err = addOpCancelMailboxExportJobValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelMailboxExportJob(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpCancelMailboxExportJob struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCancelMailboxExportJob) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCancelMailboxExportJob) 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.(*CancelMailboxExportJobInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CancelMailboxExportJobInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCancelMailboxExportJobMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCancelMailboxExportJob{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCancelMailboxExportJob(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "CancelMailboxExportJob", + } +} diff --git a/service/workmail/api_op_CreateOrganization.go b/service/workmail/api_op_CreateOrganization.go new file mode 100644 index 00000000000..188a4a0528a --- /dev/null +++ b/service/workmail/api_op_CreateOrganization.go @@ -0,0 +1,185 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +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/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new Amazon WorkMail organization. Optionally, you can choose to +// associate an existing AWS Directory Service directory with your organization. If +// an AWS Directory Service directory ID is specified, the organization alias must +// match the directory alias. If you choose not to associate an existing directory +// with your organization, then we create a new Amazon WorkMail directory for you. +// For more information, see Adding an organization +// (https://docs.aws.amazon.com/workmail/latest/adminguide/add_new_organization.html) +// in the Amazon WorkMail Administrator Guide. You can associate multiple email +// domains with an organization, then set your default email domain from the Amazon +// WorkMail console. You can also associate a domain that is managed in an Amazon +// Route 53 public hosted zone. For more information, see Adding a domain +// (https://docs.aws.amazon.com/workmail/latest/adminguide/add_domain.html) and +// Choosing the default domain +// (https://docs.aws.amazon.com/workmail/latest/adminguide/default_domain.html) in +// the Amazon WorkMail Administrator Guide. Optionally, you can use a customer +// managed master key from AWS Key Management Service (AWS KMS) to encrypt email +// for your organization. If you don't associate an AWS KMS key, Amazon WorkMail +// creates a default AWS managed master key for you. +func (c *Client) CreateOrganization(ctx context.Context, params *CreateOrganizationInput, optFns ...func(*Options)) (*CreateOrganizationOutput, error) { + if params == nil { + params = &CreateOrganizationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateOrganization", params, optFns, addOperationCreateOrganizationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateOrganizationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateOrganizationInput struct { + + // The organization alias. + // + // This member is required. + Alias *string + + // The idempotency token associated with the request. + ClientToken *string + + // The AWS Directory Service directory ID. + DirectoryId *string + + // The email domains to associate with the organization. + Domains []types.Domain + + // When true, allows organization interoperability between Amazon WorkMail and + // Microsoft Exchange. Can only be set to true if an AD Connector directory ID is + // included in the request. + EnableInteroperability bool + + // The Amazon Resource Name (ARN) of a customer managed master key from AWS KMS. + KmsKeyArn *string +} + +type CreateOrganizationOutput struct { + + // The organization ID. + OrganizationId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationCreateOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateOrganization{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateOrganization{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opCreateOrganizationMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateOrganizationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateOrganization(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpCreateOrganization struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateOrganization) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateOrganization) 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.(*CreateOrganizationInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateOrganizationInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateOrganizationMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateOrganization{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateOrganization(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "CreateOrganization", + } +} diff --git a/service/workmail/api_op_CreateUser.go b/service/workmail/api_op_CreateUser.go index d4d758f2ff9..d7f2cff8440 100644 --- a/service/workmail/api_op_CreateUser.go +++ b/service/workmail/api_op_CreateUser.go @@ -34,8 +34,8 @@ type CreateUserInput struct { // This member is required. DisplayName *string - // The name for the new user. Simple AD or AD Connector user names have a maximum - // length of 20. All others have a maximum length of 64. + // The name for the new user. WorkMail directory user names have a maximum length + // of 64. All others have a maximum length of 20. // // This member is required. Name *string diff --git a/service/workmail/api_op_DeleteAccessControlRule.go b/service/workmail/api_op_DeleteAccessControlRule.go new file mode 100644 index 00000000000..9d6f76a13fc --- /dev/null +++ b/service/workmail/api_op_DeleteAccessControlRule.go @@ -0,0 +1,114 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an access control rule for the specified WorkMail organization. +func (c *Client) DeleteAccessControlRule(ctx context.Context, params *DeleteAccessControlRuleInput, optFns ...func(*Options)) (*DeleteAccessControlRuleOutput, error) { + if params == nil { + params = &DeleteAccessControlRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAccessControlRule", params, optFns, addOperationDeleteAccessControlRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAccessControlRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAccessControlRuleInput struct { + + // The name of the access control rule. + // + // This member is required. + Name *string + + // The identifier for the organization. + // + // This member is required. + OrganizationId *string +} + +type DeleteAccessControlRuleOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteAccessControlRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteAccessControlRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteAccessControlRule{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteAccessControlRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAccessControlRule(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDeleteAccessControlRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "DeleteAccessControlRule", + } +} diff --git a/service/workmail/api_op_DeleteMailboxPermissions.go b/service/workmail/api_op_DeleteMailboxPermissions.go index 5ffd6eb3085..f083b66bcbe 100644 --- a/service/workmail/api_op_DeleteMailboxPermissions.go +++ b/service/workmail/api_op_DeleteMailboxPermissions.go @@ -28,7 +28,7 @@ func (c *Client) DeleteMailboxPermissions(ctx context.Context, params *DeleteMai type DeleteMailboxPermissionsInput struct { - // The identifier of the member (user or group)that owns the mailbox. + // The identifier of the member (user or group) that owns the mailbox. // // This member is required. EntityId *string diff --git a/service/workmail/api_op_DeleteOrganization.go b/service/workmail/api_op_DeleteOrganization.go new file mode 100644 index 00000000000..522d17770f9 --- /dev/null +++ b/service/workmail/api_op_DeleteOrganization.go @@ -0,0 +1,166 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an Amazon WorkMail organization and all underlying AWS resources managed +// by Amazon WorkMail as part of the organization. You can choose whether to delete +// the associated directory. For more information, see Removing an organization +// (https://docs.aws.amazon.com/workmail/latest/adminguide/remove_organization.html) +// in the Amazon WorkMail Administrator Guide. +func (c *Client) DeleteOrganization(ctx context.Context, params *DeleteOrganizationInput, optFns ...func(*Options)) (*DeleteOrganizationOutput, error) { + if params == nil { + params = &DeleteOrganizationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteOrganization", params, optFns, addOperationDeleteOrganizationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteOrganizationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteOrganizationInput struct { + + // If true, deletes the AWS Directory Service directory associated with the + // organization. + // + // This member is required. + DeleteDirectory bool + + // The organization ID. + // + // This member is required. + OrganizationId *string + + // The idempotency token associated with the request. + ClientToken *string +} + +type DeleteOrganizationOutput struct { + + // The organization ID. + OrganizationId *string + + // The state of the organization. + State *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteOrganizationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteOrganization{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteOrganization{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opDeleteOrganizationMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteOrganizationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteOrganization(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpDeleteOrganization struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpDeleteOrganization) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpDeleteOrganization) 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.(*DeleteOrganizationInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *DeleteOrganizationInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opDeleteOrganizationMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpDeleteOrganization{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opDeleteOrganization(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "DeleteOrganization", + } +} diff --git a/service/workmail/api_op_DeleteRetentionPolicy.go b/service/workmail/api_op_DeleteRetentionPolicy.go new file mode 100644 index 00000000000..c0775864d1a --- /dev/null +++ b/service/workmail/api_op_DeleteRetentionPolicy.go @@ -0,0 +1,114 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified retention policy from the specified organization. +func (c *Client) DeleteRetentionPolicy(ctx context.Context, params *DeleteRetentionPolicyInput, optFns ...func(*Options)) (*DeleteRetentionPolicyOutput, error) { + if params == nil { + params = &DeleteRetentionPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteRetentionPolicy", params, optFns, addOperationDeleteRetentionPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteRetentionPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteRetentionPolicyInput struct { + + // The retention policy ID. + // + // This member is required. + Id *string + + // The organization ID. + // + // This member is required. + OrganizationId *string +} + +type DeleteRetentionPolicyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDeleteRetentionPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteRetentionPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteRetentionPolicy{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteRetentionPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteRetentionPolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDeleteRetentionPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "DeleteRetentionPolicy", + } +} diff --git a/service/workmail/api_op_DescribeMailboxExportJob.go b/service/workmail/api_op_DescribeMailboxExportJob.go new file mode 100644 index 00000000000..7a8f726de1f --- /dev/null +++ b/service/workmail/api_op_DescribeMailboxExportJob.go @@ -0,0 +1,155 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +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/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Describes the current status of a mailbox export job. +func (c *Client) DescribeMailboxExportJob(ctx context.Context, params *DescribeMailboxExportJobInput, optFns ...func(*Options)) (*DescribeMailboxExportJobOutput, error) { + if params == nil { + params = &DescribeMailboxExportJobInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeMailboxExportJob", params, optFns, addOperationDescribeMailboxExportJobMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeMailboxExportJobOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeMailboxExportJobInput struct { + + // The mailbox export job ID. + // + // This member is required. + JobId *string + + // The organization ID. + // + // This member is required. + OrganizationId *string +} + +type DescribeMailboxExportJobOutput struct { + + // The mailbox export job description. + Description *string + + // The mailbox export job end timestamp. + EndTime *time.Time + + // The identifier of the user or resource associated with the mailbox. + EntityId *string + + // Error information for failed mailbox export jobs. + ErrorInfo *string + + // The estimated progress of the mailbox export job, in percentage points. + EstimatedProgress int32 + + // The Amazon Resource Name (ARN) of the symmetric AWS Key Management Service (AWS + // KMS) key that encrypts the exported mailbox content. + KmsKeyArn *string + + // The ARN of the AWS Identity and Access Management (IAM) role that grants write + // permission to the Amazon Simple Storage Service (Amazon S3) bucket. + RoleArn *string + + // The name of the S3 bucket. + S3BucketName *string + + // The path to the S3 bucket and file that the mailbox export job is exporting to. + S3Path *string + + // The S3 bucket prefix. + S3Prefix *string + + // The mailbox export job start timestamp. + StartTime *time.Time + + // The state of the mailbox export job. + State types.MailboxExportJobState + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationDescribeMailboxExportJobMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeMailboxExportJob{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeMailboxExportJob{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDescribeMailboxExportJobValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMailboxExportJob(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opDescribeMailboxExportJob(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "DescribeMailboxExportJob", + } +} diff --git a/service/workmail/api_op_DescribeOrganization.go b/service/workmail/api_op_DescribeOrganization.go index 7c346f38c82..f8c5b974059 100644 --- a/service/workmail/api_op_DescribeOrganization.go +++ b/service/workmail/api_op_DescribeOrganization.go @@ -38,6 +38,9 @@ type DescribeOrganizationInput struct { type DescribeOrganizationOutput struct { + // The Amazon Resource Name (ARN) of the organization. + ARN *string + // The alias for an organization. Alias *string diff --git a/service/workmail/api_op_DescribeResource.go b/service/workmail/api_op_DescribeResource.go index 208d2a3b8d8..7d4470bb227 100644 --- a/service/workmail/api_op_DescribeResource.go +++ b/service/workmail/api_op_DescribeResource.go @@ -64,8 +64,8 @@ type DescribeResourceOutput struct { // The identifier of the described resource. ResourceId *string - // The state of the resource: enabled (registered to Amazon WorkMail) or disabled - // (deregistered or never registered to WorkMail). + // The state of the resource: enabled (registered to Amazon WorkMail), disabled + // (deregistered or never registered to WorkMail), or deleted. State types.EntityState // The type of the described resource. diff --git a/service/workmail/api_op_GetAccessControlEffect.go b/service/workmail/api_op_GetAccessControlEffect.go new file mode 100644 index 00000000000..a6aa7e5fd2d --- /dev/null +++ b/service/workmail/api_op_GetAccessControlEffect.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +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/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets the effects of an organization's access control rules as they apply to a +// specified IPv4 address, access protocol action, or user ID. +func (c *Client) GetAccessControlEffect(ctx context.Context, params *GetAccessControlEffectInput, optFns ...func(*Options)) (*GetAccessControlEffectOutput, error) { + if params == nil { + params = &GetAccessControlEffectInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetAccessControlEffect", params, optFns, addOperationGetAccessControlEffectMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetAccessControlEffectOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetAccessControlEffectInput struct { + + // The access protocol action. Valid values include ActiveSync, AutoDiscover, EWS, + // IMAP, SMTP, WindowsOutlook, and WebMail. + // + // This member is required. + Action *string + + // The IPv4 address. + // + // This member is required. + IpAddress *string + + // The identifier for the organization. + // + // This member is required. + OrganizationId *string + + // The user ID. + // + // This member is required. + UserId *string +} + +type GetAccessControlEffectOutput struct { + + // The rule effect. + Effect types.AccessControlRuleEffect + + // The rules that match the given parameters, resulting in an effect. + MatchedRules []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetAccessControlEffectMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetAccessControlEffect{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetAccessControlEffect{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetAccessControlEffectValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetAccessControlEffect(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetAccessControlEffect(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "GetAccessControlEffect", + } +} diff --git a/service/workmail/api_op_GetDefaultRetentionPolicy.go b/service/workmail/api_op_GetDefaultRetentionPolicy.go new file mode 100644 index 00000000000..a3ae5c34652 --- /dev/null +++ b/service/workmail/api_op_GetDefaultRetentionPolicy.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +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/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets the default retention policy details for the specified organization. +func (c *Client) GetDefaultRetentionPolicy(ctx context.Context, params *GetDefaultRetentionPolicyInput, optFns ...func(*Options)) (*GetDefaultRetentionPolicyOutput, error) { + if params == nil { + params = &GetDefaultRetentionPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDefaultRetentionPolicy", params, optFns, addOperationGetDefaultRetentionPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDefaultRetentionPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDefaultRetentionPolicyInput struct { + + // The organization ID. + // + // This member is required. + OrganizationId *string +} + +type GetDefaultRetentionPolicyOutput struct { + + // The retention policy description. + Description *string + + // The retention policy folder configurations. + FolderConfigurations []types.FolderConfiguration + + // The retention policy ID. + Id *string + + // The retention policy name. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationGetDefaultRetentionPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetDefaultRetentionPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetDefaultRetentionPolicy{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetDefaultRetentionPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDefaultRetentionPolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opGetDefaultRetentionPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "GetDefaultRetentionPolicy", + } +} diff --git a/service/workmail/api_op_ListAccessControlRules.go b/service/workmail/api_op_ListAccessControlRules.go new file mode 100644 index 00000000000..7f114b74cc4 --- /dev/null +++ b/service/workmail/api_op_ListAccessControlRules.go @@ -0,0 +1,114 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +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/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the access control rules for the specified organization. +func (c *Client) ListAccessControlRules(ctx context.Context, params *ListAccessControlRulesInput, optFns ...func(*Options)) (*ListAccessControlRulesOutput, error) { + if params == nil { + params = &ListAccessControlRulesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAccessControlRules", params, optFns, addOperationListAccessControlRulesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAccessControlRulesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAccessControlRulesInput struct { + + // The identifier for the organization. + // + // This member is required. + OrganizationId *string +} + +type ListAccessControlRulesOutput struct { + + // The access control rules. + Rules []types.AccessControlRule + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListAccessControlRulesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListAccessControlRules{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListAccessControlRules{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListAccessControlRulesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAccessControlRules(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opListAccessControlRules(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "ListAccessControlRules", + } +} diff --git a/service/workmail/api_op_ListMailboxExportJobs.go b/service/workmail/api_op_ListMailboxExportJobs.go new file mode 100644 index 00000000000..d8fa1ca9f0a --- /dev/null +++ b/service/workmail/api_op_ListMailboxExportJobs.go @@ -0,0 +1,212 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +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/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the mailbox export jobs started for the specified organization within the +// last seven days. +func (c *Client) ListMailboxExportJobs(ctx context.Context, params *ListMailboxExportJobsInput, optFns ...func(*Options)) (*ListMailboxExportJobsOutput, error) { + if params == nil { + params = &ListMailboxExportJobsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListMailboxExportJobs", params, optFns, addOperationListMailboxExportJobsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListMailboxExportJobsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListMailboxExportJobsInput struct { + + // The organization ID. + // + // This member is required. + OrganizationId *string + + // The maximum number of results to return in a single call. + MaxResults *int32 + + // The token to use to retrieve the next page of results. + NextToken *string +} + +type ListMailboxExportJobsOutput struct { + + // The mailbox export job details. + Jobs []types.MailboxExportJob + + // The token to use to retrieve the next page of results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListMailboxExportJobsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListMailboxExportJobs{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListMailboxExportJobs{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListMailboxExportJobsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListMailboxExportJobs(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListMailboxExportJobsAPIClient is a client that implements the +// ListMailboxExportJobs operation. +type ListMailboxExportJobsAPIClient interface { + ListMailboxExportJobs(context.Context, *ListMailboxExportJobsInput, ...func(*Options)) (*ListMailboxExportJobsOutput, error) +} + +var _ ListMailboxExportJobsAPIClient = (*Client)(nil) + +// ListMailboxExportJobsPaginatorOptions is the paginator options for +// ListMailboxExportJobs +type ListMailboxExportJobsPaginatorOptions struct { + // The maximum number of results to return in a single call. + 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 +} + +// ListMailboxExportJobsPaginator is a paginator for ListMailboxExportJobs +type ListMailboxExportJobsPaginator struct { + options ListMailboxExportJobsPaginatorOptions + client ListMailboxExportJobsAPIClient + params *ListMailboxExportJobsInput + nextToken *string + firstPage bool +} + +// NewListMailboxExportJobsPaginator returns a new ListMailboxExportJobsPaginator +func NewListMailboxExportJobsPaginator(client ListMailboxExportJobsAPIClient, params *ListMailboxExportJobsInput, optFns ...func(*ListMailboxExportJobsPaginatorOptions)) *ListMailboxExportJobsPaginator { + options := ListMailboxExportJobsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + if params == nil { + params = &ListMailboxExportJobsInput{} + } + + return &ListMailboxExportJobsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMailboxExportJobsPaginator) HasMorePages() bool { + return p.firstPage || p.nextToken != nil +} + +// NextPage retrieves the next ListMailboxExportJobs page. +func (p *ListMailboxExportJobsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMailboxExportJobsOutput, 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.ListMailboxExportJobs(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListMailboxExportJobs(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "ListMailboxExportJobs", + } +} diff --git a/service/workmail/api_op_ListOrganizations.go b/service/workmail/api_op_ListOrganizations.go index bd36b7d1bcf..4c6e87063e0 100644 --- a/service/workmail/api_op_ListOrganizations.go +++ b/service/workmail/api_op_ListOrganizations.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns summaries of the customer's non-deleted organizations. +// Returns summaries of the customer's organizations. func (c *Client) ListOrganizations(ctx context.Context, params *ListOrganizationsInput, optFns ...func(*Options)) (*ListOrganizationsOutput, error) { if params == nil { params = &ListOrganizationsInput{} diff --git a/service/workmail/api_op_ListTagsForResource.go b/service/workmail/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..10bbe19e178 --- /dev/null +++ b/service/workmail/api_op_ListTagsForResource.go @@ -0,0 +1,114 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +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/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the tags applied to an Amazon WorkMail organization 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, addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The resource ARN. + // + // This member is required. + ResourceARN *string +} + +type ListTagsForResourceOutput struct { + + // A list of tag key-value pairs. + Tags []types.Tag + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "workmail", + OperationName: "ListTagsForResource", + } +} diff --git a/service/workmail/api_op_PutAccessControlRule.go b/service/workmail/api_op_PutAccessControlRule.go new file mode 100644 index 00000000000..adcd1002d6e --- /dev/null +++ b/service/workmail/api_op_PutAccessControlRule.go @@ -0,0 +1,148 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +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/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Adds a new access control rule for the specified organization. The rule allows +// or denies access to the organization for the specified IPv4 addresses, access +// protocol actions, and user IDs. Adding a new rule with the same name as an +// existing rule replaces the older rule. +func (c *Client) PutAccessControlRule(ctx context.Context, params *PutAccessControlRuleInput, optFns ...func(*Options)) (*PutAccessControlRuleOutput, error) { + if params == nil { + params = &PutAccessControlRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutAccessControlRule", params, optFns, addOperationPutAccessControlRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutAccessControlRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutAccessControlRuleInput struct { + + // The rule description. + // + // This member is required. + Description *string + + // The rule effect. + // + // This member is required. + Effect types.AccessControlRuleEffect + + // The rule name. + // + // This member is required. + Name *string + + // The identifier of the organization. + // + // This member is required. + OrganizationId *string + + // Access protocol actions to include in the rule. Valid values include ActiveSync, + // AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail. + Actions []string + + // IPv4 CIDR ranges to include in the rule. + IpRanges []string + + // Access protocol actions to exclude from the rule. Valid values include + // ActiveSync, AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail. + NotActions []string + + // IPv4 CIDR ranges to exclude from the rule. + NotIpRanges []string + + // User IDs to exclude from the rule. + NotUserIds []string + + // User IDs to include in the rule. + UserIds []string +} + +type PutAccessControlRuleOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationPutAccessControlRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutAccessControlRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutAccessControlRule{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutAccessControlRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutAccessControlRule(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opPutAccessControlRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "PutAccessControlRule", + } +} diff --git a/service/workmail/api_op_PutRetentionPolicy.go b/service/workmail/api_op_PutRetentionPolicy.go new file mode 100644 index 00000000000..2a0ae7d53aa --- /dev/null +++ b/service/workmail/api_op_PutRetentionPolicy.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +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/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Puts a retention policy to the specified organization. +func (c *Client) PutRetentionPolicy(ctx context.Context, params *PutRetentionPolicyInput, optFns ...func(*Options)) (*PutRetentionPolicyOutput, error) { + if params == nil { + params = &PutRetentionPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutRetentionPolicy", params, optFns, addOperationPutRetentionPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutRetentionPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutRetentionPolicyInput struct { + + // The retention policy folder configurations. + // + // This member is required. + FolderConfigurations []types.FolderConfiguration + + // The retention policy name. + // + // This member is required. + Name *string + + // The organization ID. + // + // This member is required. + OrganizationId *string + + // The retention policy description. + Description *string + + // The retention policy ID. + Id *string +} + +type PutRetentionPolicyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationPutRetentionPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutRetentionPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutRetentionPolicy{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutRetentionPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutRetentionPolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_opPutRetentionPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "PutRetentionPolicy", + } +} diff --git a/service/workmail/api_op_RegisterToWorkMail.go b/service/workmail/api_op_RegisterToWorkMail.go index e46feefa5d0..7aaf8a62213 100644 --- a/service/workmail/api_op_RegisterToWorkMail.go +++ b/service/workmail/api_op_RegisterToWorkMail.go @@ -14,7 +14,7 @@ import ( // use by associating a mailbox and calendaring capabilities. It performs no change // if the user, group, or resource is enabled and fails if the user, group, or // resource is deleted. This operation results in the accumulation of costs. For -// more information, see Pricing (https://aws.amazon.com//workmail/pricing). The +// more information, see Pricing (https://aws.amazon.com/workmail/pricing). The // equivalent console functionality for this operation is Enable. Users can either // be created by calling the CreateUser API operation or they can be synchronized // from your directory. For more information, see DeregisterFromWorkMail. diff --git a/service/workmail/api_op_StartMailboxExportJob.go b/service/workmail/api_op_StartMailboxExportJob.go new file mode 100644 index 00000000000..7414021f61a --- /dev/null +++ b/service/workmail/api_op_StartMailboxExportJob.go @@ -0,0 +1,189 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Starts a mailbox export job to export MIME-format email messages and calendar +// items from the specified mailbox to the specified Amazon Simple Storage Service +// (Amazon S3) bucket. For more information, see Exporting mailbox content +// (https://docs.aws.amazon.com/workmail/latest/adminguide/mail-export.html) in the +// Amazon WorkMail Administrator Guide. +func (c *Client) StartMailboxExportJob(ctx context.Context, params *StartMailboxExportJobInput, optFns ...func(*Options)) (*StartMailboxExportJobOutput, error) { + if params == nil { + params = &StartMailboxExportJobInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartMailboxExportJob", params, optFns, addOperationStartMailboxExportJobMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartMailboxExportJobOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartMailboxExportJobInput struct { + + // The idempotency token for the client request. + // + // This member is required. + ClientToken *string + + // The identifier of the user or resource associated with the mailbox. + // + // This member is required. + EntityId *string + + // The Amazon Resource Name (ARN) of the symmetric AWS Key Management Service (AWS + // KMS) key that encrypts the exported mailbox content. + // + // This member is required. + KmsKeyArn *string + + // The identifier associated with the organization. + // + // This member is required. + OrganizationId *string + + // The ARN of the AWS Identity and Access Management (IAM) role that grants write + // permission to the S3 bucket. + // + // This member is required. + RoleArn *string + + // The name of the S3 bucket. + // + // This member is required. + S3BucketName *string + + // The S3 bucket prefix. + // + // This member is required. + S3Prefix *string + + // The mailbox export job description. + Description *string +} + +type StartMailboxExportJobOutput struct { + + // The job ID. + JobId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationStartMailboxExportJobMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartMailboxExportJob{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartMailboxExportJob{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opStartMailboxExportJobMiddleware(stack, options); err != nil { + return err + } + if err = addOpStartMailboxExportJobValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartMailboxExportJob(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(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_initializeOpStartMailboxExportJob struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpStartMailboxExportJob) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpStartMailboxExportJob) 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.(*StartMailboxExportJobInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *StartMailboxExportJobInput ") + } + + if input.ClientToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opStartMailboxExportJobMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpStartMailboxExportJob{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opStartMailboxExportJob(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "workmail", + OperationName: "StartMailboxExportJob", + } +} diff --git a/service/workmail/api_op_TagResource.go b/service/workmail/api_op_TagResource.go new file mode 100644 index 00000000000..16c101ff427 --- /dev/null +++ b/service/workmail/api_op_TagResource.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +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/workmail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Applies the specified tags to the specified Amazon WorkMail organization +// resource. +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The resource ARN. + // + // This member is required. + ResourceARN *string + + // The tag key-value pairs. + // + // This member is required. + Tags []types.Tag +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "workmail", + OperationName: "TagResource", + } +} diff --git a/service/workmail/api_op_UntagResource.go b/service/workmail/api_op_UntagResource.go new file mode 100644 index 00000000000..91a07b5a60c --- /dev/null +++ b/service/workmail/api_op_UntagResource.go @@ -0,0 +1,115 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package workmail + +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" +) + +// Untags the specified tags from the specified Amazon WorkMail organization +// resource. +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The resource ARN. + // + // This member is required. + ResourceARN *string + + // The tag keys. + // + // This member is required. + TagKeys []string +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata +} + +func addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddAttemptClockSkewMiddleware(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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 = addRequestIDRetrieverMiddleware(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: "workmail", + OperationName: "UntagResource", + } +} diff --git a/service/workmail/deserializers.go b/service/workmail/deserializers.go index 8ce8023f259..6c9df15d3f1 100644 --- a/service/workmail/deserializers.go +++ b/service/workmail/deserializers.go @@ -274,14 +274,14 @@ func awsAwsjson11_deserializeOpErrorAssociateMemberToGroup(response *smithyhttp. } } -type awsAwsjson11_deserializeOpCreateAlias struct { +type awsAwsjson11_deserializeOpCancelMailboxExportJob struct { } -func (*awsAwsjson11_deserializeOpCreateAlias) ID() string { +func (*awsAwsjson11_deserializeOpCancelMailboxExportJob) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpCreateAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpCancelMailboxExportJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -295,9 +295,9 @@ func (m *awsAwsjson11_deserializeOpCreateAlias) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorCreateAlias(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorCancelMailboxExportJob(response, &metadata) } - output := &CreateAliasOutput{} + output := &CancelMailboxExportJobOutput{} out.Result = output var buff [1024]byte @@ -317,7 +317,7 @@ func (m *awsAwsjson11_deserializeOpCreateAlias) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentCreateAliasOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentCancelMailboxExportJobOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -331,7 +331,7 @@ func (m *awsAwsjson11_deserializeOpCreateAlias) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorCreateAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorCancelMailboxExportJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -372,24 +372,12 @@ func awsAwsjson11_deserializeOpErrorCreateAlias(response *smithyhttp.Response, m } switch { - case strings.EqualFold("EmailAddressInUseException", errorCode): - return awsAwsjson11_deserializeErrorEmailAddressInUseException(response, errorBody) - case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("MailDomainNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorMailDomainNotFoundException(response, errorBody) - - case strings.EqualFold("MailDomainStateException", errorCode): - return awsAwsjson11_deserializeErrorMailDomainStateException(response, errorBody) - case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -406,14 +394,14 @@ func awsAwsjson11_deserializeOpErrorCreateAlias(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpCreateGroup struct { +type awsAwsjson11_deserializeOpCreateAlias struct { } -func (*awsAwsjson11_deserializeOpCreateGroup) ID() string { +func (*awsAwsjson11_deserializeOpCreateAlias) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpCreateGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpCreateAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -427,9 +415,9 @@ func (m *awsAwsjson11_deserializeOpCreateGroup) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorCreateGroup(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorCreateAlias(response, &metadata) } - output := &CreateGroupOutput{} + output := &CreateAliasOutput{} out.Result = output var buff [1024]byte @@ -449,7 +437,7 @@ func (m *awsAwsjson11_deserializeOpCreateGroup) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentCreateGroupOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentCreateAliasOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -463,7 +451,7 @@ func (m *awsAwsjson11_deserializeOpCreateGroup) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorCreateGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorCreateAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -504,17 +492,26 @@ func awsAwsjson11_deserializeOpErrorCreateGroup(response *smithyhttp.Response, m } switch { - case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) + case strings.EqualFold("EmailAddressInUseException", errorCode): + return awsAwsjson11_deserializeErrorEmailAddressInUseException(response, errorBody) - case strings.EqualFold("DirectoryUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("NameAvailabilityException", errorCode): - return awsAwsjson11_deserializeErrorNameAvailabilityException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("MailDomainNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorMailDomainNotFoundException(response, errorBody) + + case strings.EqualFold("MailDomainStateException", errorCode): + return awsAwsjson11_deserializeErrorMailDomainStateException(response, errorBody) case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -522,12 +519,6 @@ func awsAwsjson11_deserializeOpErrorCreateGroup(response *smithyhttp.Response, m case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - case strings.EqualFold("ReservedNameException", errorCode): - return awsAwsjson11_deserializeErrorReservedNameException(response, errorBody) - - case strings.EqualFold("UnsupportedOperationException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -538,14 +529,14 @@ func awsAwsjson11_deserializeOpErrorCreateGroup(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpCreateResource struct { +type awsAwsjson11_deserializeOpCreateGroup struct { } -func (*awsAwsjson11_deserializeOpCreateResource) ID() string { +func (*awsAwsjson11_deserializeOpCreateGroup) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpCreateResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpCreateGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -559,9 +550,9 @@ func (m *awsAwsjson11_deserializeOpCreateResource) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorCreateResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorCreateGroup(response, &metadata) } - output := &CreateResourceOutput{} + output := &CreateGroupOutput{} out.Result = output var buff [1024]byte @@ -581,7 +572,7 @@ func (m *awsAwsjson11_deserializeOpCreateResource) HandleDeserialize(ctx context return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentCreateResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentCreateGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -595,7 +586,7 @@ func (m *awsAwsjson11_deserializeOpCreateResource) HandleDeserialize(ctx context return out, metadata, err } -func awsAwsjson11_deserializeOpErrorCreateResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorCreateGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -657,6 +648,9 @@ func awsAwsjson11_deserializeOpErrorCreateResource(response *smithyhttp.Response case strings.EqualFold("ReservedNameException", errorCode): return awsAwsjson11_deserializeErrorReservedNameException(response, errorBody) + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -667,14 +661,14 @@ func awsAwsjson11_deserializeOpErrorCreateResource(response *smithyhttp.Response } } -type awsAwsjson11_deserializeOpCreateUser struct { +type awsAwsjson11_deserializeOpCreateOrganization struct { } -func (*awsAwsjson11_deserializeOpCreateUser) ID() string { +func (*awsAwsjson11_deserializeOpCreateOrganization) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpCreateUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpCreateOrganization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -688,9 +682,9 @@ func (m *awsAwsjson11_deserializeOpCreateUser) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorCreateUser(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorCreateOrganization(response, &metadata) } - output := &CreateUserOutput{} + output := &CreateOrganizationOutput{} out.Result = output var buff [1024]byte @@ -710,7 +704,7 @@ func (m *awsAwsjson11_deserializeOpCreateUser) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentCreateUserOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentCreateOrganizationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -724,7 +718,7 @@ func (m *awsAwsjson11_deserializeOpCreateUser) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorCreateUser(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorCreateOrganization(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -765,8 +759,8 @@ func awsAwsjson11_deserializeOpErrorCreateUser(response *smithyhttp.Response, me } switch { - case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) + case strings.EqualFold("DirectoryInUseException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryInUseException(response, errorBody) case strings.EqualFold("DirectoryUnavailableException", errorCode): return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) @@ -774,24 +768,12 @@ func awsAwsjson11_deserializeOpErrorCreateUser(response *smithyhttp.Response, me case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("InvalidPasswordException", errorCode): - return awsAwsjson11_deserializeErrorInvalidPasswordException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("NameAvailabilityException", errorCode): return awsAwsjson11_deserializeErrorNameAvailabilityException(response, errorBody) - case strings.EqualFold("OrganizationNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) - - case strings.EqualFold("OrganizationStateException", errorCode): - return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - - case strings.EqualFold("ReservedNameException", errorCode): - return awsAwsjson11_deserializeErrorReservedNameException(response, errorBody) - - case strings.EqualFold("UnsupportedOperationException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -802,14 +784,14 @@ func awsAwsjson11_deserializeOpErrorCreateUser(response *smithyhttp.Response, me } } -type awsAwsjson11_deserializeOpDeleteAlias struct { +type awsAwsjson11_deserializeOpCreateResource struct { } -func (*awsAwsjson11_deserializeOpDeleteAlias) ID() string { +func (*awsAwsjson11_deserializeOpCreateResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpCreateResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -823,9 +805,9 @@ func (m *awsAwsjson11_deserializeOpDeleteAlias) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteAlias(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorCreateResource(response, &metadata) } - output := &DeleteAliasOutput{} + output := &CreateResourceOutput{} out.Result = output var buff [1024]byte @@ -845,7 +827,7 @@ func (m *awsAwsjson11_deserializeOpDeleteAlias) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeleteAliasOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentCreateResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -859,7 +841,7 @@ func (m *awsAwsjson11_deserializeOpDeleteAlias) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorCreateResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -900,21 +882,27 @@ func awsAwsjson11_deserializeOpErrorDeleteAlias(response *smithyhttp.Response, m } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + case strings.EqualFold("DirectoryUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("NameAvailabilityException", errorCode): + return awsAwsjson11_deserializeErrorNameAvailabilityException(response, errorBody) + case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("ReservedNameException", errorCode): + return awsAwsjson11_deserializeErrorReservedNameException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -925,14 +913,14 @@ func awsAwsjson11_deserializeOpErrorDeleteAlias(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpDeleteGroup struct { +type awsAwsjson11_deserializeOpCreateUser struct { } -func (*awsAwsjson11_deserializeOpDeleteGroup) ID() string { +func (*awsAwsjson11_deserializeOpCreateUser) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpCreateUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -946,9 +934,9 @@ func (m *awsAwsjson11_deserializeOpDeleteGroup) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteGroup(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorCreateUser(response, &metadata) } - output := &DeleteGroupOutput{} + output := &CreateUserOutput{} out.Result = output var buff [1024]byte @@ -968,7 +956,7 @@ func (m *awsAwsjson11_deserializeOpDeleteGroup) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeleteGroupOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentCreateUserOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -982,7 +970,7 @@ func (m *awsAwsjson11_deserializeOpDeleteGroup) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorCreateUser(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1029,18 +1017,24 @@ func awsAwsjson11_deserializeOpErrorDeleteGroup(response *smithyhttp.Response, m case strings.EqualFold("DirectoryUnavailableException", errorCode): return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("InvalidPasswordException", errorCode): + return awsAwsjson11_deserializeErrorInvalidPasswordException(response, errorBody) + + case strings.EqualFold("NameAvailabilityException", errorCode): + return awsAwsjson11_deserializeErrorNameAvailabilityException(response, errorBody) + case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("ReservedNameException", errorCode): + return awsAwsjson11_deserializeErrorReservedNameException(response, errorBody) + case strings.EqualFold("UnsupportedOperationException", errorCode): return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) @@ -1054,14 +1048,14 @@ func awsAwsjson11_deserializeOpErrorDeleteGroup(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpDeleteMailboxPermissions struct { +type awsAwsjson11_deserializeOpDeleteAccessControlRule struct { } -func (*awsAwsjson11_deserializeOpDeleteMailboxPermissions) ID() string { +func (*awsAwsjson11_deserializeOpDeleteAccessControlRule) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteMailboxPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteAccessControlRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1075,9 +1069,9 @@ func (m *awsAwsjson11_deserializeOpDeleteMailboxPermissions) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteMailboxPermissions(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteAccessControlRule(response, &metadata) } - output := &DeleteMailboxPermissionsOutput{} + output := &DeleteAccessControlRuleOutput{} out.Result = output var buff [1024]byte @@ -1097,7 +1091,7 @@ func (m *awsAwsjson11_deserializeOpDeleteMailboxPermissions) HandleDeserialize(c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeleteMailboxPermissionsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteAccessControlRuleOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1111,7 +1105,7 @@ func (m *awsAwsjson11_deserializeOpDeleteMailboxPermissions) HandleDeserialize(c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteMailboxPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteAccessControlRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1152,15 +1146,6 @@ func awsAwsjson11_deserializeOpErrorDeleteMailboxPermissions(response *smithyhtt } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -1177,14 +1162,14 @@ func awsAwsjson11_deserializeOpErrorDeleteMailboxPermissions(response *smithyhtt } } -type awsAwsjson11_deserializeOpDeleteResource struct { +type awsAwsjson11_deserializeOpDeleteAlias struct { } -func (*awsAwsjson11_deserializeOpDeleteResource) ID() string { +func (*awsAwsjson11_deserializeOpDeleteAlias) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1198,9 +1183,9 @@ func (m *awsAwsjson11_deserializeOpDeleteResource) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteAlias(response, &metadata) } - output := &DeleteResourceOutput{} + output := &DeleteAliasOutput{} out.Result = output var buff [1024]byte @@ -1220,7 +1205,7 @@ func (m *awsAwsjson11_deserializeOpDeleteResource) HandleDeserialize(ctx context return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeleteResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteAliasOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1234,7 +1219,7 @@ func (m *awsAwsjson11_deserializeOpDeleteResource) HandleDeserialize(ctx context return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1275,6 +1260,9 @@ func awsAwsjson11_deserializeOpErrorDeleteResource(response *smithyhttp.Response } switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + case strings.EqualFold("EntityStateException", errorCode): return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) @@ -1297,14 +1285,14 @@ func awsAwsjson11_deserializeOpErrorDeleteResource(response *smithyhttp.Response } } -type awsAwsjson11_deserializeOpDeleteUser struct { +type awsAwsjson11_deserializeOpDeleteGroup struct { } -func (*awsAwsjson11_deserializeOpDeleteUser) ID() string { +func (*awsAwsjson11_deserializeOpDeleteGroup) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1318,9 +1306,9 @@ func (m *awsAwsjson11_deserializeOpDeleteUser) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteUser(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteGroup(response, &metadata) } - output := &DeleteUserOutput{} + output := &DeleteGroupOutput{} out.Result = output var buff [1024]byte @@ -1340,7 +1328,7 @@ func (m *awsAwsjson11_deserializeOpDeleteUser) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeleteUserOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1354,7 +1342,7 @@ func (m *awsAwsjson11_deserializeOpDeleteUser) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteUser(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1426,14 +1414,14 @@ func awsAwsjson11_deserializeOpErrorDeleteUser(response *smithyhttp.Response, me } } -type awsAwsjson11_deserializeOpDeregisterFromWorkMail struct { +type awsAwsjson11_deserializeOpDeleteMailboxPermissions struct { } -func (*awsAwsjson11_deserializeOpDeregisterFromWorkMail) ID() string { +func (*awsAwsjson11_deserializeOpDeleteMailboxPermissions) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeregisterFromWorkMail) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteMailboxPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1447,9 +1435,9 @@ func (m *awsAwsjson11_deserializeOpDeregisterFromWorkMail) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeregisterFromWorkMail(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteMailboxPermissions(response, &metadata) } - output := &DeregisterFromWorkMailOutput{} + output := &DeleteMailboxPermissionsOutput{} out.Result = output var buff [1024]byte @@ -1469,7 +1457,7 @@ func (m *awsAwsjson11_deserializeOpDeregisterFromWorkMail) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDeregisterFromWorkMailOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteMailboxPermissionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1483,7 +1471,7 @@ func (m *awsAwsjson11_deserializeOpDeregisterFromWorkMail) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeregisterFromWorkMail(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteMailboxPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1549,14 +1537,14 @@ func awsAwsjson11_deserializeOpErrorDeregisterFromWorkMail(response *smithyhttp. } } -type awsAwsjson11_deserializeOpDescribeGroup struct { +type awsAwsjson11_deserializeOpDeleteOrganization struct { } -func (*awsAwsjson11_deserializeOpDescribeGroup) ID() string { +func (*awsAwsjson11_deserializeOpDeleteOrganization) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteOrganization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1570,9 +1558,9 @@ func (m *awsAwsjson11_deserializeOpDescribeGroup) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeGroup(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteOrganization(response, &metadata) } - output := &DescribeGroupOutput{} + output := &DeleteOrganizationOutput{} out.Result = output var buff [1024]byte @@ -1592,7 +1580,7 @@ func (m *awsAwsjson11_deserializeOpDescribeGroup) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeGroupOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteOrganizationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1606,7 +1594,7 @@ func (m *awsAwsjson11_deserializeOpDescribeGroup) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteOrganization(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1647,9 +1635,6 @@ func awsAwsjson11_deserializeOpErrorDescribeGroup(response *smithyhttp.Response, } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -1669,14 +1654,14 @@ func awsAwsjson11_deserializeOpErrorDescribeGroup(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpDescribeOrganization struct { +type awsAwsjson11_deserializeOpDeleteResource struct { } -func (*awsAwsjson11_deserializeOpDescribeOrganization) ID() string { +func (*awsAwsjson11_deserializeOpDeleteResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeOrganization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1690,9 +1675,9 @@ func (m *awsAwsjson11_deserializeOpDescribeOrganization) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeOrganization(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteResource(response, &metadata) } - output := &DescribeOrganizationOutput{} + output := &DeleteResourceOutput{} out.Result = output var buff [1024]byte @@ -1712,7 +1697,7 @@ func (m *awsAwsjson11_deserializeOpDescribeOrganization) HandleDeserialize(ctx c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeOrganizationOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1726,7 +1711,7 @@ func (m *awsAwsjson11_deserializeOpDescribeOrganization) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeOrganization(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1767,12 +1752,18 @@ func awsAwsjson11_deserializeOpErrorDescribeOrganization(response *smithyhttp.Re } switch { + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1783,14 +1774,14 @@ func awsAwsjson11_deserializeOpErrorDescribeOrganization(response *smithyhttp.Re } } -type awsAwsjson11_deserializeOpDescribeResource struct { +type awsAwsjson11_deserializeOpDeleteRetentionPolicy struct { } -func (*awsAwsjson11_deserializeOpDescribeResource) ID() string { +func (*awsAwsjson11_deserializeOpDeleteRetentionPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteRetentionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1804,9 +1795,9 @@ func (m *awsAwsjson11_deserializeOpDescribeResource) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteRetentionPolicy(response, &metadata) } - output := &DescribeResourceOutput{} + output := &DeleteRetentionPolicyOutput{} out.Result = output var buff [1024]byte @@ -1826,7 +1817,7 @@ func (m *awsAwsjson11_deserializeOpDescribeResource) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteRetentionPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1840,7 +1831,7 @@ func (m *awsAwsjson11_deserializeOpDescribeResource) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteRetentionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1881,9 +1872,6 @@ func awsAwsjson11_deserializeOpErrorDescribeResource(response *smithyhttp.Respon } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -1903,14 +1891,14 @@ func awsAwsjson11_deserializeOpErrorDescribeResource(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpDescribeUser struct { +type awsAwsjson11_deserializeOpDeleteUser struct { } -func (*awsAwsjson11_deserializeOpDescribeUser) ID() string { +func (*awsAwsjson11_deserializeOpDeleteUser) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1924,9 +1912,9 @@ func (m *awsAwsjson11_deserializeOpDescribeUser) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeUser(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteUser(response, &metadata) } - output := &DescribeUserOutput{} + output := &DeleteUserOutput{} out.Result = output var buff [1024]byte @@ -1946,7 +1934,7 @@ func (m *awsAwsjson11_deserializeOpDescribeUser) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeUserOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteUserOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1960,7 +1948,7 @@ func (m *awsAwsjson11_deserializeOpDescribeUser) HandleDeserialize(ctx context.C return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeUser(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteUser(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2001,8 +1989,14 @@ func awsAwsjson11_deserializeOpErrorDescribeUser(response *smithyhttp.Response, } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) + + case strings.EqualFold("DirectoryUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2013,6 +2007,9 @@ func awsAwsjson11_deserializeOpErrorDescribeUser(response *smithyhttp.Response, case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2023,14 +2020,14 @@ func awsAwsjson11_deserializeOpErrorDescribeUser(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpDisassociateDelegateFromResource struct { +type awsAwsjson11_deserializeOpDeregisterFromWorkMail struct { } -func (*awsAwsjson11_deserializeOpDisassociateDelegateFromResource) ID() string { +func (*awsAwsjson11_deserializeOpDeregisterFromWorkMail) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDisassociateDelegateFromResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeregisterFromWorkMail) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2044,9 +2041,9 @@ func (m *awsAwsjson11_deserializeOpDisassociateDelegateFromResource) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDisassociateDelegateFromResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeregisterFromWorkMail(response, &metadata) } - output := &DisassociateDelegateFromResourceOutput{} + output := &DeregisterFromWorkMailOutput{} out.Result = output var buff [1024]byte @@ -2066,7 +2063,7 @@ func (m *awsAwsjson11_deserializeOpDisassociateDelegateFromResource) HandleDeser return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDisassociateDelegateFromResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeregisterFromWorkMailOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2080,7 +2077,7 @@ func (m *awsAwsjson11_deserializeOpDisassociateDelegateFromResource) HandleDeser return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDisassociateDelegateFromResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeregisterFromWorkMail(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2146,14 +2143,14 @@ func awsAwsjson11_deserializeOpErrorDisassociateDelegateFromResource(response *s } } -type awsAwsjson11_deserializeOpDisassociateMemberFromGroup struct { +type awsAwsjson11_deserializeOpDescribeGroup struct { } -func (*awsAwsjson11_deserializeOpDisassociateMemberFromGroup) ID() string { +func (*awsAwsjson11_deserializeOpDescribeGroup) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDisassociateMemberFromGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2167,9 +2164,9 @@ func (m *awsAwsjson11_deserializeOpDisassociateMemberFromGroup) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDisassociateMemberFromGroup(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeGroup(response, &metadata) } - output := &DisassociateMemberFromGroupOutput{} + output := &DescribeGroupOutput{} out.Result = output var buff [1024]byte @@ -2189,7 +2186,7 @@ func (m *awsAwsjson11_deserializeOpDisassociateMemberFromGroup) HandleDeserializ return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDisassociateMemberFromGroupOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2203,7 +2200,7 @@ func (m *awsAwsjson11_deserializeOpDisassociateMemberFromGroup) HandleDeserializ return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDisassociateMemberFromGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2244,18 +2241,9 @@ func awsAwsjson11_deserializeOpErrorDisassociateMemberFromGroup(response *smithy } switch { - case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) - - case strings.EqualFold("DirectoryUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) - case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2265,9 +2253,6 @@ func awsAwsjson11_deserializeOpErrorDisassociateMemberFromGroup(response *smithy case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - case strings.EqualFold("UnsupportedOperationException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2278,14 +2263,14 @@ func awsAwsjson11_deserializeOpErrorDisassociateMemberFromGroup(response *smithy } } -type awsAwsjson11_deserializeOpGetMailboxDetails struct { +type awsAwsjson11_deserializeOpDescribeMailboxExportJob struct { } -func (*awsAwsjson11_deserializeOpGetMailboxDetails) ID() string { +func (*awsAwsjson11_deserializeOpDescribeMailboxExportJob) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetMailboxDetails) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeMailboxExportJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2299,9 +2284,9 @@ func (m *awsAwsjson11_deserializeOpGetMailboxDetails) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetMailboxDetails(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeMailboxExportJob(response, &metadata) } - output := &GetMailboxDetailsOutput{} + output := &DescribeMailboxExportJobOutput{} out.Result = output var buff [1024]byte @@ -2321,7 +2306,7 @@ func (m *awsAwsjson11_deserializeOpGetMailboxDetails) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetMailboxDetailsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeMailboxExportJobOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2335,7 +2320,7 @@ func (m *awsAwsjson11_deserializeOpGetMailboxDetails) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetMailboxDetails(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeMailboxExportJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2379,6 +2364,9 @@ func awsAwsjson11_deserializeOpErrorGetMailboxDetails(response *smithyhttp.Respo case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -2395,14 +2383,14 @@ func awsAwsjson11_deserializeOpErrorGetMailboxDetails(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpListAliases struct { +type awsAwsjson11_deserializeOpDescribeOrganization struct { } -func (*awsAwsjson11_deserializeOpListAliases) ID() string { +func (*awsAwsjson11_deserializeOpDescribeOrganization) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListAliases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeOrganization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2416,9 +2404,9 @@ func (m *awsAwsjson11_deserializeOpListAliases) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListAliases(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeOrganization(response, &metadata) } - output := &ListAliasesOutput{} + output := &DescribeOrganizationOutput{} out.Result = output var buff [1024]byte @@ -2438,7 +2426,7 @@ func (m *awsAwsjson11_deserializeOpListAliases) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListAliasesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeOrganizationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2452,7 +2440,7 @@ func (m *awsAwsjson11_deserializeOpListAliases) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListAliases(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeOrganization(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2493,21 +2481,12 @@ func awsAwsjson11_deserializeOpErrorListAliases(response *smithyhttp.Response, m } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) - case strings.EqualFold("OrganizationStateException", errorCode): - return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2518,14 +2497,14 @@ func awsAwsjson11_deserializeOpErrorListAliases(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpListGroupMembers struct { +type awsAwsjson11_deserializeOpDescribeResource struct { } -func (*awsAwsjson11_deserializeOpListGroupMembers) ID() string { +func (*awsAwsjson11_deserializeOpDescribeResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListGroupMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2539,9 +2518,9 @@ func (m *awsAwsjson11_deserializeOpListGroupMembers) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListGroupMembers(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeResource(response, &metadata) } - output := &ListGroupMembersOutput{} + output := &DescribeResourceOutput{} out.Result = output var buff [1024]byte @@ -2561,7 +2540,7 @@ func (m *awsAwsjson11_deserializeOpListGroupMembers) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListGroupMembersOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2575,7 +2554,7 @@ func (m *awsAwsjson11_deserializeOpListGroupMembers) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListGroupMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2619,9 +2598,6 @@ func awsAwsjson11_deserializeOpErrorListGroupMembers(response *smithyhttp.Respon case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2641,14 +2617,14 @@ func awsAwsjson11_deserializeOpErrorListGroupMembers(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpListGroups struct { +type awsAwsjson11_deserializeOpDescribeUser struct { } -func (*awsAwsjson11_deserializeOpListGroups) ID() string { +func (*awsAwsjson11_deserializeOpDescribeUser) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeUser) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2662,9 +2638,9 @@ func (m *awsAwsjson11_deserializeOpListGroups) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListGroups(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeUser(response, &metadata) } - output := &ListGroupsOutput{} + output := &DescribeUserOutput{} out.Result = output var buff [1024]byte @@ -2684,7 +2660,7 @@ func (m *awsAwsjson11_deserializeOpListGroups) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListGroupsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeUserOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2698,7 +2674,7 @@ func (m *awsAwsjson11_deserializeOpListGroups) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeUser(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2761,14 +2737,14 @@ func awsAwsjson11_deserializeOpErrorListGroups(response *smithyhttp.Response, me } } -type awsAwsjson11_deserializeOpListMailboxPermissions struct { +type awsAwsjson11_deserializeOpDisassociateDelegateFromResource struct { } -func (*awsAwsjson11_deserializeOpListMailboxPermissions) ID() string { +func (*awsAwsjson11_deserializeOpDisassociateDelegateFromResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListMailboxPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDisassociateDelegateFromResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2782,9 +2758,9 @@ func (m *awsAwsjson11_deserializeOpListMailboxPermissions) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListMailboxPermissions(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDisassociateDelegateFromResource(response, &metadata) } - output := &ListMailboxPermissionsOutput{} + output := &DisassociateDelegateFromResourceOutput{} out.Result = output var buff [1024]byte @@ -2804,7 +2780,7 @@ func (m *awsAwsjson11_deserializeOpListMailboxPermissions) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListMailboxPermissionsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDisassociateDelegateFromResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2818,7 +2794,7 @@ func (m *awsAwsjson11_deserializeOpListMailboxPermissions) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListMailboxPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDisassociateDelegateFromResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2862,6 +2838,9 @@ func awsAwsjson11_deserializeOpErrorListMailboxPermissions(response *smithyhttp. case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -2881,14 +2860,14 @@ func awsAwsjson11_deserializeOpErrorListMailboxPermissions(response *smithyhttp. } } -type awsAwsjson11_deserializeOpListOrganizations struct { +type awsAwsjson11_deserializeOpDisassociateMemberFromGroup struct { } -func (*awsAwsjson11_deserializeOpListOrganizations) ID() string { +func (*awsAwsjson11_deserializeOpDisassociateMemberFromGroup) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListOrganizations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDisassociateMemberFromGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2902,9 +2881,9 @@ func (m *awsAwsjson11_deserializeOpListOrganizations) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListOrganizations(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDisassociateMemberFromGroup(response, &metadata) } - output := &ListOrganizationsOutput{} + output := &DisassociateMemberFromGroupOutput{} out.Result = output var buff [1024]byte @@ -2924,7 +2903,7 @@ func (m *awsAwsjson11_deserializeOpListOrganizations) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListOrganizationsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDisassociateMemberFromGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2938,7 +2917,7 @@ func (m *awsAwsjson11_deserializeOpListOrganizations) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListOrganizations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDisassociateMemberFromGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2979,9 +2958,30 @@ func awsAwsjson11_deserializeOpErrorListOrganizations(response *smithyhttp.Respo } switch { + case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) + + case strings.EqualFold("DirectoryUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) + + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2992,14 +2992,14 @@ func awsAwsjson11_deserializeOpErrorListOrganizations(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpListResourceDelegates struct { +type awsAwsjson11_deserializeOpGetAccessControlEffect struct { } -func (*awsAwsjson11_deserializeOpListResourceDelegates) ID() string { +func (*awsAwsjson11_deserializeOpGetAccessControlEffect) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListResourceDelegates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetAccessControlEffect) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3013,9 +3013,9 @@ func (m *awsAwsjson11_deserializeOpListResourceDelegates) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListResourceDelegates(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetAccessControlEffect(response, &metadata) } - output := &ListResourceDelegatesOutput{} + output := &GetAccessControlEffectOutput{} out.Result = output var buff [1024]byte @@ -3035,7 +3035,7 @@ func (m *awsAwsjson11_deserializeOpListResourceDelegates) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListResourceDelegatesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetAccessControlEffectOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3049,7 +3049,7 @@ func (m *awsAwsjson11_deserializeOpListResourceDelegates) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListResourceDelegates(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetAccessControlEffect(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3093,9 +3093,6 @@ func awsAwsjson11_deserializeOpErrorListResourceDelegates(response *smithyhttp.R case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -3115,14 +3112,14 @@ func awsAwsjson11_deserializeOpErrorListResourceDelegates(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpListResources struct { +type awsAwsjson11_deserializeOpGetDefaultRetentionPolicy struct { } -func (*awsAwsjson11_deserializeOpListResources) ID() string { +func (*awsAwsjson11_deserializeOpGetDefaultRetentionPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListResources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetDefaultRetentionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3136,9 +3133,9 @@ func (m *awsAwsjson11_deserializeOpListResources) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListResources(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetDefaultRetentionPolicy(response, &metadata) } - output := &ListResourcesOutput{} + output := &GetDefaultRetentionPolicyOutput{} out.Result = output var buff [1024]byte @@ -3158,7 +3155,7 @@ func (m *awsAwsjson11_deserializeOpListResources) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListResourcesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetDefaultRetentionPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3172,7 +3169,7 @@ func (m *awsAwsjson11_deserializeOpListResources) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListResources(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetDefaultRetentionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3213,6 +3210,9 @@ func awsAwsjson11_deserializeOpErrorListResources(response *smithyhttp.Response, } switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -3232,14 +3232,14 @@ func awsAwsjson11_deserializeOpErrorListResources(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpListUsers struct { +type awsAwsjson11_deserializeOpGetMailboxDetails struct { } -func (*awsAwsjson11_deserializeOpListUsers) ID() string { +func (*awsAwsjson11_deserializeOpGetMailboxDetails) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListUsers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetMailboxDetails) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3253,9 +3253,9 @@ func (m *awsAwsjson11_deserializeOpListUsers) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListUsers(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetMailboxDetails(response, &metadata) } - output := &ListUsersOutput{} + output := &GetMailboxDetailsOutput{} out.Result = output var buff [1024]byte @@ -3275,7 +3275,7 @@ func (m *awsAwsjson11_deserializeOpListUsers) HandleDeserialize(ctx context.Cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListUsersOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetMailboxDetailsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3289,7 +3289,7 @@ func (m *awsAwsjson11_deserializeOpListUsers) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListUsers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetMailboxDetails(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3330,8 +3330,8 @@ func awsAwsjson11_deserializeOpErrorListUsers(response *smithyhttp.Response, met } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -3349,14 +3349,14 @@ func awsAwsjson11_deserializeOpErrorListUsers(response *smithyhttp.Response, met } } -type awsAwsjson11_deserializeOpPutMailboxPermissions struct { +type awsAwsjson11_deserializeOpListAccessControlRules struct { } -func (*awsAwsjson11_deserializeOpPutMailboxPermissions) ID() string { +func (*awsAwsjson11_deserializeOpListAccessControlRules) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutMailboxPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListAccessControlRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3370,9 +3370,9 @@ func (m *awsAwsjson11_deserializeOpPutMailboxPermissions) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutMailboxPermissions(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListAccessControlRules(response, &metadata) } - output := &PutMailboxPermissionsOutput{} + output := &ListAccessControlRulesOutput{} out.Result = output var buff [1024]byte @@ -3392,7 +3392,7 @@ func (m *awsAwsjson11_deserializeOpPutMailboxPermissions) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutMailboxPermissionsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListAccessControlRulesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3406,7 +3406,7 @@ func (m *awsAwsjson11_deserializeOpPutMailboxPermissions) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutMailboxPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListAccessControlRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3447,15 +3447,6 @@ func awsAwsjson11_deserializeOpErrorPutMailboxPermissions(response *smithyhttp.R } switch { - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -3472,14 +3463,14 @@ func awsAwsjson11_deserializeOpErrorPutMailboxPermissions(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpRegisterToWorkMail struct { +type awsAwsjson11_deserializeOpListAliases struct { } -func (*awsAwsjson11_deserializeOpRegisterToWorkMail) ID() string { +func (*awsAwsjson11_deserializeOpListAliases) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpRegisterToWorkMail) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListAliases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3493,9 +3484,9 @@ func (m *awsAwsjson11_deserializeOpRegisterToWorkMail) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorRegisterToWorkMail(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListAliases(response, &metadata) } - output := &RegisterToWorkMailOutput{} + output := &ListAliasesOutput{} out.Result = output var buff [1024]byte @@ -3515,7 +3506,7 @@ func (m *awsAwsjson11_deserializeOpRegisterToWorkMail) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentRegisterToWorkMailOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListAliasesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3529,7 +3520,7 @@ func (m *awsAwsjson11_deserializeOpRegisterToWorkMail) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorRegisterToWorkMail(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListAliases(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3570,33 +3561,15 @@ func awsAwsjson11_deserializeOpErrorRegisterToWorkMail(response *smithyhttp.Resp } switch { - case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("DirectoryUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) - - case strings.EqualFold("EmailAddressInUseException", errorCode): - return awsAwsjson11_deserializeErrorEmailAddressInUseException(response, errorBody) - - case strings.EqualFold("EntityAlreadyRegisteredException", errorCode): - return awsAwsjson11_deserializeErrorEntityAlreadyRegisteredException(response, errorBody) - - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("MailDomainNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorMailDomainNotFoundException(response, errorBody) - - case strings.EqualFold("MailDomainStateException", errorCode): - return awsAwsjson11_deserializeErrorMailDomainStateException(response, errorBody) - case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -3613,14 +3586,14 @@ func awsAwsjson11_deserializeOpErrorRegisterToWorkMail(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpResetPassword struct { +type awsAwsjson11_deserializeOpListGroupMembers struct { } -func (*awsAwsjson11_deserializeOpResetPassword) ID() string { +func (*awsAwsjson11_deserializeOpListGroupMembers) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpResetPassword) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListGroupMembers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3634,9 +3607,9 @@ func (m *awsAwsjson11_deserializeOpResetPassword) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorResetPassword(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListGroupMembers(response, &metadata) } - output := &ResetPasswordOutput{} + output := &ListGroupMembersOutput{} out.Result = output var buff [1024]byte @@ -3656,7 +3629,7 @@ func (m *awsAwsjson11_deserializeOpResetPassword) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentResetPasswordOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListGroupMembersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3670,7 +3643,7 @@ func (m *awsAwsjson11_deserializeOpResetPassword) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorResetPassword(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListGroupMembers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3711,12 +3684,6 @@ func awsAwsjson11_deserializeOpErrorResetPassword(response *smithyhttp.Response, } switch { - case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) - - case strings.EqualFold("DirectoryUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) - case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) @@ -3726,18 +3693,12 @@ func awsAwsjson11_deserializeOpErrorResetPassword(response *smithyhttp.Response, case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("InvalidPasswordException", errorCode): - return awsAwsjson11_deserializeErrorInvalidPasswordException(response, errorBody) - case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - case strings.EqualFold("UnsupportedOperationException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3748,14 +3709,14 @@ func awsAwsjson11_deserializeOpErrorResetPassword(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpUpdateMailboxQuota struct { +type awsAwsjson11_deserializeOpListGroups struct { } -func (*awsAwsjson11_deserializeOpUpdateMailboxQuota) ID() string { +func (*awsAwsjson11_deserializeOpListGroups) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateMailboxQuota) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3769,9 +3730,9 @@ func (m *awsAwsjson11_deserializeOpUpdateMailboxQuota) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateMailboxQuota(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListGroups(response, &metadata) } - output := &UpdateMailboxQuotaOutput{} + output := &ListGroupsOutput{} out.Result = output var buff [1024]byte @@ -3791,7 +3752,7 @@ func (m *awsAwsjson11_deserializeOpUpdateMailboxQuota) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateMailboxQuotaOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListGroupsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3805,7 +3766,7 @@ func (m *awsAwsjson11_deserializeOpUpdateMailboxQuota) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateMailboxQuota(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3849,9 +3810,6 @@ func awsAwsjson11_deserializeOpErrorUpdateMailboxQuota(response *smithyhttp.Resp case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -3871,14 +3829,14 @@ func awsAwsjson11_deserializeOpErrorUpdateMailboxQuota(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpUpdatePrimaryEmailAddress struct { +type awsAwsjson11_deserializeOpListMailboxExportJobs struct { } -func (*awsAwsjson11_deserializeOpUpdatePrimaryEmailAddress) ID() string { +func (*awsAwsjson11_deserializeOpListMailboxExportJobs) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdatePrimaryEmailAddress) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListMailboxExportJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3892,9 +3850,9 @@ func (m *awsAwsjson11_deserializeOpUpdatePrimaryEmailAddress) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdatePrimaryEmailAddress(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListMailboxExportJobs(response, &metadata) } - output := &UpdatePrimaryEmailAddressOutput{} + output := &ListMailboxExportJobsOutput{} out.Result = output var buff [1024]byte @@ -3914,7 +3872,7 @@ func (m *awsAwsjson11_deserializeOpUpdatePrimaryEmailAddress) HandleDeserialize( return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdatePrimaryEmailAddressOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListMailboxExportJobsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3928,7 +3886,7 @@ func (m *awsAwsjson11_deserializeOpUpdatePrimaryEmailAddress) HandleDeserialize( return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdatePrimaryEmailAddress(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListMailboxExportJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3969,39 +3927,15 @@ func awsAwsjson11_deserializeOpErrorUpdatePrimaryEmailAddress(response *smithyht } switch { - case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) - - case strings.EqualFold("DirectoryUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) - - case strings.EqualFold("EmailAddressInUseException", errorCode): - return awsAwsjson11_deserializeErrorEmailAddressInUseException(response, errorBody) - - case strings.EqualFold("EntityNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("MailDomainNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorMailDomainNotFoundException(response, errorBody) - - case strings.EqualFold("MailDomainStateException", errorCode): - return awsAwsjson11_deserializeErrorMailDomainStateException(response, errorBody) - case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) case strings.EqualFold("OrganizationStateException", errorCode): return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) - case strings.EqualFold("UnsupportedOperationException", errorCode): - return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4012,14 +3946,14 @@ func awsAwsjson11_deserializeOpErrorUpdatePrimaryEmailAddress(response *smithyht } } -type awsAwsjson11_deserializeOpUpdateResource struct { +type awsAwsjson11_deserializeOpListMailboxPermissions struct { } -func (*awsAwsjson11_deserializeOpUpdateResource) ID() string { +func (*awsAwsjson11_deserializeOpListMailboxPermissions) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUpdateResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListMailboxPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4033,9 +3967,9 @@ func (m *awsAwsjson11_deserializeOpUpdateResource) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUpdateResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListMailboxPermissions(response, &metadata) } - output := &UpdateResourceOutput{} + output := &ListMailboxPermissionsOutput{} out.Result = output var buff [1024]byte @@ -4055,7 +3989,7 @@ func (m *awsAwsjson11_deserializeOpUpdateResource) HandleDeserialize(ctx context return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentUpdateResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListMailboxPermissionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4069,7 +4003,7 @@ func (m *awsAwsjson11_deserializeOpUpdateResource) HandleDeserialize(ctx context return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUpdateResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListMailboxPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4110,29 +4044,11 @@ func awsAwsjson11_deserializeOpErrorUpdateResource(response *smithyhttp.Response } switch { - case strings.EqualFold("DirectoryUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) - - case strings.EqualFold("EmailAddressInUseException", errorCode): - return awsAwsjson11_deserializeErrorEmailAddressInUseException(response, errorBody) - case strings.EqualFold("EntityNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - case strings.EqualFold("EntityStateException", errorCode): - return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) - - case strings.EqualFold("InvalidConfigurationException", errorCode): - return awsAwsjson11_deserializeErrorInvalidConfigurationException(response, errorBody) - - case strings.EqualFold("MailDomainNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorMailDomainNotFoundException(response, errorBody) - - case strings.EqualFold("MailDomainStateException", errorCode): - return awsAwsjson11_deserializeErrorMailDomainStateException(response, errorBody) - - case strings.EqualFold("NameAvailabilityException", errorCode): - return awsAwsjson11_deserializeErrorNameAvailabilityException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("OrganizationNotFoundException", errorCode): return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) @@ -4150,11 +4066,36 @@ func awsAwsjson11_deserializeOpErrorUpdateResource(response *smithyhttp.Response } } -func awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +type awsAwsjson11_deserializeOpListOrganizations struct { +} + +func (*awsAwsjson11_deserializeOpListOrganizations) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListOrganizations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListOrganizations(response, &metadata) + } + output := &ListOrganizationsOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -4165,12 +4106,10 @@ func awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException( Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.DirectoryServiceAuthenticationFailedException{} - err := awsAwsjson11_deserializeDocumentDirectoryServiceAuthenticationFailedException(&output, shape) - + err = awsAwsjson11_deserializeOpDocumentListOrganizationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4178,22 +4117,35 @@ func awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException( Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson11_deserializeErrorDirectoryUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeOpErrorListOrganizations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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 { + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -4203,28 +4155,58 @@ func awsAwsjson11_deserializeErrorDirectoryUnavailableException(response *smithy return err } - output := &types.DirectoryUnavailableException{} - err := awsAwsjson11_deserializeDocumentDirectoryUnavailableException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) - return output +type awsAwsjson11_deserializeOpListResourceDelegates struct { } -func awsAwsjson11_deserializeErrorEmailAddressInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func (*awsAwsjson11_deserializeOpListResourceDelegates) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListResourceDelegates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListResourceDelegates(response, &metadata) + } + output := &ListResourceDelegatesOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -4235,12 +4217,10 @@ func awsAwsjson11_deserializeErrorEmailAddressInUseException(response *smithyhtt Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.EmailAddressInUseException{} - err := awsAwsjson11_deserializeDocumentEmailAddressInUseException(&output, shape) - + err = awsAwsjson11_deserializeOpDocumentListResourceDelegatesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4248,34 +4228,34 @@ func awsAwsjson11_deserializeErrorEmailAddressInUseException(response *smithyhtt Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson11_deserializeErrorEntityAlreadyRegisteredException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeOpErrorListResourceDelegates(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.EntityAlreadyRegisteredException{} - err := awsAwsjson11_deserializeDocumentEntityAlreadyRegisteredException(&output, shape) - + code, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4287,49 +4267,69 @@ func awsAwsjson11_deserializeErrorEntityAlreadyRegisteredException(response *smi } errorBody.Seek(0, io.SeekStart) - return output -} + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } -func awsAwsjson11_deserializeErrorEntityNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) - 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(), + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - output := &types.EntityNotFoundException{} - err := awsAwsjson11_deserializeDocumentEntityNotFoundException(&output, shape) +type awsAwsjson11_deserializeOpListResources struct { +} + +func (*awsAwsjson11_deserializeOpListResources) ID() string { + return "OperationDeserializer" +} +func (m *awsAwsjson11_deserializeOpListResources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output -} + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListResources(response, &metadata) + } + output := &ListResourcesOutput{} + out.Result = output -func awsAwsjson11_deserializeErrorEntityStateException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -4340,12 +4340,10 @@ func awsAwsjson11_deserializeErrorEntityStateException(response *smithyhttp.Resp Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.EntityStateException{} - err := awsAwsjson11_deserializeDocumentEntityStateException(&output, shape) - + err = awsAwsjson11_deserializeOpDocumentListResourcesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4353,34 +4351,34 @@ func awsAwsjson11_deserializeErrorEntityStateException(response *smithyhttp.Resp Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson11_deserializeErrorInvalidConfigurationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeOpErrorListResources(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.InvalidConfigurationException{} - err := awsAwsjson11_deserializeDocumentInvalidConfigurationException(&output, shape) - + code, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4392,49 +4390,63 @@ func awsAwsjson11_deserializeErrorInvalidConfigurationException(response *smithy } errorBody.Seek(0, io.SeekStart) - return output -} + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } -func awsAwsjson11_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - 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(), + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - output := &types.InvalidParameterException{} - err := awsAwsjson11_deserializeDocumentInvalidParameterException(&output, shape) +type awsAwsjson11_deserializeOpListTagsForResource struct { +} + +func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} +func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output -} + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output -func awsAwsjson11_deserializeErrorInvalidPasswordException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -4445,12 +4457,10 @@ func awsAwsjson11_deserializeErrorInvalidPasswordException(response *smithyhttp. Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.InvalidPasswordException{} - err := awsAwsjson11_deserializeDocumentInvalidPasswordException(&output, shape) - + err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4458,22 +4468,35 @@ func awsAwsjson11_deserializeErrorInvalidPasswordException(response *smithyhttp. Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson11_deserializeErrorMailDomainNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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 { + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -4483,28 +4506,58 @@ func awsAwsjson11_deserializeErrorMailDomainNotFoundException(response *smithyht return err } - output := &types.MailDomainNotFoundException{} - err := awsAwsjson11_deserializeDocumentMailDomainNotFoundException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) - return output +type awsAwsjson11_deserializeOpListUsers struct { } -func awsAwsjson11_deserializeErrorMailDomainStateException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func (*awsAwsjson11_deserializeOpListUsers) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListUsers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListUsers(response, &metadata) + } + output := &ListUsersOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -4515,12 +4568,10 @@ func awsAwsjson11_deserializeErrorMailDomainStateException(response *smithyhttp. Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.MailDomainStateException{} - err := awsAwsjson11_deserializeDocumentMailDomainStateException(&output, shape) - + err = awsAwsjson11_deserializeOpDocumentListUsersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4528,22 +4579,35 @@ func awsAwsjson11_deserializeErrorMailDomainStateException(response *smithyhttp. Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson11_deserializeErrorNameAvailabilityException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeOpErrorListUsers(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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 { + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -4553,28 +4617,64 @@ func awsAwsjson11_deserializeErrorNameAvailabilityException(response *smithyhttp return err } - output := &types.NameAvailabilityException{} - err := awsAwsjson11_deserializeDocumentNameAvailabilityException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) - return output +type awsAwsjson11_deserializeOpPutAccessControlRule struct { } -func awsAwsjson11_deserializeErrorOrganizationNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func (*awsAwsjson11_deserializeOpPutAccessControlRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutAccessControlRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorPutAccessControlRule(response, &metadata) + } + output := &PutAccessControlRuleOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -4585,12 +4685,10 @@ func awsAwsjson11_deserializeErrorOrganizationNotFoundException(response *smithy Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.OrganizationNotFoundException{} - err := awsAwsjson11_deserializeDocumentOrganizationNotFoundException(&output, shape) - + err = awsAwsjson11_deserializeOpDocumentPutAccessControlRuleOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4598,22 +4696,35 @@ func awsAwsjson11_deserializeErrorOrganizationNotFoundException(response *smithy Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson11_deserializeErrorOrganizationStateException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeOpErrorPutAccessControlRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + 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 { + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -4623,28 +4734,70 @@ func awsAwsjson11_deserializeErrorOrganizationStateException(response *smithyhtt return err } - output := &types.OrganizationStateException{} - err := awsAwsjson11_deserializeDocumentOrganizationStateException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) - return output +type awsAwsjson11_deserializeOpPutMailboxPermissions struct { } -func awsAwsjson11_deserializeErrorReservedNameException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func (*awsAwsjson11_deserializeOpPutMailboxPermissions) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutMailboxPermissions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorPutMailboxPermissions(response, &metadata) + } + output := &PutMailboxPermissionsOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -4655,12 +4808,10 @@ func awsAwsjson11_deserializeErrorReservedNameException(response *smithyhttp.Res Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.ReservedNameException{} - err := awsAwsjson11_deserializeDocumentReservedNameException(&output, shape) - + err = awsAwsjson11_deserializeOpDocumentPutMailboxPermissionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4668,20 +4819,230 @@ func awsAwsjson11_deserializeErrorReservedNameException(response *smithyhttp.Res Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson11_deserializeErrorUnsupportedOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) +func awsAwsjson11_deserializeOpErrorPutMailboxPermissions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpPutRetentionPolicy struct { +} + +func (*awsAwsjson11_deserializeOpPutRetentionPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutRetentionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorPutRetentionPolicy(response, &metadata) + } + output := &PutRetentionPolicyOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentPutRetentionPolicyOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorPutRetentionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpRegisterToWorkMail struct { +} + +func (*awsAwsjson11_deserializeOpRegisterToWorkMail) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpRegisterToWorkMail) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorRegisterToWorkMail(response, &metadata) + } + output := &RegisterToWorkMailOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() var shape interface{} if err := decoder.Decode(&shape); err != nil && err != io.EOF { var snapshot bytes.Buffer @@ -4690,27 +5051,2139 @@ func awsAwsjson11_deserializeErrorUnsupportedOperationException(response *smithy Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentRegisterToWorkMailOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorRegisterToWorkMail(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) + + case strings.EqualFold("DirectoryUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) + + case strings.EqualFold("EmailAddressInUseException", errorCode): + return awsAwsjson11_deserializeErrorEmailAddressInUseException(response, errorBody) + + case strings.EqualFold("EntityAlreadyRegisteredException", errorCode): + return awsAwsjson11_deserializeErrorEntityAlreadyRegisteredException(response, errorBody) + + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("MailDomainNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorMailDomainNotFoundException(response, errorBody) + + case strings.EqualFold("MailDomainStateException", errorCode): + return awsAwsjson11_deserializeErrorMailDomainStateException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpResetPassword struct { +} + +func (*awsAwsjson11_deserializeOpResetPassword) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpResetPassword) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorResetPassword(response, &metadata) + } + output := &ResetPasswordOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentResetPasswordOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorResetPassword(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) + + case strings.EqualFold("DirectoryUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) + + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidPasswordException", errorCode): + return awsAwsjson11_deserializeErrorInvalidPasswordException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpStartMailboxExportJob struct { +} + +func (*awsAwsjson11_deserializeOpStartMailboxExportJob) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpStartMailboxExportJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorStartMailboxExportJob(response, &metadata) + } + output := &StartMailboxExportJobOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentStartMailboxExportJobOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorStartMailboxExportJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpTagResource struct { +} + +func (*awsAwsjson11_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyTagsException", errorCode): + return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUntagResource struct { +} + +func (*awsAwsjson11_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentUntagResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateMailboxQuota struct { +} + +func (*awsAwsjson11_deserializeOpUpdateMailboxQuota) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateMailboxQuota) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateMailboxQuota(response, &metadata) + } + output := &UpdateMailboxQuotaOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentUpdateMailboxQuotaOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdateMailboxQuota(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdatePrimaryEmailAddress struct { +} + +func (*awsAwsjson11_deserializeOpUpdatePrimaryEmailAddress) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdatePrimaryEmailAddress) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUpdatePrimaryEmailAddress(response, &metadata) + } + output := &UpdatePrimaryEmailAddressOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentUpdatePrimaryEmailAddressOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdatePrimaryEmailAddress(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("DirectoryServiceAuthenticationFailedException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response, errorBody) + + case strings.EqualFold("DirectoryUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) + + case strings.EqualFold("EmailAddressInUseException", errorCode): + return awsAwsjson11_deserializeErrorEmailAddressInUseException(response, errorBody) + + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("MailDomainNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorMailDomainNotFoundException(response, errorBody) + + case strings.EqualFold("MailDomainStateException", errorCode): + return awsAwsjson11_deserializeErrorMailDomainStateException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateResource struct { +} + +func (*awsAwsjson11_deserializeOpUpdateResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateResource(response, &metadata) + } + output := &UpdateResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentUpdateResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdateResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("DirectoryUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorDirectoryUnavailableException(response, errorBody) + + case strings.EqualFold("EmailAddressInUseException", errorCode): + return awsAwsjson11_deserializeErrorEmailAddressInUseException(response, errorBody) + + case strings.EqualFold("EntityNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEntityNotFoundException(response, errorBody) + + case strings.EqualFold("EntityStateException", errorCode): + return awsAwsjson11_deserializeErrorEntityStateException(response, errorBody) + + case strings.EqualFold("InvalidConfigurationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidConfigurationException(response, errorBody) + + case strings.EqualFold("MailDomainNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorMailDomainNotFoundException(response, errorBody) + + case strings.EqualFold("MailDomainStateException", errorCode): + return awsAwsjson11_deserializeErrorMailDomainStateException(response, errorBody) + + case strings.EqualFold("NameAvailabilityException", errorCode): + return awsAwsjson11_deserializeErrorNameAvailabilityException(response, errorBody) + + case strings.EqualFold("OrganizationNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationNotFoundException(response, errorBody) + + case strings.EqualFold("OrganizationStateException", errorCode): + return awsAwsjson11_deserializeErrorOrganizationStateException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsjson11_deserializeErrorDirectoryInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.DirectoryInUseException{} + err := awsAwsjson11_deserializeDocumentDirectoryInUseException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorDirectoryServiceAuthenticationFailedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.DirectoryServiceAuthenticationFailedException{} + err := awsAwsjson11_deserializeDocumentDirectoryServiceAuthenticationFailedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorDirectoryUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.DirectoryUnavailableException{} + err := awsAwsjson11_deserializeDocumentDirectoryUnavailableException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorEmailAddressInUseException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.EmailAddressInUseException{} + err := awsAwsjson11_deserializeDocumentEmailAddressInUseException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorEntityAlreadyRegisteredException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.EntityAlreadyRegisteredException{} + err := awsAwsjson11_deserializeDocumentEntityAlreadyRegisteredException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorEntityNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.EntityNotFoundException{} + err := awsAwsjson11_deserializeDocumentEntityNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorEntityStateException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.EntityStateException{} + err := awsAwsjson11_deserializeDocumentEntityStateException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorInvalidConfigurationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InvalidConfigurationException{} + err := awsAwsjson11_deserializeDocumentInvalidConfigurationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InvalidParameterException{} + err := awsAwsjson11_deserializeDocumentInvalidParameterException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorInvalidPasswordException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InvalidPasswordException{} + err := awsAwsjson11_deserializeDocumentInvalidPasswordException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.LimitExceededException{} + err := awsAwsjson11_deserializeDocumentLimitExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorMailDomainNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.MailDomainNotFoundException{} + err := awsAwsjson11_deserializeDocumentMailDomainNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorMailDomainStateException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.MailDomainStateException{} + err := awsAwsjson11_deserializeDocumentMailDomainStateException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorNameAvailabilityException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.NameAvailabilityException{} + err := awsAwsjson11_deserializeDocumentNameAvailabilityException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorOrganizationNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.OrganizationNotFoundException{} + err := awsAwsjson11_deserializeDocumentOrganizationNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorOrganizationStateException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.OrganizationStateException{} + err := awsAwsjson11_deserializeDocumentOrganizationStateException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorReservedNameException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ReservedNameException{} + err := awsAwsjson11_deserializeDocumentReservedNameException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ResourceNotFoundException{} + err := awsAwsjson11_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.TooManyTagsException{} + err := awsAwsjson11_deserializeDocumentTooManyTagsException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorUnsupportedOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.UnsupportedOperationException{} + err := awsAwsjson11_deserializeDocumentUnsupportedOperationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeDocumentAccessControlRule(v **types.AccessControlRule, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessControlRule + if *v == nil { + sv = &types.AccessControlRule{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Actions": + if err := awsAwsjson11_deserializeDocumentActionsList(&sv.Actions, value); err != nil { + return err + } + + case "DateCreated": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DateCreated = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "DateModified": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DateModified = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessControlRuleDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "Effect": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessControlRuleEffect to be of type string, got %T instead", value) + } + sv.Effect = types.AccessControlRuleEffect(jtv) + } + + case "IpRanges": + if err := awsAwsjson11_deserializeDocumentIpRangeList(&sv.IpRanges, value); err != nil { + return err + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessControlRuleName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "NotActions": + if err := awsAwsjson11_deserializeDocumentActionsList(&sv.NotActions, value); err != nil { + return err + } + + case "NotIpRanges": + if err := awsAwsjson11_deserializeDocumentIpRangeList(&sv.NotIpRanges, value); err != nil { + return err + } + + case "NotUserIds": + if err := awsAwsjson11_deserializeDocumentUserIdList(&sv.NotUserIds, value); err != nil { + return err + } + + case "UserIds": + if err := awsAwsjson11_deserializeDocumentUserIdList(&sv.UserIds, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAccessControlRuleNameList(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 AccessControlRuleName to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentAccessControlRulesList(v *[]types.AccessControlRule, 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.AccessControlRule + if *v == nil { + cv = []types.AccessControlRule{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AccessControlRule + destAddr := &col + if err := awsAwsjson11_deserializeDocumentAccessControlRule(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentActionsList(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 AccessControlRuleAction to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentAliases(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 EmailAddress to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentBookingOptions(v **types.BookingOptions, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.BookingOptions + if *v == nil { + sv = &types.BookingOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AutoAcceptRequests": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AutoAcceptRequests = jtv + } + + case "AutoDeclineConflictingRequests": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AutoDeclineConflictingRequests = jtv + } + + case "AutoDeclineRecurringRequests": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AutoDeclineRecurringRequests = jtv + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDelegate(v **types.Delegate, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Delegate + if *v == nil { + sv = &types.Delegate{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MemberType to be of type string, got %T instead", value) + } + sv.Type = types.MemberType(jtv) + } + + default: + _, _ = key, value + + } } + *v = sv + return nil +} - output := &types.UnsupportedOperationException{} - err := awsAwsjson11_deserializeDocumentUnsupportedOperationException(&output, shape) +func awsAwsjson11_deserializeDocumentDirectoryInUseException(v **types.DirectoryInUseException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DirectoryInUseException + if *v == nil { + sv = &types.DirectoryInUseException{} + } 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 - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), } - return err } + *v = sv + return nil +} - errorBody.Seek(0, io.SeekStart) - return output +func awsAwsjson11_deserializeDocumentDirectoryServiceAuthenticationFailedException(v **types.DirectoryServiceAuthenticationFailedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DirectoryServiceAuthenticationFailedException + if *v == nil { + sv = &types.DirectoryServiceAuthenticationFailedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func awsAwsjson11_deserializeDocumentAliases(v *[]string, value interface{}) error { +func awsAwsjson11_deserializeDocumentDirectoryUnavailableException(v **types.DirectoryUnavailableException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4718,35 +7191,79 @@ func awsAwsjson11_deserializeDocumentAliases(v *[]string, value interface{}) err return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var sv *types.DirectoryUnavailableException if *v == nil { - cv = []string{} + sv = &types.DirectoryUnavailableException{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value) + 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) } - col = jtv + + default: + _, _ = key, value + } - cv = append(cv, col) + } + *v = sv + return nil +} +func awsAwsjson11_deserializeDocumentEmailAddressInUseException(v **types.EmailAddressInUseException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) } - *v = cv + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EmailAddressInUseException + if *v == nil { + sv = &types.EmailAddressInUseException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv return nil } -func awsAwsjson11_deserializeDocumentBookingOptions(v **types.BookingOptions, value interface{}) error { +func awsAwsjson11_deserializeDocumentEntityAlreadyRegisteredException(v **types.EntityAlreadyRegisteredException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4759,40 +7276,102 @@ func awsAwsjson11_deserializeDocumentBookingOptions(v **types.BookingOptions, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BookingOptions + var sv *types.EntityAlreadyRegisteredException if *v == nil { - sv = &types.BookingOptions{} + sv = &types.EntityAlreadyRegisteredException{} } else { sv = *v } for key, value := range shape { switch key { - case "AutoAcceptRequests": + case "Message": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.AutoAcceptRequests = jtv + sv.Message = ptr.String(jtv) } - case "AutoDeclineConflictingRequests": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentEntityNotFoundException(v **types.EntityNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EntityNotFoundException + if *v == nil { + sv = &types.EntityNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.AutoDeclineConflictingRequests = jtv + sv.Message = ptr.String(jtv) } - case "AutoDeclineRecurringRequests": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentEntityStateException(v **types.EntityStateException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EntityStateException + if *v == nil { + sv = &types.EntityStateException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.AutoDeclineRecurringRequests = jtv + sv.Message = ptr.String(jtv) } default: @@ -4804,7 +7383,7 @@ func awsAwsjson11_deserializeDocumentBookingOptions(v **types.BookingOptions, va return nil } -func awsAwsjson11_deserializeDocumentDelegate(v **types.Delegate, value interface{}) error { +func awsAwsjson11_deserializeDocumentFolderConfiguration(v **types.FolderConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4817,31 +7396,44 @@ func awsAwsjson11_deserializeDocumentDelegate(v **types.Delegate, value interfac return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Delegate + var sv *types.FolderConfiguration if *v == nil { - sv = &types.Delegate{} + sv = &types.FolderConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "Id": + case "Action": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected RetentionAction to be of type string, got %T instead", value) } - sv.Id = ptr.String(jtv) + sv.Action = types.RetentionAction(jtv) } - case "Type": + case "Name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MemberType to be of type string, got %T instead", value) + return fmt.Errorf("expected FolderName to be of type string, got %T instead", value) } - sv.Type = types.MemberType(jtv) + sv.Name = types.FolderName(jtv) + } + + case "Period": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RetentionPeriod to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Period = ptr.Int32(int32(i64)) } default: @@ -4853,7 +7445,7 @@ func awsAwsjson11_deserializeDocumentDelegate(v **types.Delegate, value interfac return nil } -func awsAwsjson11_deserializeDocumentDirectoryServiceAuthenticationFailedException(v **types.DirectoryServiceAuthenticationFailedException, value interface{}) error { +func awsAwsjson11_deserializeDocumentFolderConfigurations(v *[]types.FolderConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4861,39 +7453,33 @@ func awsAwsjson11_deserializeDocumentDirectoryServiceAuthenticationFailedExcepti return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DirectoryServiceAuthenticationFailedException + var cv []types.FolderConfiguration if *v == nil { - sv = &types.DirectoryServiceAuthenticationFailedException{} + cv = []types.FolderConfiguration{} } else { - sv = *v + cv = *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 - + for _, value := range shape { + var col types.FolderConfiguration + destAddr := &col + if err := awsAwsjson11_deserializeDocumentFolderConfiguration(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsAwsjson11_deserializeDocumentDirectoryUnavailableException(v **types.DirectoryUnavailableException, value interface{}) error { +func awsAwsjson11_deserializeDocumentGroup(v **types.Group, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4906,22 +7492,75 @@ func awsAwsjson11_deserializeDocumentDirectoryUnavailableException(v **types.Dir return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DirectoryUnavailableException + var sv *types.Group if *v == nil { - sv = &types.DirectoryUnavailableException{} + sv = &types.Group{} } else { sv = *v } for key, value := range shape { switch key { - case "Message": + case "DisabledDate": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DisabledDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "Email": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Email = ptr.String(jtv) + } + + case "EnabledDate": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EnabledDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkMailIdentifier to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GroupName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityState to be of type string, got %T instead", value) + } + sv.State = types.EntityState(jtv) } default: @@ -4933,7 +7572,7 @@ func awsAwsjson11_deserializeDocumentDirectoryUnavailableException(v **types.Dir return nil } -func awsAwsjson11_deserializeDocumentEmailAddressInUseException(v **types.EmailAddressInUseException, value interface{}) error { +func awsAwsjson11_deserializeDocumentGroups(v *[]types.Group, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4941,39 +7580,33 @@ func awsAwsjson11_deserializeDocumentEmailAddressInUseException(v **types.EmailA return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.EmailAddressInUseException + var cv []types.Group if *v == nil { - sv = &types.EmailAddressInUseException{} + cv = []types.Group{} } else { - sv = *v + cv = *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 - + for _, value := range shape { + var col types.Group + destAddr := &col + if err := awsAwsjson11_deserializeDocumentGroup(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsAwsjson11_deserializeDocumentEntityAlreadyRegisteredException(v **types.EntityAlreadyRegisteredException, value interface{}) error { +func awsAwsjson11_deserializeDocumentInvalidConfigurationException(v **types.InvalidConfigurationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4986,9 +7619,9 @@ func awsAwsjson11_deserializeDocumentEntityAlreadyRegisteredException(v **types. return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.EntityAlreadyRegisteredException + var sv *types.InvalidConfigurationException if *v == nil { - sv = &types.EntityAlreadyRegisteredException{} + sv = &types.InvalidConfigurationException{} } else { sv = *v } @@ -5013,7 +7646,7 @@ func awsAwsjson11_deserializeDocumentEntityAlreadyRegisteredException(v **types. return nil } -func awsAwsjson11_deserializeDocumentEntityNotFoundException(v **types.EntityNotFoundException, value interface{}) error { +func awsAwsjson11_deserializeDocumentInvalidParameterException(v **types.InvalidParameterException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5026,9 +7659,9 @@ func awsAwsjson11_deserializeDocumentEntityNotFoundException(v **types.EntityNot return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.EntityNotFoundException + var sv *types.InvalidParameterException if *v == nil { - sv = &types.EntityNotFoundException{} + sv = &types.InvalidParameterException{} } else { sv = *v } @@ -5053,7 +7686,7 @@ func awsAwsjson11_deserializeDocumentEntityNotFoundException(v **types.EntityNot return nil } -func awsAwsjson11_deserializeDocumentEntityStateException(v **types.EntityStateException, value interface{}) error { +func awsAwsjson11_deserializeDocumentInvalidPasswordException(v **types.InvalidPasswordException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5066,9 +7699,9 @@ func awsAwsjson11_deserializeDocumentEntityStateException(v **types.EntityStateE return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.EntityStateException + var sv *types.InvalidPasswordException if *v == nil { - sv = &types.EntityStateException{} + sv = &types.InvalidPasswordException{} } else { sv = *v } @@ -5093,7 +7726,7 @@ func awsAwsjson11_deserializeDocumentEntityStateException(v **types.EntityStateE return nil } -func awsAwsjson11_deserializeDocumentGroup(v **types.Group, value interface{}) error { +func awsAwsjson11_deserializeDocumentIpRangeList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5101,92 +7734,35 @@ func awsAwsjson11_deserializeDocumentGroup(v **types.Group, value interface{}) e return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Group + var cv []string if *v == nil { - sv = &types.Group{} + cv = []string{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "DisabledDate": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.DisabledDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - } - - case "Email": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EmailAddress to be of type string, got %T instead", value) - } - sv.Email = ptr.String(jtv) - } - - case "EnabledDate": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) - } - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.EnabledDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - } - - case "Id": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkMailIdentifier to be of type string, got %T instead", value) - } - sv.Id = ptr.String(jtv) - } - - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GroupName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } - - case "State": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected EntityState to be of type string, got %T instead", value) - } - sv.State = types.EntityState(jtv) + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IpRange to be of type string, got %T instead", value) } - - default: - _, _ = key, value - + col = jtv } + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsAwsjson11_deserializeDocumentGroups(v *[]types.Group, value interface{}) error { +func awsAwsjson11_deserializeDocumentJobs(v *[]types.MailboxExportJob, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5199,17 +7775,17 @@ func awsAwsjson11_deserializeDocumentGroups(v *[]types.Group, value interface{}) return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Group + var cv []types.MailboxExportJob if *v == nil { - cv = []types.Group{} + cv = []types.MailboxExportJob{} } else { cv = *v } for _, value := range shape { - var col types.Group + var col types.MailboxExportJob destAddr := &col - if err := awsAwsjson11_deserializeDocumentGroup(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentMailboxExportJob(&destAddr, value); err != nil { return err } col = *destAddr @@ -5220,7 +7796,7 @@ func awsAwsjson11_deserializeDocumentGroups(v *[]types.Group, value interface{}) return nil } -func awsAwsjson11_deserializeDocumentInvalidConfigurationException(v **types.InvalidConfigurationException, value interface{}) error { +func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5233,9 +7809,9 @@ func awsAwsjson11_deserializeDocumentInvalidConfigurationException(v **types.Inv return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InvalidConfigurationException + var sv *types.LimitExceededException if *v == nil { - sv = &types.InvalidConfigurationException{} + sv = &types.LimitExceededException{} } else { sv = *v } @@ -5260,7 +7836,7 @@ func awsAwsjson11_deserializeDocumentInvalidConfigurationException(v **types.Inv return nil } -func awsAwsjson11_deserializeDocumentInvalidParameterException(v **types.InvalidParameterException, value interface{}) error { +func awsAwsjson11_deserializeDocumentMailboxExportJob(v **types.MailboxExportJob, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5273,62 +7849,106 @@ func awsAwsjson11_deserializeDocumentInvalidParameterException(v **types.Invalid return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.InvalidParameterException + var sv *types.MailboxExportJob if *v == nil { - sv = &types.InvalidParameterException{} + sv = &types.MailboxExportJob{} } else { sv = *v } for key, value := range shape { switch key { - case "Message": + case "Description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected Description to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Description = ptr.String(jtv) } - default: - _, _ = key, value + case "EndTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } - } - } - *v = sv - return nil -} + case "EntityId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkMailIdentifier to be of type string, got %T instead", value) + } + sv.EntityId = ptr.String(jtv) + } -func awsAwsjson11_deserializeDocumentInvalidPasswordException(v **types.InvalidPasswordException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } + case "EstimatedProgress": + 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.EstimatedProgress = int32(i64) + } - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + case "JobId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MailboxExportJobId to be of type string, got %T instead", value) + } + sv.JobId = ptr.String(jtv) + } - var sv *types.InvalidPasswordException - if *v == nil { - sv = &types.InvalidPasswordException{} - } else { - sv = *v - } + case "S3BucketName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected S3BucketName to be of type string, got %T instead", value) + } + sv.S3BucketName = ptr.String(jtv) + } - for key, value := range shape { - switch key { - case "Message": + case "S3Path": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected S3ObjectKey to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.S3Path = ptr.String(jtv) + } + + case "StartTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MailboxExportJobState to be of type string, got %T instead", value) + } + sv.State = types.MailboxExportJobState(jtv) } default: @@ -5732,6 +8352,15 @@ func awsAwsjson11_deserializeDocumentOrganizationSummary(v **types.OrganizationS sv.Alias = ptr.String(jtv) } + case "DefaultMailDomain": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainName to be of type string, got %T instead", value) + } + sv.DefaultMailDomain = ptr.String(jtv) + } + case "ErrorMessage": if value != nil { jtv, ok := value.(string) @@ -5998,31 +8627,188 @@ func awsAwsjson11_deserializeDocumentResource(v **types.Resource, value interfac sv.Id = ptr.String(jtv) } - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } + case "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 "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityState to be of type string, got %T instead", value) + } + sv.State = types.EntityState(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + sv.Type = types.ResourceType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResourceDelegates(v *[]types.Delegate, 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.Delegate + if *v == nil { + cv = []types.Delegate{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Delegate + destAddr := &col + if err := awsAwsjson11_deserializeDocumentDelegate(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResources(v *[]types.Resource, 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.Resource + if *v == nil { + cv = []types.Resource{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Resource + destAddr := &col + if err := awsAwsjson11_deserializeDocumentResource(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Tag + if *v == nil { + sv = &types.Tag{} + } else { + sv = *v + } - case "State": + for key, value := range shape { + switch key { + case "Key": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EntityState to be of type string, got %T instead", value) + return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) } - sv.State = types.EntityState(jtv) + sv.Key = ptr.String(jtv) } - case "Type": + case "Value": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } - sv.Type = types.ResourceType(jtv) + sv.Value = ptr.String(jtv) } default: @@ -6034,7 +8820,7 @@ func awsAwsjson11_deserializeDocumentResource(v **types.Resource, value interfac return nil } -func awsAwsjson11_deserializeDocumentResourceDelegates(v *[]types.Delegate, value interface{}) error { +func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6047,17 +8833,17 @@ func awsAwsjson11_deserializeDocumentResourceDelegates(v *[]types.Delegate, valu return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Delegate + var cv []types.Tag if *v == nil { - cv = []types.Delegate{} + cv = []types.Tag{} } else { cv = *v } for _, value := range shape { - var col types.Delegate + var col types.Tag destAddr := &col - if err := awsAwsjson11_deserializeDocumentDelegate(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil { return err } col = *destAddr @@ -6068,7 +8854,7 @@ func awsAwsjson11_deserializeDocumentResourceDelegates(v *[]types.Delegate, valu return nil } -func awsAwsjson11_deserializeDocumentResources(v *[]types.Resource, value interface{}) error { +func awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6076,29 +8862,35 @@ func awsAwsjson11_deserializeDocumentResources(v *[]types.Resource, value interf return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Resource + var sv *types.TooManyTagsException if *v == nil { - cv = []types.Resource{} + sv = &types.TooManyTagsException{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.Resource - destAddr := &col - if err := awsAwsjson11_deserializeDocumentResource(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + 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 = cv + *v = sv return nil } @@ -6253,6 +9045,42 @@ func awsAwsjson11_deserializeDocumentUser(v **types.User, value interface{}) err return nil } +func awsAwsjson11_deserializeDocumentUserIdList(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 WorkMailIdentifier to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentUsers(v *[]types.User, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6349,6 +9177,37 @@ func awsAwsjson11_deserializeOpDocumentAssociateMemberToGroupOutput(v **Associat return nil } +func awsAwsjson11_deserializeOpDocumentCancelMailboxExportJobOutput(v **CancelMailboxExportJobOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CancelMailboxExportJobOutput + if *v == nil { + sv = &CancelMailboxExportJobOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentCreateAliasOutput(v **CreateAliasOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6420,6 +9279,46 @@ func awsAwsjson11_deserializeOpDocumentCreateGroupOutput(v **CreateGroupOutput, return nil } +func awsAwsjson11_deserializeOpDocumentCreateOrganizationOutput(v **CreateOrganizationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateOrganizationOutput + if *v == nil { + sv = &CreateOrganizationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "OrganizationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OrganizationId to be of type string, got %T instead", value) + } + sv.OrganizationId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentCreateResourceOutput(v **CreateResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6475,22 +9374,115 @@ func awsAwsjson11_deserializeOpDocumentCreateUserOutput(v **CreateUserOutput, va var sv *CreateUserOutput if *v == nil { - sv = &CreateUserOutput{} + sv = &CreateUserOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "UserId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkMailIdentifier to be of type string, got %T instead", value) + } + sv.UserId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDeleteAccessControlRuleOutput(v **DeleteAccessControlRuleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteAccessControlRuleOutput + if *v == nil { + sv = &DeleteAccessControlRuleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDeleteAliasOutput(v **DeleteAliasOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteAliasOutput + if *v == nil { + sv = &DeleteAliasOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDeleteGroupOutput(v **DeleteGroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteGroupOutput + if *v == nil { + sv = &DeleteGroupOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "UserId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected WorkMailIdentifier to be of type string, got %T instead", value) - } - sv.UserId = ptr.String(jtv) - } - default: _, _ = key, value @@ -6500,7 +9492,7 @@ func awsAwsjson11_deserializeOpDocumentCreateUserOutput(v **CreateUserOutput, va return nil } -func awsAwsjson11_deserializeOpDocumentDeleteAliasOutput(v **DeleteAliasOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentDeleteMailboxPermissionsOutput(v **DeleteMailboxPermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6513,9 +9505,9 @@ func awsAwsjson11_deserializeOpDocumentDeleteAliasOutput(v **DeleteAliasOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteAliasOutput + var sv *DeleteMailboxPermissionsOutput if *v == nil { - sv = &DeleteAliasOutput{} + sv = &DeleteMailboxPermissionsOutput{} } else { sv = *v } @@ -6531,7 +9523,7 @@ func awsAwsjson11_deserializeOpDocumentDeleteAliasOutput(v **DeleteAliasOutput, return nil } -func awsAwsjson11_deserializeOpDocumentDeleteGroupOutput(v **DeleteGroupOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentDeleteOrganizationOutput(v **DeleteOrganizationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6544,15 +9536,33 @@ func awsAwsjson11_deserializeOpDocumentDeleteGroupOutput(v **DeleteGroupOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteGroupOutput + var sv *DeleteOrganizationOutput if *v == nil { - sv = &DeleteGroupOutput{} + sv = &DeleteOrganizationOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "OrganizationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OrganizationId to be of type string, got %T instead", value) + } + sv.OrganizationId = ptr.String(jtv) + } + + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.State = ptr.String(jtv) + } + default: _, _ = key, value @@ -6562,7 +9572,7 @@ func awsAwsjson11_deserializeOpDocumentDeleteGroupOutput(v **DeleteGroupOutput, return nil } -func awsAwsjson11_deserializeOpDocumentDeleteMailboxPermissionsOutput(v **DeleteMailboxPermissionsOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentDeleteResourceOutput(v **DeleteResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6575,9 +9585,9 @@ func awsAwsjson11_deserializeOpDocumentDeleteMailboxPermissionsOutput(v **Delete return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteMailboxPermissionsOutput + var sv *DeleteResourceOutput if *v == nil { - sv = &DeleteMailboxPermissionsOutput{} + sv = &DeleteResourceOutput{} } else { sv = *v } @@ -6593,7 +9603,7 @@ func awsAwsjson11_deserializeOpDocumentDeleteMailboxPermissionsOutput(v **Delete return nil } -func awsAwsjson11_deserializeOpDocumentDeleteResourceOutput(v **DeleteResourceOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentDeleteRetentionPolicyOutput(v **DeleteRetentionPolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6606,9 +9616,9 @@ func awsAwsjson11_deserializeOpDocumentDeleteResourceOutput(v **DeleteResourceOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteResourceOutput + var sv *DeleteRetentionPolicyOutput if *v == nil { - sv = &DeleteResourceOutput{} + sv = &DeleteRetentionPolicyOutput{} } else { sv = *v } @@ -6779,6 +9789,157 @@ func awsAwsjson11_deserializeOpDocumentDescribeGroupOutput(v **DescribeGroupOutp return nil } +func awsAwsjson11_deserializeOpDocumentDescribeMailboxExportJobOutput(v **DescribeMailboxExportJobOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeMailboxExportJobOutput + if *v == nil { + sv = &DescribeMailboxExportJobOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "EndTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "EntityId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkMailIdentifier to be of type string, got %T instead", value) + } + sv.EntityId = ptr.String(jtv) + } + + case "ErrorInfo": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MailboxExportErrorInfo to be of type string, got %T instead", value) + } + sv.ErrorInfo = ptr.String(jtv) + } + + case "EstimatedProgress": + 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.EstimatedProgress = int32(i64) + } + + case "KmsKeyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyArn to be of type string, got %T instead", value) + } + sv.KmsKeyArn = ptr.String(jtv) + } + + case "RoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) + } + sv.RoleArn = ptr.String(jtv) + } + + case "S3BucketName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected S3BucketName to be of type string, got %T instead", value) + } + sv.S3BucketName = ptr.String(jtv) + } + + case "S3Path": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected S3ObjectKey to be of type string, got %T instead", value) + } + sv.S3Path = ptr.String(jtv) + } + + case "S3Prefix": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected S3ObjectKey to be of type string, got %T instead", value) + } + sv.S3Prefix = ptr.String(jtv) + } + + case "StartTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + } + + case "State": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MailboxExportJobState to be of type string, got %T instead", value) + } + sv.State = types.MailboxExportJobState(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDescribeOrganizationOutput(v **DescribeOrganizationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6810,6 +9971,15 @@ func awsAwsjson11_deserializeOpDocumentDescribeOrganizationOutput(v **DescribeOr sv.Alias = ptr.String(jtv) } + case "ARN": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) + } + sv.ARN = ptr.String(jtv) + } + case "CompletedDate": if value != nil { jtv, ok := value.(json.Number) @@ -7155,8 +10325,116 @@ func awsAwsjson11_deserializeOpDocumentDisassociateMemberFromGroupOutput(v **Dis sv = *v } - for key, value := range shape { - switch key { + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetAccessControlEffectOutput(v **GetAccessControlEffectOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetAccessControlEffectOutput + if *v == nil { + sv = &GetAccessControlEffectOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Effect": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessControlRuleEffect to be of type string, got %T instead", value) + } + sv.Effect = types.AccessControlRuleEffect(jtv) + } + + case "MatchedRules": + if err := awsAwsjson11_deserializeDocumentAccessControlRuleNameList(&sv.MatchedRules, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetDefaultRetentionPolicyOutput(v **GetDefaultRetentionPolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetDefaultRetentionPolicyOutput + if *v == nil { + sv = &GetDefaultRetentionPolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "FolderConfigurations": + if err := awsAwsjson11_deserializeDocumentFolderConfigurations(&sv.FolderConfigurations, value); err != nil { + return err + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ShortString to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ShortString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + default: _, _ = key, value @@ -7223,6 +10501,42 @@ func awsAwsjson11_deserializeOpDocumentGetMailboxDetailsOutput(v **GetMailboxDet return nil } +func awsAwsjson11_deserializeOpDocumentListAccessControlRulesOutput(v **ListAccessControlRulesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListAccessControlRulesOutput + if *v == nil { + sv = &ListAccessControlRulesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Rules": + if err := awsAwsjson11_deserializeDocumentAccessControlRulesList(&sv.Rules, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListAliasesOutput(v **ListAliasesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -7358,6 +10672,51 @@ func awsAwsjson11_deserializeOpDocumentListGroupsOutput(v **ListGroupsOutput, va return nil } +func awsAwsjson11_deserializeOpDocumentListMailboxExportJobsOutput(v **ListMailboxExportJobsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListMailboxExportJobsOutput + if *v == nil { + sv = &ListMailboxExportJobsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Jobs": + if err := awsAwsjson11_deserializeDocumentJobs(&sv.Jobs, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListMailboxPermissionsOutput(v **ListMailboxPermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -7538,6 +10897,42 @@ func awsAwsjson11_deserializeOpDocumentListResourcesOutput(v **ListResourcesOutp return nil } +func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Tags": + if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListUsersOutput(v **ListUsersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -7583,6 +10978,37 @@ func awsAwsjson11_deserializeOpDocumentListUsersOutput(v **ListUsersOutput, valu return nil } +func awsAwsjson11_deserializeOpDocumentPutAccessControlRuleOutput(v **PutAccessControlRuleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutAccessControlRuleOutput + if *v == nil { + sv = &PutAccessControlRuleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentPutMailboxPermissionsOutput(v **PutMailboxPermissionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -7614,6 +11040,37 @@ func awsAwsjson11_deserializeOpDocumentPutMailboxPermissionsOutput(v **PutMailbo return nil } +func awsAwsjson11_deserializeOpDocumentPutRetentionPolicyOutput(v **PutRetentionPolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutRetentionPolicyOutput + if *v == nil { + sv = &PutRetentionPolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentRegisterToWorkMailOutput(v **RegisterToWorkMailOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -7676,6 +11133,108 @@ func awsAwsjson11_deserializeOpDocumentResetPasswordOutput(v **ResetPasswordOutp return nil } +func awsAwsjson11_deserializeOpDocumentStartMailboxExportJobOutput(v **StartMailboxExportJobOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartMailboxExportJobOutput + if *v == nil { + sv = &StartMailboxExportJobOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "JobId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MailboxExportJobId to be of type string, got %T instead", value) + } + sv.JobId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *TagResourceOutput + if *v == nil { + sv = &TagResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentUntagResourceOutput(v **UntagResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UntagResourceOutput + if *v == nil { + sv = &UntagResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentUpdateMailboxQuotaOutput(v **UpdateMailboxQuotaOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/workmail/serializers.go b/service/workmail/serializers.go index fa07cd34dae..3946350dec2 100644 --- a/service/workmail/serializers.go +++ b/service/workmail/serializers.go @@ -106,14 +106,14 @@ func (m *awsAwsjson11_serializeOpAssociateMemberToGroup) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpCreateAlias struct { +type awsAwsjson11_serializeOpCancelMailboxExportJob struct { } -func (*awsAwsjson11_serializeOpCreateAlias) ID() string { +func (*awsAwsjson11_serializeOpCancelMailboxExportJob) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpCreateAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpCancelMailboxExportJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -121,7 +121,7 @@ func (m *awsAwsjson11_serializeOpCreateAlias) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*CreateAliasInput) + input, ok := in.Parameters.(*CancelMailboxExportJobInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -133,10 +133,10 @@ func (m *awsAwsjson11_serializeOpCreateAlias) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.CreateAlias") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.CancelMailboxExportJob") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentCreateAliasInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentCancelMailboxExportJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -152,14 +152,14 @@ func (m *awsAwsjson11_serializeOpCreateAlias) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpCreateGroup struct { +type awsAwsjson11_serializeOpCreateAlias struct { } -func (*awsAwsjson11_serializeOpCreateGroup) ID() string { +func (*awsAwsjson11_serializeOpCreateAlias) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpCreateGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpCreateAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -167,7 +167,7 @@ func (m *awsAwsjson11_serializeOpCreateGroup) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*CreateGroupInput) + input, ok := in.Parameters.(*CreateAliasInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -179,10 +179,10 @@ func (m *awsAwsjson11_serializeOpCreateGroup) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.CreateGroup") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.CreateAlias") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentCreateGroupInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentCreateAliasInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -198,14 +198,14 @@ func (m *awsAwsjson11_serializeOpCreateGroup) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpCreateResource struct { +type awsAwsjson11_serializeOpCreateGroup struct { } -func (*awsAwsjson11_serializeOpCreateResource) ID() string { +func (*awsAwsjson11_serializeOpCreateGroup) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpCreateResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpCreateGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -213,7 +213,7 @@ func (m *awsAwsjson11_serializeOpCreateResource) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*CreateResourceInput) + input, ok := in.Parameters.(*CreateGroupInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -225,10 +225,10 @@ func (m *awsAwsjson11_serializeOpCreateResource) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.CreateResource") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.CreateGroup") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentCreateResourceInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentCreateGroupInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -244,14 +244,14 @@ func (m *awsAwsjson11_serializeOpCreateResource) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpCreateUser struct { +type awsAwsjson11_serializeOpCreateOrganization struct { } -func (*awsAwsjson11_serializeOpCreateUser) ID() string { +func (*awsAwsjson11_serializeOpCreateOrganization) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpCreateUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpCreateOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -259,7 +259,7 @@ func (m *awsAwsjson11_serializeOpCreateUser) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*CreateUserInput) + input, ok := in.Parameters.(*CreateOrganizationInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -271,10 +271,10 @@ func (m *awsAwsjson11_serializeOpCreateUser) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.CreateUser") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.CreateOrganization") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentCreateUserInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentCreateOrganizationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -290,14 +290,14 @@ func (m *awsAwsjson11_serializeOpCreateUser) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDeleteAlias struct { +type awsAwsjson11_serializeOpCreateResource struct { } -func (*awsAwsjson11_serializeOpDeleteAlias) ID() string { +func (*awsAwsjson11_serializeOpCreateResource) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDeleteAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpCreateResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -305,7 +305,7 @@ func (m *awsAwsjson11_serializeOpDeleteAlias) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteAliasInput) + input, ok := in.Parameters.(*CreateResourceInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -317,10 +317,10 @@ func (m *awsAwsjson11_serializeOpDeleteAlias) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DeleteAlias") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.CreateResource") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeleteAliasInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentCreateResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -336,14 +336,14 @@ func (m *awsAwsjson11_serializeOpDeleteAlias) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDeleteGroup struct { +type awsAwsjson11_serializeOpCreateUser struct { } -func (*awsAwsjson11_serializeOpDeleteGroup) ID() string { +func (*awsAwsjson11_serializeOpCreateUser) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDeleteGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpCreateUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -351,7 +351,7 @@ func (m *awsAwsjson11_serializeOpDeleteGroup) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteGroupInput) + input, ok := in.Parameters.(*CreateUserInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -363,10 +363,10 @@ func (m *awsAwsjson11_serializeOpDeleteGroup) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DeleteGroup") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.CreateUser") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeleteGroupInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentCreateUserInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -382,14 +382,14 @@ func (m *awsAwsjson11_serializeOpDeleteGroup) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDeleteMailboxPermissions struct { +type awsAwsjson11_serializeOpDeleteAccessControlRule struct { } -func (*awsAwsjson11_serializeOpDeleteMailboxPermissions) ID() string { +func (*awsAwsjson11_serializeOpDeleteAccessControlRule) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDeleteMailboxPermissions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeleteAccessControlRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -397,7 +397,7 @@ func (m *awsAwsjson11_serializeOpDeleteMailboxPermissions) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteMailboxPermissionsInput) + input, ok := in.Parameters.(*DeleteAccessControlRuleInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -409,10 +409,10 @@ func (m *awsAwsjson11_serializeOpDeleteMailboxPermissions) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DeleteMailboxPermissions") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DeleteAccessControlRule") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeleteMailboxPermissionsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeleteAccessControlRuleInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -428,14 +428,14 @@ func (m *awsAwsjson11_serializeOpDeleteMailboxPermissions) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDeleteResource struct { +type awsAwsjson11_serializeOpDeleteAlias struct { } -func (*awsAwsjson11_serializeOpDeleteResource) ID() string { +func (*awsAwsjson11_serializeOpDeleteAlias) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDeleteResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeleteAlias) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -443,7 +443,7 @@ func (m *awsAwsjson11_serializeOpDeleteResource) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteResourceInput) + input, ok := in.Parameters.(*DeleteAliasInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -455,10 +455,10 @@ func (m *awsAwsjson11_serializeOpDeleteResource) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DeleteResource") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DeleteAlias") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeleteResourceInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeleteAliasInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -474,14 +474,14 @@ func (m *awsAwsjson11_serializeOpDeleteResource) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDeleteUser struct { +type awsAwsjson11_serializeOpDeleteGroup struct { } -func (*awsAwsjson11_serializeOpDeleteUser) ID() string { +func (*awsAwsjson11_serializeOpDeleteGroup) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDeleteUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeleteGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -489,7 +489,7 @@ func (m *awsAwsjson11_serializeOpDeleteUser) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteUserInput) + input, ok := in.Parameters.(*DeleteGroupInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -501,10 +501,10 @@ func (m *awsAwsjson11_serializeOpDeleteUser) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DeleteUser") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DeleteGroup") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeleteUserInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeleteGroupInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -520,14 +520,14 @@ func (m *awsAwsjson11_serializeOpDeleteUser) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDeregisterFromWorkMail struct { +type awsAwsjson11_serializeOpDeleteMailboxPermissions struct { } -func (*awsAwsjson11_serializeOpDeregisterFromWorkMail) ID() string { +func (*awsAwsjson11_serializeOpDeleteMailboxPermissions) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDeregisterFromWorkMail) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeleteMailboxPermissions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -535,7 +535,7 @@ func (m *awsAwsjson11_serializeOpDeregisterFromWorkMail) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeregisterFromWorkMailInput) + input, ok := in.Parameters.(*DeleteMailboxPermissionsInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -547,10 +547,10 @@ func (m *awsAwsjson11_serializeOpDeregisterFromWorkMail) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DeregisterFromWorkMail") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DeleteMailboxPermissions") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeregisterFromWorkMailInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeleteMailboxPermissionsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -566,14 +566,14 @@ func (m *awsAwsjson11_serializeOpDeregisterFromWorkMail) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDescribeGroup struct { +type awsAwsjson11_serializeOpDeleteOrganization struct { } -func (*awsAwsjson11_serializeOpDescribeGroup) ID() string { +func (*awsAwsjson11_serializeOpDeleteOrganization) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDescribeGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeleteOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -581,7 +581,7 @@ func (m *awsAwsjson11_serializeOpDescribeGroup) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeGroupInput) + input, ok := in.Parameters.(*DeleteOrganizationInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -593,10 +593,10 @@ func (m *awsAwsjson11_serializeOpDescribeGroup) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DescribeGroup") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DeleteOrganization") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeGroupInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeleteOrganizationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -612,14 +612,14 @@ func (m *awsAwsjson11_serializeOpDescribeGroup) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDescribeOrganization struct { +type awsAwsjson11_serializeOpDeleteResource struct { } -func (*awsAwsjson11_serializeOpDescribeOrganization) ID() string { +func (*awsAwsjson11_serializeOpDeleteResource) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDescribeOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeleteResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -627,7 +627,7 @@ func (m *awsAwsjson11_serializeOpDescribeOrganization) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeOrganizationInput) + input, ok := in.Parameters.(*DeleteResourceInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -639,10 +639,10 @@ func (m *awsAwsjson11_serializeOpDescribeOrganization) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DescribeOrganization") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DeleteResource") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeOrganizationInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeleteResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -658,14 +658,14 @@ func (m *awsAwsjson11_serializeOpDescribeOrganization) HandleSerialize(ctx conte return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDescribeResource struct { +type awsAwsjson11_serializeOpDeleteRetentionPolicy struct { } -func (*awsAwsjson11_serializeOpDescribeResource) ID() string { +func (*awsAwsjson11_serializeOpDeleteRetentionPolicy) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDescribeResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeleteRetentionPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -673,7 +673,7 @@ func (m *awsAwsjson11_serializeOpDescribeResource) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeResourceInput) + input, ok := in.Parameters.(*DeleteRetentionPolicyInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -685,10 +685,10 @@ func (m *awsAwsjson11_serializeOpDescribeResource) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DescribeResource") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DeleteRetentionPolicy") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeResourceInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeleteRetentionPolicyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -704,14 +704,14 @@ func (m *awsAwsjson11_serializeOpDescribeResource) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDescribeUser struct { +type awsAwsjson11_serializeOpDeleteUser struct { } -func (*awsAwsjson11_serializeOpDescribeUser) ID() string { +func (*awsAwsjson11_serializeOpDeleteUser) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDescribeUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeleteUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -719,7 +719,7 @@ func (m *awsAwsjson11_serializeOpDescribeUser) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeUserInput) + input, ok := in.Parameters.(*DeleteUserInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -731,10 +731,10 @@ func (m *awsAwsjson11_serializeOpDescribeUser) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DescribeUser") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DeleteUser") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeUserInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeleteUserInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -750,14 +750,14 @@ func (m *awsAwsjson11_serializeOpDescribeUser) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDisassociateDelegateFromResource struct { +type awsAwsjson11_serializeOpDeregisterFromWorkMail struct { } -func (*awsAwsjson11_serializeOpDisassociateDelegateFromResource) ID() string { +func (*awsAwsjson11_serializeOpDeregisterFromWorkMail) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDisassociateDelegateFromResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeregisterFromWorkMail) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -765,7 +765,7 @@ func (m *awsAwsjson11_serializeOpDisassociateDelegateFromResource) HandleSeriali return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DisassociateDelegateFromResourceInput) + input, ok := in.Parameters.(*DeregisterFromWorkMailInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -777,10 +777,10 @@ func (m *awsAwsjson11_serializeOpDisassociateDelegateFromResource) HandleSeriali return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DisassociateDelegateFromResource") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DeregisterFromWorkMail") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDisassociateDelegateFromResourceInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeregisterFromWorkMailInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -796,14 +796,14 @@ func (m *awsAwsjson11_serializeOpDisassociateDelegateFromResource) HandleSeriali return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDisassociateMemberFromGroup struct { +type awsAwsjson11_serializeOpDescribeGroup struct { } -func (*awsAwsjson11_serializeOpDisassociateMemberFromGroup) ID() string { +func (*awsAwsjson11_serializeOpDescribeGroup) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDisassociateMemberFromGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDescribeGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -811,7 +811,7 @@ func (m *awsAwsjson11_serializeOpDisassociateMemberFromGroup) HandleSerialize(ct return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DisassociateMemberFromGroupInput) + input, ok := in.Parameters.(*DescribeGroupInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -823,10 +823,10 @@ func (m *awsAwsjson11_serializeOpDisassociateMemberFromGroup) HandleSerialize(ct return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DisassociateMemberFromGroup") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DescribeGroup") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDisassociateMemberFromGroupInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDescribeGroupInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -842,14 +842,14 @@ func (m *awsAwsjson11_serializeOpDisassociateMemberFromGroup) HandleSerialize(ct return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpGetMailboxDetails struct { +type awsAwsjson11_serializeOpDescribeMailboxExportJob struct { } -func (*awsAwsjson11_serializeOpGetMailboxDetails) ID() string { +func (*awsAwsjson11_serializeOpDescribeMailboxExportJob) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpGetMailboxDetails) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDescribeMailboxExportJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -857,7 +857,7 @@ func (m *awsAwsjson11_serializeOpGetMailboxDetails) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetMailboxDetailsInput) + input, ok := in.Parameters.(*DescribeMailboxExportJobInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -869,10 +869,10 @@ func (m *awsAwsjson11_serializeOpGetMailboxDetails) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.GetMailboxDetails") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DescribeMailboxExportJob") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetMailboxDetailsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDescribeMailboxExportJobInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -888,14 +888,14 @@ func (m *awsAwsjson11_serializeOpGetMailboxDetails) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListAliases struct { +type awsAwsjson11_serializeOpDescribeOrganization struct { } -func (*awsAwsjson11_serializeOpListAliases) ID() string { +func (*awsAwsjson11_serializeOpDescribeOrganization) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListAliases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDescribeOrganization) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -903,7 +903,7 @@ func (m *awsAwsjson11_serializeOpListAliases) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListAliasesInput) + input, ok := in.Parameters.(*DescribeOrganizationInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -915,10 +915,10 @@ func (m *awsAwsjson11_serializeOpListAliases) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListAliases") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DescribeOrganization") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListAliasesInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDescribeOrganizationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -934,14 +934,14 @@ func (m *awsAwsjson11_serializeOpListAliases) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListGroupMembers struct { +type awsAwsjson11_serializeOpDescribeResource struct { } -func (*awsAwsjson11_serializeOpListGroupMembers) ID() string { +func (*awsAwsjson11_serializeOpDescribeResource) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListGroupMembers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDescribeResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -949,7 +949,7 @@ func (m *awsAwsjson11_serializeOpListGroupMembers) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListGroupMembersInput) + input, ok := in.Parameters.(*DescribeResourceInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -961,10 +961,10 @@ func (m *awsAwsjson11_serializeOpListGroupMembers) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListGroupMembers") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DescribeResource") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListGroupMembersInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDescribeResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -980,14 +980,14 @@ func (m *awsAwsjson11_serializeOpListGroupMembers) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListGroups struct { +type awsAwsjson11_serializeOpDescribeUser struct { } -func (*awsAwsjson11_serializeOpListGroups) ID() string { +func (*awsAwsjson11_serializeOpDescribeUser) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDescribeUser) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -995,7 +995,7 @@ func (m *awsAwsjson11_serializeOpListGroups) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListGroupsInput) + input, ok := in.Parameters.(*DescribeUserInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -1007,10 +1007,10 @@ func (m *awsAwsjson11_serializeOpListGroups) HandleSerialize(ctx context.Context return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListGroups") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DescribeUser") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListGroupsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDescribeUserInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1026,14 +1026,14 @@ func (m *awsAwsjson11_serializeOpListGroups) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListMailboxPermissions struct { +type awsAwsjson11_serializeOpDisassociateDelegateFromResource struct { } -func (*awsAwsjson11_serializeOpListMailboxPermissions) ID() string { +func (*awsAwsjson11_serializeOpDisassociateDelegateFromResource) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListMailboxPermissions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDisassociateDelegateFromResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1041,7 +1041,7 @@ func (m *awsAwsjson11_serializeOpListMailboxPermissions) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListMailboxPermissionsInput) + input, ok := in.Parameters.(*DisassociateDelegateFromResourceInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -1053,10 +1053,10 @@ func (m *awsAwsjson11_serializeOpListMailboxPermissions) HandleSerialize(ctx con return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListMailboxPermissions") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DisassociateDelegateFromResource") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListMailboxPermissionsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDisassociateDelegateFromResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1072,14 +1072,14 @@ func (m *awsAwsjson11_serializeOpListMailboxPermissions) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListOrganizations struct { +type awsAwsjson11_serializeOpDisassociateMemberFromGroup struct { } -func (*awsAwsjson11_serializeOpListOrganizations) ID() string { +func (*awsAwsjson11_serializeOpDisassociateMemberFromGroup) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListOrganizations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDisassociateMemberFromGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1087,7 +1087,7 @@ func (m *awsAwsjson11_serializeOpListOrganizations) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListOrganizationsInput) + input, ok := in.Parameters.(*DisassociateMemberFromGroupInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -1099,10 +1099,10 @@ func (m *awsAwsjson11_serializeOpListOrganizations) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListOrganizations") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.DisassociateMemberFromGroup") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListOrganizationsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDisassociateMemberFromGroupInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1118,14 +1118,14 @@ func (m *awsAwsjson11_serializeOpListOrganizations) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListResourceDelegates struct { +type awsAwsjson11_serializeOpGetAccessControlEffect struct { } -func (*awsAwsjson11_serializeOpListResourceDelegates) ID() string { +func (*awsAwsjson11_serializeOpGetAccessControlEffect) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListResourceDelegates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpGetAccessControlEffect) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1133,7 +1133,7 @@ func (m *awsAwsjson11_serializeOpListResourceDelegates) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListResourceDelegatesInput) + input, ok := in.Parameters.(*GetAccessControlEffectInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -1145,10 +1145,10 @@ func (m *awsAwsjson11_serializeOpListResourceDelegates) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListResourceDelegates") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.GetAccessControlEffect") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListResourceDelegatesInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentGetAccessControlEffectInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1164,14 +1164,14 @@ func (m *awsAwsjson11_serializeOpListResourceDelegates) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListResources struct { +type awsAwsjson11_serializeOpGetDefaultRetentionPolicy struct { } -func (*awsAwsjson11_serializeOpListResources) ID() string { +func (*awsAwsjson11_serializeOpGetDefaultRetentionPolicy) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListResources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpGetDefaultRetentionPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1179,7 +1179,7 @@ func (m *awsAwsjson11_serializeOpListResources) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListResourcesInput) + input, ok := in.Parameters.(*GetDefaultRetentionPolicyInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -1191,10 +1191,10 @@ func (m *awsAwsjson11_serializeOpListResources) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListResources") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.GetDefaultRetentionPolicy") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListResourcesInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentGetDefaultRetentionPolicyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1210,14 +1210,14 @@ func (m *awsAwsjson11_serializeOpListResources) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListUsers struct { +type awsAwsjson11_serializeOpGetMailboxDetails struct { } -func (*awsAwsjson11_serializeOpListUsers) ID() string { +func (*awsAwsjson11_serializeOpGetMailboxDetails) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListUsers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpGetMailboxDetails) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1225,7 +1225,7 @@ func (m *awsAwsjson11_serializeOpListUsers) HandleSerialize(ctx context.Context, return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListUsersInput) + input, ok := in.Parameters.(*GetMailboxDetailsInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -1237,10 +1237,10 @@ func (m *awsAwsjson11_serializeOpListUsers) HandleSerialize(ctx context.Context, return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListUsers") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.GetMailboxDetails") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListUsersInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentGetMailboxDetailsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1256,14 +1256,14 @@ func (m *awsAwsjson11_serializeOpListUsers) HandleSerialize(ctx context.Context, return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpPutMailboxPermissions struct { +type awsAwsjson11_serializeOpListAccessControlRules struct { } -func (*awsAwsjson11_serializeOpPutMailboxPermissions) ID() string { +func (*awsAwsjson11_serializeOpListAccessControlRules) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpPutMailboxPermissions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpListAccessControlRules) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1271,7 +1271,559 @@ func (m *awsAwsjson11_serializeOpPutMailboxPermissions) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*PutMailboxPermissionsInput) + input, ok := in.Parameters.(*ListAccessControlRulesInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListAccessControlRules") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListAccessControlRulesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListAliases struct { +} + +func (*awsAwsjson11_serializeOpListAliases) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListAliases) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListAliasesInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListAliases") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListAliasesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListGroupMembers struct { +} + +func (*awsAwsjson11_serializeOpListGroupMembers) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListGroupMembers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListGroupMembersInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListGroupMembers") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListGroupMembersInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListGroups struct { +} + +func (*awsAwsjson11_serializeOpListGroups) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListGroupsInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListGroups") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListGroupsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListMailboxExportJobs struct { +} + +func (*awsAwsjson11_serializeOpListMailboxExportJobs) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListMailboxExportJobs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListMailboxExportJobsInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListMailboxExportJobs") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListMailboxExportJobsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListMailboxPermissions struct { +} + +func (*awsAwsjson11_serializeOpListMailboxPermissions) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListMailboxPermissions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListMailboxPermissionsInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListMailboxPermissions") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListMailboxPermissionsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListOrganizations struct { +} + +func (*awsAwsjson11_serializeOpListOrganizations) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListOrganizations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListOrganizationsInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListOrganizations") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListOrganizationsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListResourceDelegates struct { +} + +func (*awsAwsjson11_serializeOpListResourceDelegates) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListResourceDelegates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListResourceDelegatesInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListResourceDelegates") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListResourceDelegatesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListResources struct { +} + +func (*awsAwsjson11_serializeOpListResources) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListResources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListResourcesInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListResources") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListResourcesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListTagsForResource struct { +} + +func (*awsAwsjson11_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListTagsForResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListUsers struct { +} + +func (*awsAwsjson11_serializeOpListUsers) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListUsers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListUsersInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ListUsers") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListUsersInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpPutAccessControlRule struct { +} + +func (*awsAwsjson11_serializeOpPutAccessControlRule) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpPutAccessControlRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutAccessControlRuleInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.PutAccessControlRule") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentPutAccessControlRuleInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpPutMailboxPermissions struct { +} + +func (*awsAwsjson11_serializeOpPutMailboxPermissions) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpPutMailboxPermissions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutMailboxPermissionsInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -1286,7 +1838,99 @@ func (m *awsAwsjson11_serializeOpPutMailboxPermissions) HandleSerialize(ctx cont httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.PutMailboxPermissions") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentPutMailboxPermissionsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentPutMailboxPermissionsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpPutRetentionPolicy struct { +} + +func (*awsAwsjson11_serializeOpPutRetentionPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpPutRetentionPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutRetentionPolicyInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.PutRetentionPolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentPutRetentionPolicyInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpRegisterToWorkMail struct { +} + +func (*awsAwsjson11_serializeOpRegisterToWorkMail) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpRegisterToWorkMail) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RegisterToWorkMailInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.RegisterToWorkMail") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentRegisterToWorkMailInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1302,14 +1946,14 @@ func (m *awsAwsjson11_serializeOpPutMailboxPermissions) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpRegisterToWorkMail struct { +type awsAwsjson11_serializeOpResetPassword struct { } -func (*awsAwsjson11_serializeOpRegisterToWorkMail) ID() string { +func (*awsAwsjson11_serializeOpResetPassword) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpRegisterToWorkMail) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpResetPassword) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1317,7 +1961,7 @@ func (m *awsAwsjson11_serializeOpRegisterToWorkMail) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*RegisterToWorkMailInput) + input, ok := in.Parameters.(*ResetPasswordInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -1329,10 +1973,10 @@ func (m *awsAwsjson11_serializeOpRegisterToWorkMail) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.RegisterToWorkMail") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ResetPassword") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentRegisterToWorkMailInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentResetPasswordInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1348,14 +1992,14 @@ func (m *awsAwsjson11_serializeOpRegisterToWorkMail) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpResetPassword struct { +type awsAwsjson11_serializeOpStartMailboxExportJob struct { } -func (*awsAwsjson11_serializeOpResetPassword) ID() string { +func (*awsAwsjson11_serializeOpStartMailboxExportJob) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpResetPassword) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpStartMailboxExportJob) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1363,7 +2007,7 @@ func (m *awsAwsjson11_serializeOpResetPassword) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ResetPasswordInput) + input, ok := in.Parameters.(*StartMailboxExportJobInput) if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } @@ -1375,10 +2019,102 @@ func (m *awsAwsjson11_serializeOpResetPassword) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.ResetPassword") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.StartMailboxExportJob") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentResetPasswordInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentStartMailboxExportJobInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpTagResource struct { +} + +func (*awsAwsjson11_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.TagResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpUntagResource struct { +} + +func (*awsAwsjson11_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + request.Request.URL.Path = "/" + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("WorkMailService.UntagResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1531,6 +2267,17 @@ func (m *awsAwsjson11_serializeOpUpdateResource) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } +func awsAwsjson11_serializeDocumentActionsList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentBookingOptions(v *types.BookingOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1553,6 +2300,82 @@ func awsAwsjson11_serializeDocumentBookingOptions(v *types.BookingOptions, value return nil } +func awsAwsjson11_serializeDocumentDomain(v *types.Domain, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DomainName != nil { + ok := object.Key("DomainName") + ok.String(*v.DomainName) + } + + if v.HostedZoneId != nil { + ok := object.Key("HostedZoneId") + ok.String(*v.HostedZoneId) + } + + return nil +} + +func awsAwsjson11_serializeDocumentDomains(v []types.Domain, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentDomain(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentFolderConfiguration(v *types.FolderConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Action) > 0 { + ok := object.Key("Action") + ok.String(string(v.Action)) + } + + if len(v.Name) > 0 { + ok := object.Key("Name") + ok.String(string(v.Name)) + } + + if v.Period != nil { + ok := object.Key("Period") + ok.Integer(*v.Period) + } + + return nil +} + +func awsAwsjson11_serializeDocumentFolderConfigurations(v []types.FolderConfiguration, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentFolderConfiguration(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentIpRangeList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentPermissionValues(v []types.PermissionType, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -1564,6 +2387,58 @@ func awsAwsjson11_serializeDocumentPermissionValues(v []types.PermissionType, va return nil } +func awsAwsjson11_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("Key") + ok.String(*v.Key) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsAwsjson11_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentUserIdList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeOpDocumentAssociateDelegateToResourceInput(v *AssociateDelegateToResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1608,6 +2483,28 @@ func awsAwsjson11_serializeOpDocumentAssociateMemberToGroupInput(v *AssociateMem return nil } +func awsAwsjson11_serializeOpDocumentCancelMailboxExportJobInput(v *CancelMailboxExportJobInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.JobId != nil { + ok := object.Key("JobId") + ok.String(*v.JobId) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentCreateAliasInput(v *CreateAliasInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1634,14 +2531,53 @@ func awsAwsjson11_serializeOpDocumentCreateGroupInput(v *CreateGroupInput, value object := value.Object() defer object.Close() - if v.Name != nil { - ok := object.Key("Name") - ok.String(*v.Name) + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentCreateOrganizationInput(v *CreateOrganizationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Alias != nil { + ok := object.Key("Alias") + ok.String(*v.Alias) + } + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.DirectoryId != nil { + ok := object.Key("DirectoryId") + ok.String(*v.DirectoryId) + } + + if v.Domains != nil { + ok := object.Key("Domains") + if err := awsAwsjson11_serializeDocumentDomains(v.Domains, ok); err != nil { + return err + } + } + + if v.EnableInteroperability { + ok := object.Key("EnableInteroperability") + ok.Boolean(v.EnableInteroperability) } - if v.OrganizationId != nil { - ok := object.Key("OrganizationId") - ok.String(*v.OrganizationId) + if v.KmsKeyArn != nil { + ok := object.Key("KmsKeyArn") + ok.String(*v.KmsKeyArn) } return nil @@ -1696,6 +2632,23 @@ func awsAwsjson11_serializeOpDocumentCreateUserInput(v *CreateUserInput, value s return nil } +func awsAwsjson11_serializeOpDocumentDeleteAccessControlRuleInput(v *DeleteAccessControlRuleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteAliasInput(v *DeleteAliasInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1757,6 +2710,28 @@ func awsAwsjson11_serializeOpDocumentDeleteMailboxPermissionsInput(v *DeleteMail return nil } +func awsAwsjson11_serializeOpDocumentDeleteOrganizationInput(v *DeleteOrganizationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.DeleteDirectory { + ok := object.Key("DeleteDirectory") + ok.Boolean(v.DeleteDirectory) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteResourceInput(v *DeleteResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1774,6 +2749,23 @@ func awsAwsjson11_serializeOpDocumentDeleteResourceInput(v *DeleteResourceInput, return nil } +func awsAwsjson11_serializeOpDocumentDeleteRetentionPolicyInput(v *DeleteRetentionPolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Id != nil { + ok := object.Key("Id") + ok.String(*v.Id) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteUserInput(v *DeleteUserInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1825,6 +2817,23 @@ func awsAwsjson11_serializeOpDocumentDescribeGroupInput(v *DescribeGroupInput, v return nil } +func awsAwsjson11_serializeOpDocumentDescribeMailboxExportJobInput(v *DescribeMailboxExportJobInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.JobId != nil { + ok := object.Key("JobId") + ok.String(*v.JobId) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDescribeOrganizationInput(v *DescribeOrganizationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1915,6 +2924,45 @@ func awsAwsjson11_serializeOpDocumentDisassociateMemberFromGroupInput(v *Disasso return nil } +func awsAwsjson11_serializeOpDocumentGetAccessControlEffectInput(v *GetAccessControlEffectInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Action != nil { + ok := object.Key("Action") + ok.String(*v.Action) + } + + if v.IpAddress != nil { + ok := object.Key("IpAddress") + ok.String(*v.IpAddress) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + if v.UserId != nil { + ok := object.Key("UserId") + ok.String(*v.UserId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetDefaultRetentionPolicyInput(v *GetDefaultRetentionPolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentGetMailboxDetailsInput(v *GetMailboxDetailsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1932,6 +2980,18 @@ func awsAwsjson11_serializeOpDocumentGetMailboxDetailsInput(v *GetMailboxDetails return nil } +func awsAwsjson11_serializeOpDocumentListAccessControlRulesInput(v *ListAccessControlRulesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListAliasesInput(v *ListAliasesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2008,6 +3068,28 @@ func awsAwsjson11_serializeOpDocumentListGroupsInput(v *ListGroupsInput, value s return nil } +func awsAwsjson11_serializeOpDocumentListMailboxExportJobsInput(v *ListMailboxExportJobsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListMailboxPermissionsInput(v *ListMailboxPermissionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2101,6 +3183,18 @@ func awsAwsjson11_serializeOpDocumentListResourcesInput(v *ListResourcesInput, v return nil } +func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceARN != nil { + ok := object.Key("ResourceARN") + ok.String(*v.ResourceARN) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListUsersInput(v *ListUsersInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2123,6 +3217,75 @@ func awsAwsjson11_serializeOpDocumentListUsersInput(v *ListUsersInput, value smi return nil } +func awsAwsjson11_serializeOpDocumentPutAccessControlRuleInput(v *PutAccessControlRuleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Actions != nil { + ok := object.Key("Actions") + if err := awsAwsjson11_serializeDocumentActionsList(v.Actions, ok); err != nil { + return err + } + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if len(v.Effect) > 0 { + ok := object.Key("Effect") + ok.String(string(v.Effect)) + } + + if v.IpRanges != nil { + ok := object.Key("IpRanges") + if err := awsAwsjson11_serializeDocumentIpRangeList(v.IpRanges, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.NotActions != nil { + ok := object.Key("NotActions") + if err := awsAwsjson11_serializeDocumentActionsList(v.NotActions, ok); err != nil { + return err + } + } + + if v.NotIpRanges != nil { + ok := object.Key("NotIpRanges") + if err := awsAwsjson11_serializeDocumentIpRangeList(v.NotIpRanges, ok); err != nil { + return err + } + } + + if v.NotUserIds != nil { + ok := object.Key("NotUserIds") + if err := awsAwsjson11_serializeDocumentUserIdList(v.NotUserIds, ok); err != nil { + return err + } + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + if v.UserIds != nil { + ok := object.Key("UserIds") + if err := awsAwsjson11_serializeDocumentUserIdList(v.UserIds, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentPutMailboxPermissionsInput(v *PutMailboxPermissionsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2152,6 +3315,40 @@ func awsAwsjson11_serializeOpDocumentPutMailboxPermissionsInput(v *PutMailboxPer return nil } +func awsAwsjson11_serializeOpDocumentPutRetentionPolicyInput(v *PutRetentionPolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.FolderConfigurations != nil { + ok := object.Key("FolderConfigurations") + if err := awsAwsjson11_serializeDocumentFolderConfigurations(v.FolderConfigurations, ok); err != nil { + return err + } + } + + if v.Id != nil { + ok := object.Key("Id") + ok.String(*v.Id) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentRegisterToWorkMailInput(v *RegisterToWorkMailInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2196,6 +3393,91 @@ func awsAwsjson11_serializeOpDocumentResetPasswordInput(v *ResetPasswordInput, v return nil } +func awsAwsjson11_serializeOpDocumentStartMailboxExportJobInput(v *StartMailboxExportJobInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.EntityId != nil { + ok := object.Key("EntityId") + ok.String(*v.EntityId) + } + + if v.KmsKeyArn != nil { + ok := object.Key("KmsKeyArn") + ok.String(*v.KmsKeyArn) + } + + if v.OrganizationId != nil { + ok := object.Key("OrganizationId") + ok.String(*v.OrganizationId) + } + + if v.RoleArn != nil { + ok := object.Key("RoleArn") + ok.String(*v.RoleArn) + } + + if v.S3BucketName != nil { + ok := object.Key("S3BucketName") + ok.String(*v.S3BucketName) + } + + if v.S3Prefix != nil { + ok := object.Key("S3Prefix") + ok.String(*v.S3Prefix) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceARN != nil { + ok := object.Key("ResourceARN") + ok.String(*v.ResourceARN) + } + + if v.Tags != nil { + ok := object.Key("Tags") + if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentUntagResourceInput(v *UntagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ResourceARN != nil { + ok := object.Key("ResourceARN") + ok.String(*v.ResourceARN) + } + + if v.TagKeys != nil { + ok := object.Key("TagKeys") + if err := awsAwsjson11_serializeDocumentTagKeyList(v.TagKeys, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentUpdateMailboxQuotaInput(v *UpdateMailboxQuotaInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/workmail/types/enums.go b/service/workmail/types/enums.go index 009696f4965..e7bc191a675 100644 --- a/service/workmail/types/enums.go +++ b/service/workmail/types/enums.go @@ -2,6 +2,24 @@ package types +type AccessControlRuleEffect string + +// Enum values for AccessControlRuleEffect +const ( + AccessControlRuleEffectAllow AccessControlRuleEffect = "ALLOW" + AccessControlRuleEffectDeny AccessControlRuleEffect = "DENY" +) + +// Values returns all known values for AccessControlRuleEffect. 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 (AccessControlRuleEffect) Values() []AccessControlRuleEffect { + return []AccessControlRuleEffect{ + "ALLOW", + "DENY", + } +} + type EntityState string // Enum values for EntityState @@ -22,6 +40,52 @@ func (EntityState) Values() []EntityState { } } +type FolderName string + +// Enum values for FolderName +const ( + FolderNameInbox FolderName = "INBOX" + FolderNameDeletedItems FolderName = "DELETED_ITEMS" + FolderNameSentItems FolderName = "SENT_ITEMS" + FolderNameDrafts FolderName = "DRAFTS" + FolderNameJunkEmail FolderName = "JUNK_EMAIL" +) + +// Values returns all known values for FolderName. 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 (FolderName) Values() []FolderName { + return []FolderName{ + "INBOX", + "DELETED_ITEMS", + "SENT_ITEMS", + "DRAFTS", + "JUNK_EMAIL", + } +} + +type MailboxExportJobState string + +// Enum values for MailboxExportJobState +const ( + MailboxExportJobStateRunning MailboxExportJobState = "RUNNING" + MailboxExportJobStateCompleted MailboxExportJobState = "COMPLETED" + MailboxExportJobStateFailed MailboxExportJobState = "FAILED" + MailboxExportJobStateCancelled MailboxExportJobState = "CANCELLED" +) + +// Values returns all known values for MailboxExportJobState. 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 (MailboxExportJobState) Values() []MailboxExportJobState { + return []MailboxExportJobState{ + "RUNNING", + "COMPLETED", + "FAILED", + "CANCELLED", + } +} + type MemberType string // Enum values for MemberType @@ -78,6 +142,26 @@ func (ResourceType) Values() []ResourceType { } } +type RetentionAction string + +// Enum values for RetentionAction +const ( + RetentionActionNone RetentionAction = "NONE" + RetentionActionDelete RetentionAction = "DELETE" + RetentionActionPermanentlyDelete RetentionAction = "PERMANENTLY_DELETE" +) + +// Values returns all known values for RetentionAction. 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 (RetentionAction) Values() []RetentionAction { + return []RetentionAction{ + "NONE", + "DELETE", + "PERMANENTLY_DELETE", + } +} + type UserRole string // Enum values for UserRole diff --git a/service/workmail/types/errors.go b/service/workmail/types/errors.go index a618addb01b..9ac82906b98 100644 --- a/service/workmail/types/errors.go +++ b/service/workmail/types/errors.go @@ -7,6 +7,24 @@ import ( smithy "github.com/aws/smithy-go" ) +// The directory is already in use by another WorkMail organization in the same +// account and Region. +type DirectoryInUseException struct { + Message *string +} + +func (e *DirectoryInUseException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *DirectoryInUseException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *DirectoryInUseException) ErrorCode() string { return "DirectoryInUseException" } +func (e *DirectoryInUseException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The directory service doesn't recognize the credentials supplied by WorkMail. type DirectoryServiceAuthenticationFailedException struct { Message *string @@ -28,7 +46,7 @@ func (e *DirectoryServiceAuthenticationFailedException) ErrorFault() smithy.Erro return smithy.FaultClient } -// The directory on which you are trying to perform operations isn't available. +// The directory is unavailable. It might be located in another Region or deleted. type DirectoryUnavailableException struct { Message *string } @@ -173,6 +191,23 @@ func (e *InvalidPasswordException) ErrorMessage() string { func (e *InvalidPasswordException) ErrorCode() string { return "InvalidPasswordException" } func (e *InvalidPasswordException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The request exceeds the limit of the resource. +type LimitExceededException struct { + Message *string +} + +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 { return "LimitExceededException" } +func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // For an email or alias to be created in Amazon WorkMail, the included domain must // be defined in the organization. type MailDomainNotFoundException struct { @@ -244,8 +279,8 @@ func (e *OrganizationNotFoundException) ErrorMessage() string { func (e *OrganizationNotFoundException) ErrorCode() string { return "OrganizationNotFoundException" } func (e *OrganizationNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The organization must have a valid state (Active or Synchronizing) to perform -// certain operations on the organization or its members. +// The organization must have a valid state to perform certain operations on the +// organization or its members. type OrganizationStateException struct { Message *string } @@ -279,6 +314,40 @@ func (e *ReservedNameException) ErrorMessage() string { func (e *ReservedNameException) ErrorCode() string { return "ReservedNameException" } func (e *ReservedNameException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The resource cannot be found. +type ResourceNotFoundException struct { + Message *string +} + +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 { return "ResourceNotFoundException" } +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The resource can have up to 50 user-applied tags. +type TooManyTagsException struct { + Message *string +} + +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 { return "TooManyTagsException" } +func (e *TooManyTagsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // You can't perform a write operation against a read-only directory. type UnsupportedOperationException struct { Message *string diff --git a/service/workmail/types/types.go b/service/workmail/types/types.go index e060bb34718..e3ac4d8c1ea 100644 --- a/service/workmail/types/types.go +++ b/service/workmail/types/types.go @@ -6,6 +6,45 @@ import ( "time" ) +// A rule that controls access to an Amazon WorkMail organization. +type AccessControlRule struct { + + // Access protocol actions to include in the rule. Valid values include ActiveSync, + // AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail. + Actions []string + + // The date that the rule was created. + DateCreated *time.Time + + // The date that the rule was modified. + DateModified *time.Time + + // The rule description. + Description *string + + // The rule effect. + Effect AccessControlRuleEffect + + // IPv4 CIDR ranges to include in the rule. + IpRanges []string + + // The rule name. + Name *string + + // Access protocol actions to exclude from the rule. Valid values include + // ActiveSync, AutoDiscover, EWS, IMAP, SMTP, WindowsOutlook, and WebMail. + NotActions []string + + // IPv4 CIDR ranges to exclude from the rule. + NotIpRanges []string + + // User IDs to exclude from the rule. + NotUserIds []string + + // User IDs to include in the rule. + UserIds []string +} + // At least one delegate must be associated to the resource to disable automatic // replies from the resource. type BookingOptions struct { @@ -36,6 +75,39 @@ type Delegate struct { Type MemberType } +// The domain to associate with an Amazon WorkMail organization. When you configure +// a domain hosted in Amazon Route 53 (Route 53), all recommended DNS records are +// added to the organization when you create it. For more information, see Adding a +// domain (https://docs.aws.amazon.com/workmail/latest/adminguide/add_domain.html) +// in the Amazon WorkMail Administrator Guide. +type Domain struct { + + // The fully qualified domain name. + DomainName *string + + // The hosted zone ID for a domain hosted in Route 53. Required when configuring a + // domain hosted in Route 53. + HostedZoneId *string +} + +// The configuration applied to an organization's folders by its retention policy. +type FolderConfiguration struct { + + // The action to take on the folder contents at the end of the folder configuration + // period. + // + // This member is required. + Action RetentionAction + + // The folder name. + // + // This member is required. + Name FolderName + + // The period of time at which the folder configuration action is applied. + Period *int32 +} + // The representation of an Amazon WorkMail group. type Group struct { @@ -58,6 +130,39 @@ type Group struct { State EntityState } +// The details of a mailbox export job, including the user or resource ID +// associated with the mailbox and the S3 bucket that the mailbox contents are +// exported to. +type MailboxExportJob struct { + + // The mailbox export job description. + Description *string + + // The mailbox export job end timestamp. + EndTime *time.Time + + // The identifier of the user or resource associated with the mailbox. + EntityId *string + + // The estimated progress of the mailbox export job, in percentage points. + EstimatedProgress int32 + + // The identifier of the mailbox export job. + JobId *string + + // The name of the S3 bucket. + S3BucketName *string + + // The path to the S3 bucket and file that the mailbox export job exports to. + S3Path *string + + // The mailbox export job start timestamp. + StartTime *time.Time + + // The state of the mailbox export job. + State MailboxExportJobState +} + // The representation of a user or group. type Member struct { @@ -86,6 +191,9 @@ type OrganizationSummary struct { // The alias associated with the organization. Alias *string + // The default email domain associated with the organization. + DefaultMailDomain *string + // The error message associated with the organization. It is only present if // unexpected behavior has occurred with regards to the organization. It provides // insight or solutions regarding unexpected behavior. @@ -149,6 +257,20 @@ type Resource struct { Type ResourceType } +// Describes a tag applied to a resource. +type Tag struct { + + // The key of the tag. + // + // This member is required. + Key *string + + // The value of the tag. + // + // This member is required. + Value *string +} + // The representation of an Amazon WorkMail user. type User struct { diff --git a/service/workmail/validators.go b/service/workmail/validators.go index 39bd90717a1..5310b19bd70 100644 --- a/service/workmail/validators.go +++ b/service/workmail/validators.go @@ -5,6 +5,7 @@ package workmail import ( "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/workmail/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/middleware" ) @@ -49,6 +50,26 @@ func (m *validateOpAssociateMemberToGroup) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpCancelMailboxExportJob struct { +} + +func (*validateOpCancelMailboxExportJob) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCancelMailboxExportJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CancelMailboxExportJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCancelMailboxExportJobInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateAlias struct { } @@ -89,6 +110,26 @@ func (m *validateOpCreateGroup) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpCreateOrganization struct { +} + +func (*validateOpCreateOrganization) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateOrganization) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateOrganizationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateOrganizationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateResource struct { } @@ -129,6 +170,26 @@ func (m *validateOpCreateUser) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpDeleteAccessControlRule struct { +} + +func (*validateOpDeleteAccessControlRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAccessControlRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAccessControlRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAccessControlRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteAlias struct { } @@ -189,6 +250,26 @@ func (m *validateOpDeleteMailboxPermissions) HandleInitialize(ctx context.Contex return next.HandleInitialize(ctx, in) } +type validateOpDeleteOrganization struct { +} + +func (*validateOpDeleteOrganization) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteOrganization) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteOrganizationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteOrganizationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteResource struct { } @@ -209,6 +290,26 @@ func (m *validateOpDeleteResource) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpDeleteRetentionPolicy struct { +} + +func (*validateOpDeleteRetentionPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteRetentionPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteRetentionPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteRetentionPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteUser struct { } @@ -269,6 +370,26 @@ func (m *validateOpDescribeGroup) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpDescribeMailboxExportJob struct { +} + +func (*validateOpDescribeMailboxExportJob) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeMailboxExportJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeMailboxExportJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeMailboxExportJobInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeOrganization struct { } @@ -369,6 +490,46 @@ func (m *validateOpDisassociateMemberFromGroup) HandleInitialize(ctx context.Con return next.HandleInitialize(ctx, in) } +type validateOpGetAccessControlEffect struct { +} + +func (*validateOpGetAccessControlEffect) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetAccessControlEffect) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetAccessControlEffectInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetAccessControlEffectInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetDefaultRetentionPolicy struct { +} + +func (*validateOpGetDefaultRetentionPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetDefaultRetentionPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetDefaultRetentionPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetDefaultRetentionPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetMailboxDetails struct { } @@ -389,6 +550,26 @@ func (m *validateOpGetMailboxDetails) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpListAccessControlRules struct { +} + +func (*validateOpListAccessControlRules) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListAccessControlRules) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListAccessControlRulesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListAccessControlRulesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListAliases struct { } @@ -449,6 +630,26 @@ func (m *validateOpListGroups) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpListMailboxExportJobs struct { +} + +func (*validateOpListMailboxExportJobs) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListMailboxExportJobs) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListMailboxExportJobsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListMailboxExportJobsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListMailboxPermissions struct { } @@ -509,6 +710,26 @@ func (m *validateOpListResources) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpListTagsForResource struct { +} + +func (*validateOpListTagsForResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTagsForResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListUsers struct { } @@ -529,6 +750,26 @@ func (m *validateOpListUsers) HandleInitialize(ctx context.Context, in middlewar return next.HandleInitialize(ctx, in) } +type validateOpPutAccessControlRule struct { +} + +func (*validateOpPutAccessControlRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutAccessControlRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutAccessControlRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutAccessControlRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpPutMailboxPermissions struct { } @@ -549,6 +790,26 @@ func (m *validateOpPutMailboxPermissions) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpPutRetentionPolicy struct { +} + +func (*validateOpPutRetentionPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutRetentionPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutRetentionPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutRetentionPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpRegisterToWorkMail struct { } @@ -589,6 +850,66 @@ func (m *validateOpResetPassword) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpStartMailboxExportJob struct { +} + +func (*validateOpStartMailboxExportJob) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartMailboxExportJob) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartMailboxExportJobInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartMailboxExportJobInput(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 validateOpUpdateMailboxQuota struct { } @@ -657,6 +978,10 @@ func addOpAssociateMemberToGroupValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpAssociateMemberToGroup{}, middleware.After) } +func addOpCancelMailboxExportJobValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCancelMailboxExportJob{}, middleware.After) +} + func addOpCreateAliasValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateAlias{}, middleware.After) } @@ -665,6 +990,10 @@ func addOpCreateGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateGroup{}, middleware.After) } +func addOpCreateOrganizationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateOrganization{}, middleware.After) +} + func addOpCreateResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateResource{}, middleware.After) } @@ -673,6 +1002,10 @@ func addOpCreateUserValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateUser{}, middleware.After) } +func addOpDeleteAccessControlRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAccessControlRule{}, middleware.After) +} + func addOpDeleteAliasValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteAlias{}, middleware.After) } @@ -685,10 +1018,18 @@ func addOpDeleteMailboxPermissionsValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpDeleteMailboxPermissions{}, middleware.After) } +func addOpDeleteOrganizationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteOrganization{}, middleware.After) +} + func addOpDeleteResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteResource{}, middleware.After) } +func addOpDeleteRetentionPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteRetentionPolicy{}, middleware.After) +} + func addOpDeleteUserValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteUser{}, middleware.After) } @@ -701,6 +1042,10 @@ func addOpDescribeGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeGroup{}, middleware.After) } +func addOpDescribeMailboxExportJobValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeMailboxExportJob{}, middleware.After) +} + func addOpDescribeOrganizationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeOrganization{}, middleware.After) } @@ -721,12 +1066,24 @@ func addOpDisassociateMemberFromGroupValidationMiddleware(stack *middleware.Stac return stack.Initialize.Add(&validateOpDisassociateMemberFromGroup{}, middleware.After) } -func addOpGetMailboxDetailsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetMailboxDetails{}, middleware.After) +func addOpGetAccessControlEffectValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetAccessControlEffect{}, middleware.After) } -func addOpListAliasesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpListAliases{}, middleware.After) +func addOpGetDefaultRetentionPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetDefaultRetentionPolicy{}, middleware.After) +} + +func addOpGetMailboxDetailsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetMailboxDetails{}, middleware.After) +} + +func addOpListAccessControlRulesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAccessControlRules{}, middleware.After) +} + +func addOpListAliasesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListAliases{}, middleware.After) } func addOpListGroupMembersValidationMiddleware(stack *middleware.Stack) error { @@ -737,6 +1094,10 @@ func addOpListGroupsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListGroups{}, middleware.After) } +func addOpListMailboxExportJobsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListMailboxExportJobs{}, middleware.After) +} + func addOpListMailboxPermissionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListMailboxPermissions{}, middleware.After) } @@ -749,14 +1110,26 @@ func addOpListResourcesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListResources{}, middleware.After) } +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + func addOpListUsersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListUsers{}, middleware.After) } +func addOpPutAccessControlRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutAccessControlRule{}, middleware.After) +} + func addOpPutMailboxPermissionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutMailboxPermissions{}, middleware.After) } +func addOpPutRetentionPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutRetentionPolicy{}, middleware.After) +} + func addOpRegisterToWorkMailValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpRegisterToWorkMail{}, middleware.After) } @@ -765,6 +1138,18 @@ func addOpResetPasswordValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpResetPassword{}, middleware.After) } +func addOpStartMailboxExportJobValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartMailboxExportJob{}, 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 addOpUpdateMailboxQuotaValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateMailboxQuota{}, middleware.After) } @@ -777,6 +1162,76 @@ func addOpUpdateResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateResource{}, middleware.After) } +func validateFolderConfiguration(v *types.FolderConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FolderConfiguration"} + if len(v.Name) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.Action) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Action")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFolderConfigurations(v []types.FolderConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FolderConfigurations"} + for i := range v { + if err := validateFolderConfiguration(&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 validateOpAssociateDelegateToResourceInput(v *AssociateDelegateToResourceInput) error { if v == nil { return nil @@ -819,6 +1274,27 @@ func validateOpAssociateMemberToGroupInput(v *AssociateMemberToGroupInput) error } } +func validateOpCancelMailboxExportJobInput(v *CancelMailboxExportJobInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CancelMailboxExportJobInput"} + if v.ClientToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientToken")) + } + if v.JobId == nil { + invalidParams.Add(smithy.NewErrParamRequired("JobId")) + } + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateAliasInput(v *CreateAliasInput) error { if v == nil { return nil @@ -858,6 +1334,21 @@ func validateOpCreateGroupInput(v *CreateGroupInput) error { } } +func validateOpCreateOrganizationInput(v *CreateOrganizationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateOrganizationInput"} + if v.Alias == nil { + invalidParams.Add(smithy.NewErrParamRequired("Alias")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateResourceInput(v *CreateResourceInput) error { if v == nil { return nil @@ -903,6 +1394,24 @@ func validateOpCreateUserInput(v *CreateUserInput) error { } } +func validateOpDeleteAccessControlRuleInput(v *DeleteAccessControlRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAccessControlRuleInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteAliasInput(v *DeleteAliasInput) error { if v == nil { return nil @@ -963,6 +1472,21 @@ func validateOpDeleteMailboxPermissionsInput(v *DeleteMailboxPermissionsInput) e } } +func validateOpDeleteOrganizationInput(v *DeleteOrganizationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteOrganizationInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteResourceInput(v *DeleteResourceInput) error { if v == nil { return nil @@ -981,6 +1505,24 @@ func validateOpDeleteResourceInput(v *DeleteResourceInput) error { } } +func validateOpDeleteRetentionPolicyInput(v *DeleteRetentionPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteRetentionPolicyInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteUserInput(v *DeleteUserInput) error { if v == nil { return nil @@ -1035,6 +1577,24 @@ func validateOpDescribeGroupInput(v *DescribeGroupInput) error { } } +func validateOpDescribeMailboxExportJobInput(v *DescribeMailboxExportJobInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeMailboxExportJobInput"} + if v.JobId == nil { + invalidParams.Add(smithy.NewErrParamRequired("JobId")) + } + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeOrganizationInput(v *DescribeOrganizationInput) error { if v == nil { return nil @@ -1128,6 +1688,45 @@ func validateOpDisassociateMemberFromGroupInput(v *DisassociateMemberFromGroupIn } } +func validateOpGetAccessControlEffectInput(v *GetAccessControlEffectInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetAccessControlEffectInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if v.IpAddress == nil { + invalidParams.Add(smithy.NewErrParamRequired("IpAddress")) + } + if v.Action == nil { + invalidParams.Add(smithy.NewErrParamRequired("Action")) + } + if v.UserId == nil { + invalidParams.Add(smithy.NewErrParamRequired("UserId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetDefaultRetentionPolicyInput(v *GetDefaultRetentionPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetDefaultRetentionPolicyInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetMailboxDetailsInput(v *GetMailboxDetailsInput) error { if v == nil { return nil @@ -1146,6 +1745,21 @@ func validateOpGetMailboxDetailsInput(v *GetMailboxDetailsInput) error { } } +func validateOpListAccessControlRulesInput(v *ListAccessControlRulesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListAccessControlRulesInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListAliasesInput(v *ListAliasesInput) error { if v == nil { return nil @@ -1197,6 +1811,21 @@ func validateOpListGroupsInput(v *ListGroupsInput) error { } } +func validateOpListMailboxExportJobsInput(v *ListMailboxExportJobsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListMailboxExportJobsInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListMailboxPermissionsInput(v *ListMailboxPermissionsInput) error { if v == nil { return nil @@ -1248,6 +1877,21 @@ func validateOpListResourcesInput(v *ListResourcesInput) error { } } +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 validateOpListUsersInput(v *ListUsersInput) error { if v == nil { return nil @@ -1263,6 +1907,30 @@ func validateOpListUsersInput(v *ListUsersInput) error { } } +func validateOpPutAccessControlRuleInput(v *PutAccessControlRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutAccessControlRuleInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.Effect) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Effect")) + } + if v.Description == nil { + invalidParams.Add(smithy.NewErrParamRequired("Description")) + } + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpPutMailboxPermissionsInput(v *PutMailboxPermissionsInput) error { if v == nil { return nil @@ -1287,6 +1955,31 @@ func validateOpPutMailboxPermissionsInput(v *PutMailboxPermissionsInput) error { } } +func validateOpPutRetentionPolicyInput(v *PutRetentionPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutRetentionPolicyInput"} + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.FolderConfigurations == nil { + invalidParams.Add(smithy.NewErrParamRequired("FolderConfigurations")) + } else if v.FolderConfigurations != nil { + if err := validateFolderConfigurations(v.FolderConfigurations); err != nil { + invalidParams.AddNested("FolderConfigurations", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpRegisterToWorkMailInput(v *RegisterToWorkMailInput) error { if v == nil { return nil @@ -1329,6 +2022,79 @@ func validateOpResetPasswordInput(v *ResetPasswordInput) error { } } +func validateOpStartMailboxExportJobInput(v *StartMailboxExportJobInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartMailboxExportJobInput"} + if v.ClientToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("ClientToken")) + } + if v.OrganizationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("OrganizationId")) + } + if v.EntityId == nil { + invalidParams.Add(smithy.NewErrParamRequired("EntityId")) + } + if v.RoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("RoleArn")) + } + if v.KmsKeyArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("KmsKeyArn")) + } + if v.S3BucketName == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3BucketName")) + } + if v.S3Prefix == nil { + invalidParams.Add(smithy.NewErrParamRequired("S3Prefix")) + } + 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 validateOpUpdateMailboxQuotaInput(v *UpdateMailboxQuotaInput) error { if v == nil { return nil