diff --git a/.changelog/3cb31ffd91d747daa76b867de862ecfd.json b/.changelog/3cb31ffd91d747daa76b867de862ecfd.json new file mode 100644 index 00000000000..3fbb7e6a5d2 --- /dev/null +++ b/.changelog/3cb31ffd91d747daa76b867de862ecfd.json @@ -0,0 +1,8 @@ +{ + "id": "3cb31ffd-91d7-47da-a76b-867de862ecfd", + "type": "feature", + "description": "This release adds a new --workgroup-name field to operations that connect to an endpoint. Customers can now execute queries against their serverless workgroups.", + "modules": [ + "service/redshiftdata" + ] +} \ No newline at end of file diff --git a/.changelog/64b11c3b8f714c618c25e64c293ecffb.json b/.changelog/64b11c3b8f714c618c25e64c293ecffb.json new file mode 100644 index 00000000000..31db0f02781 --- /dev/null +++ b/.changelog/64b11c3b8f714c618c25e64c293ecffb.json @@ -0,0 +1,8 @@ +{ + "id": "64b11c3b-8f71-4c61-8c25-e64c293ecffb", + "type": "feature", + "description": "Add new API operations for Amazon Redshift Serverless, a new way of using Amazon Redshift without needing to manually manage provisioned clusters. The new operations let you interact with Redshift Serverless resources, such as create snapshots, list VPC endpoints, delete resource policies, and more.", + "modules": [ + "service/redshiftserverless" + ] +} \ No newline at end of file diff --git a/.changelog/7a30a7c80544460d8be12f09296d2feb.json b/.changelog/7a30a7c80544460d8be12f09296d2feb.json new file mode 100644 index 00000000000..7a1437d6243 --- /dev/null +++ b/.changelog/7a30a7c80544460d8be12f09296d2feb.json @@ -0,0 +1,8 @@ +{ + "id": "7a30a7c8-0544-460d-8be1-2f09296d2feb", + "type": "documentation", + "description": "Documentation updates for Secrets Manager", + "modules": [ + "service/secretsmanager" + ] +} \ No newline at end of file diff --git a/.changelog/89a8d8f694e44872bafaca78ce8cef49.json b/.changelog/89a8d8f694e44872bafaca78ce8cef49.json new file mode 100644 index 00000000000..4e6523dab94 --- /dev/null +++ b/.changelog/89a8d8f694e44872bafaca78ce8cef49.json @@ -0,0 +1,8 @@ +{ + "id": "89a8d8f6-94e4-4872-bafa-ca78ce8cef49", + "type": "feature", + "description": "Added Threats field for security findings. Added new resource details for ECS Container, ECS Task, RDS SecurityGroup, Kinesis Stream, EC2 TransitGateway, EFS AccessPoint, CloudFormation Stack, CloudWatch Alarm, VPC Peering Connection and WAF Rules", + "modules": [ + "service/securityhub" + ] +} \ No newline at end of file diff --git a/service/drs/internal/endpoints/endpoints.go b/service/drs/internal/endpoints/endpoints.go index d20e26fc0c6..6eb8ee548af 100644 --- a/service/drs/internal/endpoints/endpoints.go +++ b/service/drs/internal/endpoints/endpoints.go @@ -135,30 +135,66 @@ var defaultPartitions = endpoints.Partitions{ RegionRegex: partitionRegexp.Aws, IsRegionalized: true, Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "af-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-east-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-south-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "sa-east-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, diff --git a/service/redshiftdata/api_op_BatchExecuteStatement.go b/service/redshiftdata/api_op_BatchExecuteStatement.go index 093cf1c8a6c..2f18ac592b4 100644 --- a/service/redshiftdata/api_op_BatchExecuteStatement.go +++ b/service/redshiftdata/api_op_BatchExecuteStatement.go @@ -18,14 +18,15 @@ import ( // * Secrets Manager - // when connecting to a cluster, specify the Amazon Resource Name (ARN) of the // secret, the database name, and the cluster identifier that matches the cluster -// in the secret. When connecting to a serverless endpoint, specify the Amazon +// in the secret. When connecting to a serverless workgroup, specify the Amazon // Resource Name (ARN) of the secret and the database name. // // * Temporary // credentials - when connecting to a cluster, specify the cluster identifier, the // database name, and the database user name. Also, permission to call the // redshift:GetClusterCredentials operation is required. When connecting to a -// serverless endpoint, specify the database name. +// serverless workgroup, specify the workgroup name and database name. Also, +// permission to call the redshift-serverless:GetCredentials operation is required. func (c *Client) BatchExecuteStatement(ctx context.Context, params *BatchExecuteStatementInput, optFns ...func(*Options)) (*BatchExecuteStatementOutput, error) { if params == nil { params = &BatchExecuteStatementInput{} @@ -74,13 +75,18 @@ type BatchExecuteStatementInput struct { // bus after the SQL statements run. WithEvent *bool + // The serverless workgroup name. This parameter is required when connecting to a + // serverless workgroup and authenticating using either Secrets Manager or + // temporary credentials. + WorkgroupName *string + noSmithyDocumentSerde } type BatchExecuteStatementOutput struct { - // The cluster identifier. This parameter is not returned when connecting to a - // serverless endpoint. + // The cluster identifier. This element is not returned when connecting to a + // serverless workgroup. ClusterIdentifier *string // The date and time (UTC) the statement was created. @@ -100,6 +106,10 @@ type BatchExecuteStatementOutput struct { // The name or ARN of the secret that enables access to the database. SecretArn *string + // The serverless workgroup name. This element is not returned when connecting to a + // provisioned cluster. + WorkgroupName *string + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/redshiftdata/api_op_DescribeStatement.go b/service/redshiftdata/api_op_DescribeStatement.go index e548fe99eaa..adbd9e1a802 100644 --- a/service/redshiftdata/api_op_DescribeStatement.go +++ b/service/redshiftdata/api_op_DescribeStatement.go @@ -133,6 +133,9 @@ type DescribeStatementOutput struct { // updated. An example is the time the status last changed. UpdatedAt *time.Time + // The serverless workgroup name. + WorkgroupName *string + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/redshiftdata/api_op_DescribeTable.go b/service/redshiftdata/api_op_DescribeTable.go index 322cde12964..57b4ca0fd39 100644 --- a/service/redshiftdata/api_op_DescribeTable.go +++ b/service/redshiftdata/api_op_DescribeTable.go @@ -20,14 +20,15 @@ import ( // * Secrets Manager - when connecting to a // cluster, specify the Amazon Resource Name (ARN) of the secret, the database // name, and the cluster identifier that matches the cluster in the secret. When -// connecting to a serverless endpoint, specify the Amazon Resource Name (ARN) of +// connecting to a serverless workgroup, specify the Amazon Resource Name (ARN) of // the secret and the database name. // // * Temporary credentials - when connecting to // a cluster, specify the cluster identifier, the database name, and the database // user name. Also, permission to call the redshift:GetClusterCredentials operation -// is required. When connecting to a serverless endpoint, specify the database -// name. +// is required. When connecting to a serverless workgroup, specify the workgroup +// name and database name. Also, permission to call the +// redshift-serverless:GetCredentials operation is required. func (c *Client) DescribeTable(ctx context.Context, params *DescribeTableInput, optFns ...func(*Options)) (*DescribeTableOutput, error) { if params == nil { params = &DescribeTableInput{} @@ -89,6 +90,11 @@ type DescribeTableInput struct { // for all schemas in the database are returned Table *string + // The serverless workgroup name. This parameter is required when connecting to a + // serverless workgroup and authenticating using either Secrets Manager or + // temporary credentials. + WorkgroupName *string + noSmithyDocumentSerde } diff --git a/service/redshiftdata/api_op_ExecuteStatement.go b/service/redshiftdata/api_op_ExecuteStatement.go index 403bd01909f..de491d4de38 100644 --- a/service/redshiftdata/api_op_ExecuteStatement.go +++ b/service/redshiftdata/api_op_ExecuteStatement.go @@ -20,13 +20,15 @@ import ( // * Secrets Manager - when connecting to a cluster, specify // the Amazon Resource Name (ARN) of the secret, the database name, and the cluster // identifier that matches the cluster in the secret. When connecting to a -// serverless endpoint, specify the Amazon Resource Name (ARN) of the secret and +// serverless workgroup, specify the Amazon Resource Name (ARN) of the secret and // the database name. // // * Temporary credentials - when connecting to a cluster, // specify the cluster identifier, the database name, and the database user name. // Also, permission to call the redshift:GetClusterCredentials operation is -// required. When connecting to a serverless endpoint, specify the database name. +// required. When connecting to a serverless workgroup, specify the workgroup name +// and database name. Also, permission to call the +// redshift-serverless:GetCredentials operation is required. func (c *Client) ExecuteStatement(ctx context.Context, params *ExecuteStatementInput, optFns ...func(*Options)) (*ExecuteStatementOutput, error) { if params == nil { params = &ExecuteStatementInput{} @@ -78,13 +80,18 @@ type ExecuteStatementInput struct { // bus after the SQL statement runs. WithEvent *bool + // The serverless workgroup name. This parameter is required when connecting to a + // serverless workgroup and authenticating using either Secrets Manager or + // temporary credentials. + WorkgroupName *string + noSmithyDocumentSerde } type ExecuteStatementOutput struct { - // The cluster identifier. This parameter is not returned when connecting to a - // serverless endpoint. + // The cluster identifier. This element is not returned when connecting to a + // serverless workgroup. ClusterIdentifier *string // The date and time (UTC) the statement was created. @@ -103,6 +110,10 @@ type ExecuteStatementOutput struct { // The name or ARN of the secret that enables access to the database. SecretArn *string + // The serverless workgroup name. This element is not returned when connecting to a + // provisioned cluster. + WorkgroupName *string + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/redshiftdata/api_op_ListDatabases.go b/service/redshiftdata/api_op_ListDatabases.go index 2f4fcd55c98..e67b2650df7 100644 --- a/service/redshiftdata/api_op_ListDatabases.go +++ b/service/redshiftdata/api_op_ListDatabases.go @@ -18,14 +18,15 @@ import ( // * Secrets Manager - when connecting to a // cluster, specify the Amazon Resource Name (ARN) of the secret, the database // name, and the cluster identifier that matches the cluster in the secret. When -// connecting to a serverless endpoint, specify the Amazon Resource Name (ARN) of +// connecting to a serverless workgroup, specify the Amazon Resource Name (ARN) of // the secret and the database name. // // * Temporary credentials - when connecting to // a cluster, specify the cluster identifier, the database name, and the database // user name. Also, permission to call the redshift:GetClusterCredentials operation -// is required. When connecting to a serverless endpoint, specify the database -// name. +// is required. When connecting to a serverless workgroup, specify the workgroup +// name and database name. Also, permission to call the +// redshift-serverless:GetCredentials operation is required. func (c *Client) ListDatabases(ctx context.Context, params *ListDatabasesInput, optFns ...func(*Options)) (*ListDatabasesOutput, error) { if params == nil { params = &ListDatabasesInput{} @@ -73,6 +74,11 @@ type ListDatabasesInput struct { // parameter is required when authenticating using Secrets Manager. SecretArn *string + // The serverless workgroup name. This parameter is required when connecting to a + // serverless workgroup and authenticating using either Secrets Manager or + // temporary credentials. + WorkgroupName *string + noSmithyDocumentSerde } diff --git a/service/redshiftdata/api_op_ListSchemas.go b/service/redshiftdata/api_op_ListSchemas.go index 387950d521f..7b12238061e 100644 --- a/service/redshiftdata/api_op_ListSchemas.go +++ b/service/redshiftdata/api_op_ListSchemas.go @@ -18,14 +18,15 @@ import ( // * Secrets Manager - when connecting to a // cluster, specify the Amazon Resource Name (ARN) of the secret, the database // name, and the cluster identifier that matches the cluster in the secret. When -// connecting to a serverless endpoint, specify the Amazon Resource Name (ARN) of +// connecting to a serverless workgroup, specify the Amazon Resource Name (ARN) of // the secret and the database name. // // * Temporary credentials - when connecting to // a cluster, specify the cluster identifier, the database name, and the database // user name. Also, permission to call the redshift:GetClusterCredentials operation -// is required. When connecting to a serverless endpoint, specify the database -// name. +// is required. When connecting to a serverless workgroup, specify the workgroup +// name and database name. Also, permission to call the +// redshift-serverless:GetCredentials operation is required. func (c *Client) ListSchemas(ctx context.Context, params *ListSchemasInput, optFns ...func(*Options)) (*ListSchemasOutput, error) { if params == nil { params = &ListSchemasInput{} @@ -83,6 +84,11 @@ type ListSchemasInput struct { // parameter is required when authenticating using Secrets Manager. SecretArn *string + // The serverless workgroup name. This parameter is required when connecting to a + // serverless workgroup and authenticating using either Secrets Manager or + // temporary credentials. + WorkgroupName *string + noSmithyDocumentSerde } diff --git a/service/redshiftdata/api_op_ListTables.go b/service/redshiftdata/api_op_ListTables.go index cd30ad76d9e..592991981aa 100644 --- a/service/redshiftdata/api_op_ListTables.go +++ b/service/redshiftdata/api_op_ListTables.go @@ -20,14 +20,15 @@ import ( // * Secrets Manager - when // connecting to a cluster, specify the Amazon Resource Name (ARN) of the secret, // the database name, and the cluster identifier that matches the cluster in the -// secret. When connecting to a serverless endpoint, specify the Amazon Resource +// secret. When connecting to a serverless workgroup, specify the Amazon Resource // Name (ARN) of the secret and the database name. // // * Temporary credentials - when // connecting to a cluster, specify the cluster identifier, the database name, and // the database user name. Also, permission to call the // redshift:GetClusterCredentials operation is required. When connecting to a -// serverless endpoint, specify the database name. +// serverless workgroup, specify the workgroup name and database name. Also, +// permission to call the redshift-serverless:GetCredentials operation is required. func (c *Client) ListTables(ctx context.Context, params *ListTablesInput, optFns ...func(*Options)) (*ListTablesOutput, error) { if params == nil { params = &ListTablesInput{} @@ -96,6 +97,11 @@ type ListTablesInput struct { // tables are returned. TablePattern *string + // The serverless workgroup name. This parameter is required when connecting to a + // serverless workgroup and authenticating using either Secrets Manager or + // temporary credentials. + WorkgroupName *string + noSmithyDocumentSerde } diff --git a/service/redshiftdata/deserializers.go b/service/redshiftdata/deserializers.go index b7e3ca73292..379aed197a4 100644 --- a/service/redshiftdata/deserializers.go +++ b/service/redshiftdata/deserializers.go @@ -2895,6 +2895,15 @@ func awsAwsjson11_deserializeOpDocumentBatchExecuteStatementOutput(v **BatchExec sv.SecretArn = ptr.String(jtv) } + case "WorkgroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkgroupNameString to be of type string, got %T instead", value) + } + sv.WorkgroupName = ptr.String(jtv) + } + default: _, _ = key, value @@ -3154,6 +3163,15 @@ func awsAwsjson11_deserializeOpDocumentDescribeStatementOutput(v **DescribeState } } + case "WorkgroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkgroupNameString to be of type string, got %T instead", value) + } + sv.WorkgroupName = ptr.String(jtv) + } + default: _, _ = key, value @@ -3300,6 +3318,15 @@ func awsAwsjson11_deserializeOpDocumentExecuteStatementOutput(v **ExecuteStateme sv.SecretArn = ptr.String(jtv) } + case "WorkgroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkgroupNameString to be of type string, got %T instead", value) + } + sv.WorkgroupName = ptr.String(jtv) + } + default: _, _ = key, value diff --git a/service/redshiftdata/doc.go b/service/redshiftdata/doc.go index b0665a241cb..d07f4d2868d 100644 --- a/service/redshiftdata/doc.go +++ b/service/redshiftdata/doc.go @@ -5,8 +5,8 @@ // // You can use the Amazon Redshift Data API to run queries on Amazon Redshift // tables. You can run SQL statements, which are committed if the statement -// succeeds. For more information about the Amazon Redshift Data API, see Using the -// Amazon Redshift Data API +// succeeds. For more information about the Amazon Redshift Data API and CLI usage +// examples, see Using the Amazon Redshift Data API // (https://docs.aws.amazon.com/redshift/latest/mgmt/data-api.html) in the Amazon // Redshift Cluster Management Guide. package redshiftdata diff --git a/service/redshiftdata/serializers.go b/service/redshiftdata/serializers.go index b1ffd9ddfed..78ddb61a3e3 100644 --- a/service/redshiftdata/serializers.go +++ b/service/redshiftdata/serializers.go @@ -646,6 +646,11 @@ func awsAwsjson11_serializeOpDocumentBatchExecuteStatementInput(v *BatchExecuteS ok.Boolean(*v.WithEvent) } + if v.WorkgroupName != nil { + ok := object.Key("WorkgroupName") + ok.String(*v.WorkgroupName) + } + return nil } @@ -722,6 +727,11 @@ func awsAwsjson11_serializeOpDocumentDescribeTableInput(v *DescribeTableInput, v ok.String(*v.Table) } + if v.WorkgroupName != nil { + ok := object.Key("WorkgroupName") + ok.String(*v.WorkgroupName) + } + return nil } @@ -771,6 +781,11 @@ func awsAwsjson11_serializeOpDocumentExecuteStatementInput(v *ExecuteStatementIn ok.Boolean(*v.WithEvent) } + if v.WorkgroupName != nil { + ok := object.Key("WorkgroupName") + ok.String(*v.WorkgroupName) + } + return nil } @@ -825,6 +840,11 @@ func awsAwsjson11_serializeOpDocumentListDatabasesInput(v *ListDatabasesInput, v ok.String(*v.SecretArn) } + if v.WorkgroupName != nil { + ok := object.Key("WorkgroupName") + ok.String(*v.WorkgroupName) + } + return nil } @@ -872,6 +892,11 @@ func awsAwsjson11_serializeOpDocumentListSchemasInput(v *ListSchemasInput, value ok.String(*v.SecretArn) } + if v.WorkgroupName != nil { + ok := object.Key("WorkgroupName") + ok.String(*v.WorkgroupName) + } + return nil } @@ -956,5 +981,10 @@ func awsAwsjson11_serializeOpDocumentListTablesInput(v *ListTablesInput, value s ok.String(*v.TablePattern) } + if v.WorkgroupName != nil { + ok := object.Key("WorkgroupName") + ok.String(*v.WorkgroupName) + } + return nil } diff --git a/service/redshiftserverless/api_client.go b/service/redshiftserverless/api_client.go new file mode 100644 index 00000000000..12ea79dfdef --- /dev/null +++ b/service/redshiftserverless/api_client.go @@ -0,0 +1,433 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "time" +) + +const ServiceID = "RedshiftServerless" +const ServiceAPIVersion = "2021-04-21" + +// Client provides the API client to make operations call for Redshift Serverless. +type Client struct { + options Options +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveDefaultEndpointConfiguration(&options) + + for _, fn := range optFns { + fn(&options) + } + + client := &Client{ + options: options, + } + + return client +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + EndpointResolver EndpointResolver + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. If specified in an operation call's functional + // options with a value that is different than the constructed client's Options, + // the Client's Retryer will be wrapped to use the operation's specific + // RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. Currently does not support per operation call + // overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig. You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. Currently does not support per operation call + // overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} +func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { + ctx = middleware.ClearStackValues(ctx) + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttemptOptions(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) + result, metadata, err = handler.Handle(ctx, params) + if err != nil { + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + return result, metadata, err +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttemptOptions(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "redshiftserverless", goModuleVersion)(stack) +} + +func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: o.Credentials, + Signer: o.HTTPSignerV4, + LogSigning: o.ClientLogMode.IsSigning(), + }) + return stack.Finalize.Add(mw, middleware.After) +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} diff --git a/service/redshiftserverless/api_client_test.go b/service/redshiftserverless/api_client_test.go new file mode 100644 index 00000000000..eefa23411b3 --- /dev/null +++ b/service/redshiftserverless/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io/ioutil" + "net/http" + "strings" + "testing" +) + +func TestClient_resolveRetryOptions(t *testing.T) { + nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(strings.NewReader("")), + }, nil + }) + + cases := map[string]struct { + defaultsMode aws.DefaultsMode + retryer aws.Retryer + retryMaxAttempts int + opRetryMaxAttempts *int + retryMode aws.RetryMode + expectClientRetryMode aws.RetryMode + expectClientMaxAttempts int + expectOpMaxAttempts int + }{ + "defaults": { + defaultsMode: aws.DefaultsModeStandard, + expectClientRetryMode: aws.RetryModeStandard, + expectClientMaxAttempts: 3, + expectOpMaxAttempts: 3, + }, + "custom default retry": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(2), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 2, + }, + "custom op no change max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(10), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op 0 max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(0), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + client := NewFromConfig(aws.Config{ + DefaultsMode: c.defaultsMode, + Retryer: func() func() aws.Retryer { + if c.retryer == nil { + return nil + } + + return func() aws.Retryer { return c.retryer } + }(), + HTTPClient: nopClient, + RetryMaxAttempts: c.retryMaxAttempts, + RetryMode: c.retryMode, + }) + + if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { + t.Errorf("expect %v retry mode, got %v", e, a) + } + if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v max attempts, got %v", e, a) + } + + _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, + []func(*Options){ + func(o *Options) { + if c.opRetryMaxAttempts == nil { + return + } + o.RetryMaxAttempts = *c.opRetryMaxAttempts + }, + }, + func(s *middleware.Stack, o Options) error { + s.Initialize.Clear() + s.Serialize.Clear() + s.Build.Clear() + s.Finalize.Clear() + s.Deserialize.Clear() + + if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v op max attempts, got %v", e, a) + } + return nil + }) + if err != nil { + t.Fatalf("expect no operation error, got %v", err) + } + }) + } +} diff --git a/service/redshiftserverless/api_op_ConvertRecoveryPointToSnapshot.go b/service/redshiftserverless/api_op_ConvertRecoveryPointToSnapshot.go new file mode 100644 index 00000000000..0516da3e688 --- /dev/null +++ b/service/redshiftserverless/api_op_ConvertRecoveryPointToSnapshot.go @@ -0,0 +1,131 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Converts a recovery point to a snapshot. For more information about recovery +// points and snapshots, see Working with snapshots and recovery points +// (https://docs.aws.amazon.com/redshift/latest/mgmt/serverless-snapshots-recovery.html). +func (c *Client) ConvertRecoveryPointToSnapshot(ctx context.Context, params *ConvertRecoveryPointToSnapshotInput, optFns ...func(*Options)) (*ConvertRecoveryPointToSnapshotOutput, error) { + if params == nil { + params = &ConvertRecoveryPointToSnapshotInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ConvertRecoveryPointToSnapshot", params, optFns, c.addOperationConvertRecoveryPointToSnapshotMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ConvertRecoveryPointToSnapshotOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ConvertRecoveryPointToSnapshotInput struct { + + // The unique identifier of the recovery point. + // + // This member is required. + RecoveryPointId *string + + // The name of the snapshot. + // + // This member is required. + SnapshotName *string + + // How long to retain the snapshot. + RetentionPeriod *int32 + + noSmithyDocumentSerde +} + +type ConvertRecoveryPointToSnapshotOutput struct { + + // The snapshot converted from the recovery point. + Snapshot *types.Snapshot + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationConvertRecoveryPointToSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpConvertRecoveryPointToSnapshot{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpConvertRecoveryPointToSnapshot{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpConvertRecoveryPointToSnapshotValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opConvertRecoveryPointToSnapshot(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_opConvertRecoveryPointToSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "ConvertRecoveryPointToSnapshot", + } +} diff --git a/service/redshiftserverless/api_op_CreateEndpointAccess.go b/service/redshiftserverless/api_op_CreateEndpointAccess.go new file mode 100644 index 00000000000..fa86a0ddf66 --- /dev/null +++ b/service/redshiftserverless/api_op_CreateEndpointAccess.go @@ -0,0 +1,138 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an Amazon Redshift Serverless managed VPC endpoint. +func (c *Client) CreateEndpointAccess(ctx context.Context, params *CreateEndpointAccessInput, optFns ...func(*Options)) (*CreateEndpointAccessOutput, error) { + if params == nil { + params = &CreateEndpointAccessInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateEndpointAccess", params, optFns, c.addOperationCreateEndpointAccessMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateEndpointAccessOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateEndpointAccessInput struct { + + // The name of the VPC endpoint. An endpoint name must contain 1-30 characters. + // Valid characters are A-Z, a-z, 0-9, and hyphen(-). The first character must be a + // letter. The name can't contain two consecutive hyphens or end with a hyphen. + // + // This member is required. + EndpointName *string + + // The unique identifers of subnets from which Amazon Redshift Serverless chooses + // one to deploy a VPC endpoint. + // + // This member is required. + SubnetIds []string + + // The name of the workgroup to associate with the VPC endpoint. + // + // This member is required. + WorkgroupName *string + + // The unique identifiers of the security group that defines the ports, protocols, + // and sources for inbound traffic that you are authorizing into your endpoint. + VpcSecurityGroupIds []string + + noSmithyDocumentSerde +} + +type CreateEndpointAccessOutput struct { + + // The created VPC endpoint. + Endpoint *types.EndpointAccess + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateEndpointAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateEndpointAccess{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateEndpointAccess{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateEndpointAccessValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateEndpointAccess(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_opCreateEndpointAccess(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "CreateEndpointAccess", + } +} diff --git a/service/redshiftserverless/api_op_CreateNamespace.go b/service/redshiftserverless/api_op_CreateNamespace.go new file mode 100644 index 00000000000..d7bc3870452 --- /dev/null +++ b/service/redshiftserverless/api_op_CreateNamespace.go @@ -0,0 +1,150 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a namespace in Amazon Redshift Serverless. +func (c *Client) CreateNamespace(ctx context.Context, params *CreateNamespaceInput, optFns ...func(*Options)) (*CreateNamespaceOutput, error) { + if params == nil { + params = &CreateNamespaceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateNamespace", params, optFns, c.addOperationCreateNamespaceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateNamespaceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateNamespaceInput struct { + + // The name of the namespace. + // + // This member is required. + NamespaceName *string + + // The password of the administrator for the first database created in the + // namespace. + AdminUserPassword *string + + // The username of the administrator for the first database created in the + // namespace. + AdminUsername *string + + // The name of the first database created in the namespace. + DbName *string + + // The Amazon Resource Name (ARN) of the IAM role to set as a default in the + // namespace. + DefaultIamRoleArn *string + + // A list of IAM roles to associate with the namespace. + IamRoles []string + + // The ID of the Amazon Web Services Key Management Service key used to encrypt + // your data. + KmsKeyId *string + + // The types of logs the namespace can export. Available export types are userlog, + // connectionlog, and useractivitylog. + LogExports []types.LogExport + + // A list of tag instances. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateNamespaceOutput struct { + + // The created namespace object. + Namespace *types.Namespace + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateNamespaceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateNamespace{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateNamespace{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateNamespaceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateNamespace(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_opCreateNamespace(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "CreateNamespace", + } +} diff --git a/service/redshiftserverless/api_op_CreateSnapshot.go b/service/redshiftserverless/api_op_CreateSnapshot.go new file mode 100644 index 00000000000..8d8d1f68817 --- /dev/null +++ b/service/redshiftserverless/api_op_CreateSnapshot.go @@ -0,0 +1,131 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a snapshot of all databases in a namespace. For more information about +// snapshots, see Working with snapshots and recovery points +// (https://docs.aws.amazon.com/redshift/latest/mgmt/serverless-snapshots-recovery.html). +func (c *Client) CreateSnapshot(ctx context.Context, params *CreateSnapshotInput, optFns ...func(*Options)) (*CreateSnapshotOutput, error) { + if params == nil { + params = &CreateSnapshotInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateSnapshot", params, optFns, c.addOperationCreateSnapshotMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateSnapshotOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateSnapshotInput struct { + + // The namespace to create a snapshot for. + // + // This member is required. + NamespaceName *string + + // The name of the snapshot. + // + // This member is required. + SnapshotName *string + + // How long to retain the created snapshot. + RetentionPeriod *int32 + + noSmithyDocumentSerde +} + +type CreateSnapshotOutput struct { + + // The created snapshot object. + Snapshot *types.Snapshot + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateSnapshot{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateSnapshot{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateSnapshotValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSnapshot(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_opCreateSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "CreateSnapshot", + } +} diff --git a/service/redshiftserverless/api_op_CreateUsageLimit.go b/service/redshiftserverless/api_op_CreateUsageLimit.go new file mode 100644 index 00000000000..b1b8b9a5eed --- /dev/null +++ b/service/redshiftserverless/api_op_CreateUsageLimit.go @@ -0,0 +1,144 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a usage limit for a specified Amazon Redshift Serverless usage type. The +// usage limit is identified by the returned usage limit identifier. +func (c *Client) CreateUsageLimit(ctx context.Context, params *CreateUsageLimitInput, optFns ...func(*Options)) (*CreateUsageLimitOutput, error) { + if params == nil { + params = &CreateUsageLimitInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateUsageLimit", params, optFns, c.addOperationCreateUsageLimitMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateUsageLimitOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateUsageLimitInput struct { + + // The limit amount. If time-based, this amount is in Redshift Processing Units + // (RPU) consumed per hour. If data-based, this amount is in terabytes (TB) of data + // transferred between Regions in cross-account sharing. The value must be a + // positive number. + // + // This member is required. + Amount *int64 + + // The Amazon Resource Name (ARN) of the Amazon Redshift Serverless resource to + // create the usage limit for. + // + // This member is required. + ResourceArn *string + + // The type of Amazon Redshift Serverless usage to create a usage limit for. + // + // This member is required. + UsageType types.UsageLimitUsageType + + // The action that Amazon Redshift Serverless takes when the limit is reached. The + // default is log. + BreachAction types.UsageLimitBreachAction + + // The time period that the amount applies to. A weekly period begins on Sunday. + // The default is monthly. + Period types.UsageLimitPeriod + + noSmithyDocumentSerde +} + +type CreateUsageLimitOutput struct { + + // The returned usage limit object. + UsageLimit *types.UsageLimit + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateUsageLimitMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateUsageLimit{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateUsageLimit{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateUsageLimitValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateUsageLimit(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_opCreateUsageLimit(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "CreateUsageLimit", + } +} diff --git a/service/redshiftserverless/api_op_CreateWorkgroup.go b/service/redshiftserverless/api_op_CreateWorkgroup.go new file mode 100644 index 00000000000..8ef35992039 --- /dev/null +++ b/service/redshiftserverless/api_op_CreateWorkgroup.go @@ -0,0 +1,153 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an workgroup in Amazon Redshift Serverless. +func (c *Client) CreateWorkgroup(ctx context.Context, params *CreateWorkgroupInput, optFns ...func(*Options)) (*CreateWorkgroupOutput, error) { + if params == nil { + params = &CreateWorkgroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateWorkgroup", params, optFns, c.addOperationCreateWorkgroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateWorkgroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateWorkgroupInput struct { + + // The name of the namespace to associate with the workgroup. + // + // This member is required. + NamespaceName *string + + // The name of the created workgroup. + // + // This member is required. + WorkgroupName *string + + // The base data warehouse capacity of the workgroup in Redshift Processing Units + // (RPUs). + BaseCapacity *int32 + + // An array of parameters to set for more control over a serverless database. The + // options are datestyle, enable_user_activity_logging, query_group, search_path, + // and max_query_execution_time. + ConfigParameters []types.ConfigParameter + + // The value that specifies whether to turn on enhanced virtual private cloud (VPC) + // routing, which forces Amazon Redshift Serverless to route traffic through your + // VPC instead of over the internet. + EnhancedVpcRouting *bool + + // A value that specifies whether the workgroup can be accessed from a public + // network. + PubliclyAccessible *bool + + // An array of security group IDs to associate with the workgroup. + SecurityGroupIds []string + + // An array of VPC subnet IDs to associate with the workgroup. + SubnetIds []string + + // A array of tag instances. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateWorkgroupOutput struct { + + // The created workgroup object. + Workgroup *types.Workgroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateWorkgroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateWorkgroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateWorkgroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateWorkgroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWorkgroup(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_opCreateWorkgroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "CreateWorkgroup", + } +} diff --git a/service/redshiftserverless/api_op_DeleteEndpointAccess.go b/service/redshiftserverless/api_op_DeleteEndpointAccess.go new file mode 100644 index 00000000000..cb0526f9e6a --- /dev/null +++ b/service/redshiftserverless/api_op_DeleteEndpointAccess.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an Amazon Redshift Serverless managed VPC endpoint. +func (c *Client) DeleteEndpointAccess(ctx context.Context, params *DeleteEndpointAccessInput, optFns ...func(*Options)) (*DeleteEndpointAccessOutput, error) { + if params == nil { + params = &DeleteEndpointAccessInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteEndpointAccess", params, optFns, c.addOperationDeleteEndpointAccessMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteEndpointAccessOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteEndpointAccessInput struct { + + // The name of the VPC endpoint to delete. + // + // This member is required. + EndpointName *string + + noSmithyDocumentSerde +} + +type DeleteEndpointAccessOutput struct { + + // The deleted VPC endpoint. + Endpoint *types.EndpointAccess + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteEndpointAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteEndpointAccess{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteEndpointAccess{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteEndpointAccessValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteEndpointAccess(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_opDeleteEndpointAccess(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "DeleteEndpointAccess", + } +} diff --git a/service/redshiftserverless/api_op_DeleteNamespace.go b/service/redshiftserverless/api_op_DeleteNamespace.go new file mode 100644 index 00000000000..2e495410e42 --- /dev/null +++ b/service/redshiftserverless/api_op_DeleteNamespace.go @@ -0,0 +1,131 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a namespace from Amazon Redshift Serverless. Before you delete the +// namespace, you can create a final snapshot that has all of the data within the +// namespace. +func (c *Client) DeleteNamespace(ctx context.Context, params *DeleteNamespaceInput, optFns ...func(*Options)) (*DeleteNamespaceOutput, error) { + if params == nil { + params = &DeleteNamespaceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteNamespace", params, optFns, c.addOperationDeleteNamespaceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteNamespaceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteNamespaceInput struct { + + // The name of the namespace to delete. + // + // This member is required. + NamespaceName *string + + // The name of the snapshot to be created before the namespace is deleted. + FinalSnapshotName *string + + // How long to retain the final snapshot. + FinalSnapshotRetentionPeriod *int32 + + noSmithyDocumentSerde +} + +type DeleteNamespaceOutput struct { + + // The deleted namespace object. + // + // This member is required. + Namespace *types.Namespace + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteNamespaceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteNamespace{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteNamespace{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteNamespaceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteNamespace(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_opDeleteNamespace(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "DeleteNamespace", + } +} diff --git a/service/redshiftserverless/api_op_DeleteResourcePolicy.go b/service/redshiftserverless/api_op_DeleteResourcePolicy.go new file mode 100644 index 00000000000..ed54c71f9c5 --- /dev/null +++ b/service/redshiftserverless/api_op_DeleteResourcePolicy.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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 resource policy. +func (c *Client) DeleteResourcePolicy(ctx context.Context, params *DeleteResourcePolicyInput, optFns ...func(*Options)) (*DeleteResourcePolicyOutput, error) { + if params == nil { + params = &DeleteResourcePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteResourcePolicy", params, optFns, c.addOperationDeleteResourcePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteResourcePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteResourcePolicyInput struct { + + // The Amazon Resource Name (ARN) of the policy to delete. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type DeleteResourcePolicyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteResourcePolicy{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteResourcePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteResourcePolicy(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_opDeleteResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "DeleteResourcePolicy", + } +} diff --git a/service/redshiftserverless/api_op_DeleteSnapshot.go b/service/redshiftserverless/api_op_DeleteSnapshot.go new file mode 100644 index 00000000000..d4a6344656a --- /dev/null +++ b/service/redshiftserverless/api_op_DeleteSnapshot.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a snapshot from Amazon Redshift Serverless. +func (c *Client) DeleteSnapshot(ctx context.Context, params *DeleteSnapshotInput, optFns ...func(*Options)) (*DeleteSnapshotOutput, error) { + if params == nil { + params = &DeleteSnapshotInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteSnapshot", params, optFns, c.addOperationDeleteSnapshotMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteSnapshotOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteSnapshotInput struct { + + // The name of the snapshot to be deleted. + // + // This member is required. + SnapshotName *string + + noSmithyDocumentSerde +} + +type DeleteSnapshotOutput struct { + + // The deleted snapshot object. + Snapshot *types.Snapshot + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteSnapshot{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteSnapshot{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteSnapshotValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSnapshot(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_opDeleteSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "DeleteSnapshot", + } +} diff --git a/service/redshiftserverless/api_op_DeleteUsageLimit.go b/service/redshiftserverless/api_op_DeleteUsageLimit.go new file mode 100644 index 00000000000..bf4932900a4 --- /dev/null +++ b/service/redshiftserverless/api_op_DeleteUsageLimit.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a usage limit from Amazon Redshift Serverless. +func (c *Client) DeleteUsageLimit(ctx context.Context, params *DeleteUsageLimitInput, optFns ...func(*Options)) (*DeleteUsageLimitOutput, error) { + if params == nil { + params = &DeleteUsageLimitInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteUsageLimit", params, optFns, c.addOperationDeleteUsageLimitMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteUsageLimitOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteUsageLimitInput struct { + + // The unique identifier of the usage limit to delete. + // + // This member is required. + UsageLimitId *string + + noSmithyDocumentSerde +} + +type DeleteUsageLimitOutput struct { + + // The deleted usage limit object. + UsageLimit *types.UsageLimit + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteUsageLimitMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteUsageLimit{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteUsageLimit{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteUsageLimitValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteUsageLimit(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_opDeleteUsageLimit(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "DeleteUsageLimit", + } +} diff --git a/service/redshiftserverless/api_op_DeleteWorkgroup.go b/service/redshiftserverless/api_op_DeleteWorkgroup.go new file mode 100644 index 00000000000..fd7b68a9a3c --- /dev/null +++ b/service/redshiftserverless/api_op_DeleteWorkgroup.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a workgroup. +func (c *Client) DeleteWorkgroup(ctx context.Context, params *DeleteWorkgroupInput, optFns ...func(*Options)) (*DeleteWorkgroupOutput, error) { + if params == nil { + params = &DeleteWorkgroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteWorkgroup", params, optFns, c.addOperationDeleteWorkgroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteWorkgroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteWorkgroupInput struct { + + // The name of the workgroup to be deleted. + // + // This member is required. + WorkgroupName *string + + noSmithyDocumentSerde +} + +type DeleteWorkgroupOutput struct { + + // The deleted workgroup object. + // + // This member is required. + Workgroup *types.Workgroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteWorkgroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteWorkgroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteWorkgroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteWorkgroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteWorkgroup(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_opDeleteWorkgroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "DeleteWorkgroup", + } +} diff --git a/service/redshiftserverless/api_op_GetCredentials.go b/service/redshiftserverless/api_op_GetCredentials.go new file mode 100644 index 00000000000..52ee5366d48 --- /dev/null +++ b/service/redshiftserverless/api_op_GetCredentials.go @@ -0,0 +1,165 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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 a database user name and temporary password with temporary authorization +// to log in to Amazon Redshift Serverless. By default, the temporary credentials +// expire in 900 seconds. You can optionally specify a duration between 900 seconds +// (15 minutes) and 3600 seconds (60 minutes). The Identity and Access Management +// (IAM) user or role that runs GetCredentials must have an IAM policy attached +// that allows access to all necessary actions and resources. If the DbName +// parameter is specified, the IAM policy must allow access to the resource dbname +// for the specified database name. +func (c *Client) GetCredentials(ctx context.Context, params *GetCredentialsInput, optFns ...func(*Options)) (*GetCredentialsOutput, error) { + if params == nil { + params = &GetCredentialsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetCredentials", params, optFns, c.addOperationGetCredentialsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetCredentialsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetCredentialsInput struct { + + // The name of the workgroup associated with the database. + // + // This member is required. + WorkgroupName *string + + // The name of the database to get temporary authorization to log on to. + // Constraints: + // + // * Must be 1 to 64 alphanumeric characters or hyphens. + // + // * Must + // contain only lowercase letters, numbers, underscore, plus sign, period (dot), at + // symbol (@), or hyphen. + // + // * The first character must be a letter. + // + // * Must not + // contain a colon ( : ) or slash ( / ). + // + // * Cannot be a reserved word. A list of + // reserved words can be found in Reserved Words + // (https://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html) in the + // Amazon Redshift Database Developer Guide + DbName *string + + // The number of seconds until the returned temporary password expires. The minimum + // is 900 seconds, and the maximum is 3600 seconds. + DurationSeconds *int32 + + noSmithyDocumentSerde +} + +type GetCredentialsOutput struct { + + // A temporary password that authorizes the user name returned by DbUser to log on + // to the database DbName. + DbPassword *string + + // A database user name that is authorized to log on to the database DbName using + // the password DbPassword. If the specified DbUser exists in the database, the new + // user name has the same database privileges as the the user named in DbUser. By + // default, the user is added to PUBLIC. + DbUser *string + + // The date and time the password in DbPassword expires. + Expiration *time.Time + + // The date and time of when the DbUser and DbPassword authorization refreshes. + NextRefreshTime *time.Time + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetCredentialsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetCredentials{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetCredentials{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetCredentialsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCredentials(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_opGetCredentials(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "GetCredentials", + } +} diff --git a/service/redshiftserverless/api_op_GetEndpointAccess.go b/service/redshiftserverless/api_op_GetEndpointAccess.go new file mode 100644 index 00000000000..6814260326b --- /dev/null +++ b/service/redshiftserverless/api_op_GetEndpointAccess.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information, such as the name, about a VPC endpoint. +func (c *Client) GetEndpointAccess(ctx context.Context, params *GetEndpointAccessInput, optFns ...func(*Options)) (*GetEndpointAccessOutput, error) { + if params == nil { + params = &GetEndpointAccessInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetEndpointAccess", params, optFns, c.addOperationGetEndpointAccessMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetEndpointAccessOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetEndpointAccessInput struct { + + // The name of the VPC endpoint to return information for. + // + // This member is required. + EndpointName *string + + noSmithyDocumentSerde +} + +type GetEndpointAccessOutput struct { + + // The returned VPC endpoint. + Endpoint *types.EndpointAccess + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetEndpointAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetEndpointAccess{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetEndpointAccess{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetEndpointAccessValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetEndpointAccess(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_opGetEndpointAccess(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "GetEndpointAccess", + } +} diff --git a/service/redshiftserverless/api_op_GetNamespace.go b/service/redshiftserverless/api_op_GetNamespace.go new file mode 100644 index 00000000000..b1a41e11abf --- /dev/null +++ b/service/redshiftserverless/api_op_GetNamespace.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about a namespace in Amazon Redshift Serverless. +func (c *Client) GetNamespace(ctx context.Context, params *GetNamespaceInput, optFns ...func(*Options)) (*GetNamespaceOutput, error) { + if params == nil { + params = &GetNamespaceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetNamespace", params, optFns, c.addOperationGetNamespaceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetNamespaceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetNamespaceInput struct { + + // The name of the namespace to retrieve information for. + // + // This member is required. + NamespaceName *string + + noSmithyDocumentSerde +} + +type GetNamespaceOutput struct { + + // The returned namespace object. + // + // This member is required. + Namespace *types.Namespace + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetNamespaceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetNamespace{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetNamespace{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetNamespaceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetNamespace(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_opGetNamespace(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "GetNamespace", + } +} diff --git a/service/redshiftserverless/api_op_GetRecoveryPoint.go b/service/redshiftserverless/api_op_GetRecoveryPoint.go new file mode 100644 index 00000000000..1ac2952ab99 --- /dev/null +++ b/service/redshiftserverless/api_op_GetRecoveryPoint.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about a recovery point. +func (c *Client) GetRecoveryPoint(ctx context.Context, params *GetRecoveryPointInput, optFns ...func(*Options)) (*GetRecoveryPointOutput, error) { + if params == nil { + params = &GetRecoveryPointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetRecoveryPoint", params, optFns, c.addOperationGetRecoveryPointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetRecoveryPointOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetRecoveryPointInput struct { + + // The unique identifier of the recovery point to return information for. + // + // This member is required. + RecoveryPointId *string + + noSmithyDocumentSerde +} + +type GetRecoveryPointOutput struct { + + // The returned recovery point object. + RecoveryPoint *types.RecoveryPoint + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetRecoveryPointMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetRecoveryPoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetRecoveryPoint{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetRecoveryPointValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRecoveryPoint(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_opGetRecoveryPoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "GetRecoveryPoint", + } +} diff --git a/service/redshiftserverless/api_op_GetResourcePolicy.go b/service/redshiftserverless/api_op_GetResourcePolicy.go new file mode 100644 index 00000000000..fa51a029001 --- /dev/null +++ b/service/redshiftserverless/api_op_GetResourcePolicy.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a resource policy. +func (c *Client) GetResourcePolicy(ctx context.Context, params *GetResourcePolicyInput, optFns ...func(*Options)) (*GetResourcePolicyOutput, error) { + if params == nil { + params = &GetResourcePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetResourcePolicy", params, optFns, c.addOperationGetResourcePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetResourcePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetResourcePolicyInput struct { + + // The Amazon Resource Name (ARN) of the resource to return. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type GetResourcePolicyOutput struct { + + // The returned resource policy. + ResourcePolicy *types.ResourcePolicy + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetResourcePolicy{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetResourcePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetResourcePolicy(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_opGetResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "GetResourcePolicy", + } +} diff --git a/service/redshiftserverless/api_op_GetSnapshot.go b/service/redshiftserverless/api_op_GetSnapshot.go new file mode 100644 index 00000000000..cbd45b4b0dd --- /dev/null +++ b/service/redshiftserverless/api_op_GetSnapshot.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about a specific snapshot. +func (c *Client) GetSnapshot(ctx context.Context, params *GetSnapshotInput, optFns ...func(*Options)) (*GetSnapshotOutput, error) { + if params == nil { + params = &GetSnapshotInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSnapshot", params, optFns, c.addOperationGetSnapshotMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSnapshotOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSnapshotInput struct { + + // The owner Amazon Web Services account of a snapshot shared with another user. + OwnerAccount *string + + // The Amazon Resource Name (ARN) of the snapshot to return. + SnapshotArn *string + + // The name of the snapshot to return. + SnapshotName *string + + noSmithyDocumentSerde +} + +type GetSnapshotOutput struct { + + // The returned snapshot object. + Snapshot *types.Snapshot + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetSnapshot{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetSnapshot{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opGetSnapshot(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_opGetSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "GetSnapshot", + } +} diff --git a/service/redshiftserverless/api_op_GetUsageLimit.go b/service/redshiftserverless/api_op_GetUsageLimit.go new file mode 100644 index 00000000000..c51207d59e0 --- /dev/null +++ b/service/redshiftserverless/api_op_GetUsageLimit.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about a usage limit. +func (c *Client) GetUsageLimit(ctx context.Context, params *GetUsageLimitInput, optFns ...func(*Options)) (*GetUsageLimitOutput, error) { + if params == nil { + params = &GetUsageLimitInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetUsageLimit", params, optFns, c.addOperationGetUsageLimitMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetUsageLimitOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetUsageLimitInput struct { + + // The unique identifier of the usage limit to return information for. + // + // This member is required. + UsageLimitId *string + + noSmithyDocumentSerde +} + +type GetUsageLimitOutput struct { + + // The returned usage limit object. + UsageLimit *types.UsageLimit + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetUsageLimitMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetUsageLimit{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetUsageLimit{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetUsageLimitValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetUsageLimit(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_opGetUsageLimit(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "GetUsageLimit", + } +} diff --git a/service/redshiftserverless/api_op_GetWorkgroup.go b/service/redshiftserverless/api_op_GetWorkgroup.go new file mode 100644 index 00000000000..97a7850ce87 --- /dev/null +++ b/service/redshiftserverless/api_op_GetWorkgroup.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about a specific workgroup. +func (c *Client) GetWorkgroup(ctx context.Context, params *GetWorkgroupInput, optFns ...func(*Options)) (*GetWorkgroupOutput, error) { + if params == nil { + params = &GetWorkgroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetWorkgroup", params, optFns, c.addOperationGetWorkgroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetWorkgroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetWorkgroupInput struct { + + // The name of the workgroup to return information for. + // + // This member is required. + WorkgroupName *string + + noSmithyDocumentSerde +} + +type GetWorkgroupOutput struct { + + // The returned workgroup object. + // + // This member is required. + Workgroup *types.Workgroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetWorkgroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetWorkgroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetWorkgroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetWorkgroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetWorkgroup(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_opGetWorkgroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "GetWorkgroup", + } +} diff --git a/service/redshiftserverless/api_op_ListEndpointAccess.go b/service/redshiftserverless/api_op_ListEndpointAccess.go new file mode 100644 index 00000000000..b33ac7dd1dc --- /dev/null +++ b/service/redshiftserverless/api_op_ListEndpointAccess.go @@ -0,0 +1,229 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns an array of EndpointAccess objects and relevant information. +func (c *Client) ListEndpointAccess(ctx context.Context, params *ListEndpointAccessInput, optFns ...func(*Options)) (*ListEndpointAccessOutput, error) { + if params == nil { + params = &ListEndpointAccessInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListEndpointAccess", params, optFns, c.addOperationListEndpointAccessMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListEndpointAccessOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListEndpointAccessInput struct { + + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. + MaxResults *int32 + + // If your initial ListEndpointAccess operation returns a nextToken, you can + // include the returned nextToken in subsequent ListEndpointAccess operations, + // which returns results in the next page. + NextToken *string + + // The unique identifier of the virtual private cloud with access to Amazon + // Redshift Serverless. + VpcId *string + + // The name of the workgroup associated with the VPC endpoint to return. + WorkgroupName *string + + noSmithyDocumentSerde +} + +type ListEndpointAccessOutput struct { + + // The returned VPC endpoints. + // + // This member is required. + Endpoints []types.EndpointAccess + + // When nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListEndpointAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListEndpointAccess{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListEndpointAccess{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListEndpointAccess(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 +} + +// ListEndpointAccessAPIClient is a client that implements the ListEndpointAccess +// operation. +type ListEndpointAccessAPIClient interface { + ListEndpointAccess(context.Context, *ListEndpointAccessInput, ...func(*Options)) (*ListEndpointAccessOutput, error) +} + +var _ ListEndpointAccessAPIClient = (*Client)(nil) + +// ListEndpointAccessPaginatorOptions is the paginator options for +// ListEndpointAccess +type ListEndpointAccessPaginatorOptions struct { + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page 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 +} + +// ListEndpointAccessPaginator is a paginator for ListEndpointAccess +type ListEndpointAccessPaginator struct { + options ListEndpointAccessPaginatorOptions + client ListEndpointAccessAPIClient + params *ListEndpointAccessInput + nextToken *string + firstPage bool +} + +// NewListEndpointAccessPaginator returns a new ListEndpointAccessPaginator +func NewListEndpointAccessPaginator(client ListEndpointAccessAPIClient, params *ListEndpointAccessInput, optFns ...func(*ListEndpointAccessPaginatorOptions)) *ListEndpointAccessPaginator { + if params == nil { + params = &ListEndpointAccessInput{} + } + + options := ListEndpointAccessPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListEndpointAccessPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEndpointAccessPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListEndpointAccess page. +func (p *ListEndpointAccessPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEndpointAccessOutput, 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.ListEndpointAccess(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_opListEndpointAccess(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "ListEndpointAccess", + } +} diff --git a/service/redshiftserverless/api_op_ListNamespaces.go b/service/redshiftserverless/api_op_ListNamespaces.go new file mode 100644 index 00000000000..07d455e2604 --- /dev/null +++ b/service/redshiftserverless/api_op_ListNamespaces.go @@ -0,0 +1,221 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about a list of specified namespaces. +func (c *Client) ListNamespaces(ctx context.Context, params *ListNamespacesInput, optFns ...func(*Options)) (*ListNamespacesOutput, error) { + if params == nil { + params = &ListNamespacesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListNamespaces", params, optFns, c.addOperationListNamespacesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListNamespacesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListNamespacesInput struct { + + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. + MaxResults *int32 + + // If your initial ListNamespaces operation returns a nextToken, you can include + // the returned nextToken in subsequent ListNamespaces operations, which returns + // results in the next page. + NextToken *string + + noSmithyDocumentSerde +} + +type ListNamespacesOutput struct { + + // The list of returned namespaces. + // + // This member is required. + Namespaces []types.Namespace + + // When nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListNamespacesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListNamespaces{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListNamespaces{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListNamespaces(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 +} + +// ListNamespacesAPIClient is a client that implements the ListNamespaces +// operation. +type ListNamespacesAPIClient interface { + ListNamespaces(context.Context, *ListNamespacesInput, ...func(*Options)) (*ListNamespacesOutput, error) +} + +var _ ListNamespacesAPIClient = (*Client)(nil) + +// ListNamespacesPaginatorOptions is the paginator options for ListNamespaces +type ListNamespacesPaginatorOptions struct { + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page 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 +} + +// ListNamespacesPaginator is a paginator for ListNamespaces +type ListNamespacesPaginator struct { + options ListNamespacesPaginatorOptions + client ListNamespacesAPIClient + params *ListNamespacesInput + nextToken *string + firstPage bool +} + +// NewListNamespacesPaginator returns a new ListNamespacesPaginator +func NewListNamespacesPaginator(client ListNamespacesAPIClient, params *ListNamespacesInput, optFns ...func(*ListNamespacesPaginatorOptions)) *ListNamespacesPaginator { + if params == nil { + params = &ListNamespacesInput{} + } + + options := ListNamespacesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListNamespacesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNamespacesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListNamespaces page. +func (p *ListNamespacesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNamespacesOutput, 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.ListNamespaces(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_opListNamespaces(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "ListNamespaces", + } +} diff --git a/service/redshiftserverless/api_op_ListRecoveryPoints.go b/service/redshiftserverless/api_op_ListRecoveryPoints.go new file mode 100644 index 00000000000..c45595e4c85 --- /dev/null +++ b/service/redshiftserverless/api_op_ListRecoveryPoints.go @@ -0,0 +1,230 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns an array of recovery points. +func (c *Client) ListRecoveryPoints(ctx context.Context, params *ListRecoveryPointsInput, optFns ...func(*Options)) (*ListRecoveryPointsOutput, error) { + if params == nil { + params = &ListRecoveryPointsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListRecoveryPoints", params, optFns, c.addOperationListRecoveryPointsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListRecoveryPointsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListRecoveryPointsInput struct { + + // The time when creation of the recovery point finished. + EndTime *time.Time + + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. + MaxResults *int32 + + // The name of the namespace to list recovery points for. + NamespaceName *string + + // If your initial ListRecoveryPoints operation returns a nextToken, you can + // include the returned nextToken in subsequent ListRecoveryPoints operations, + // which returns results in the next page. + NextToken *string + + // The time when the recovery point's creation was initiated. + StartTime *time.Time + + noSmithyDocumentSerde +} + +type ListRecoveryPointsOutput struct { + + // If nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. + NextToken *string + + // The returned recovery point objects. + RecoveryPoints []types.RecoveryPoint + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListRecoveryPointsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListRecoveryPoints{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListRecoveryPoints{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListRecoveryPoints(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 +} + +// ListRecoveryPointsAPIClient is a client that implements the ListRecoveryPoints +// operation. +type ListRecoveryPointsAPIClient interface { + ListRecoveryPoints(context.Context, *ListRecoveryPointsInput, ...func(*Options)) (*ListRecoveryPointsOutput, error) +} + +var _ ListRecoveryPointsAPIClient = (*Client)(nil) + +// ListRecoveryPointsPaginatorOptions is the paginator options for +// ListRecoveryPoints +type ListRecoveryPointsPaginatorOptions struct { + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page 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 +} + +// ListRecoveryPointsPaginator is a paginator for ListRecoveryPoints +type ListRecoveryPointsPaginator struct { + options ListRecoveryPointsPaginatorOptions + client ListRecoveryPointsAPIClient + params *ListRecoveryPointsInput + nextToken *string + firstPage bool +} + +// NewListRecoveryPointsPaginator returns a new ListRecoveryPointsPaginator +func NewListRecoveryPointsPaginator(client ListRecoveryPointsAPIClient, params *ListRecoveryPointsInput, optFns ...func(*ListRecoveryPointsPaginatorOptions)) *ListRecoveryPointsPaginator { + if params == nil { + params = &ListRecoveryPointsInput{} + } + + options := ListRecoveryPointsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListRecoveryPointsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListRecoveryPointsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListRecoveryPoints page. +func (p *ListRecoveryPointsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListRecoveryPointsOutput, 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.ListRecoveryPoints(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_opListRecoveryPoints(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "ListRecoveryPoints", + } +} diff --git a/service/redshiftserverless/api_op_ListSnapshots.go b/service/redshiftserverless/api_op_ListSnapshots.go new file mode 100644 index 00000000000..a705a3fceb8 --- /dev/null +++ b/service/redshiftserverless/api_op_ListSnapshots.go @@ -0,0 +1,235 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns a list of snapshots. +func (c *Client) ListSnapshots(ctx context.Context, params *ListSnapshotsInput, optFns ...func(*Options)) (*ListSnapshotsOutput, error) { + if params == nil { + params = &ListSnapshotsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSnapshots", params, optFns, c.addOperationListSnapshotsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSnapshotsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSnapshotsInput struct { + + // The timestamp showing when the snapshot creation finished. + EndTime *time.Time + + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. + MaxResults *int32 + + // The Amazon Resource Name (ARN) of the namespace from which to list all + // snapshots. + NamespaceArn *string + + // The namespace from which to list all snapshots. + NamespaceName *string + + // If nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. + NextToken *string + + // The owner Amazon Web Services account of the snapshot. + OwnerAccount *string + + // The time when the creation of the snapshot was initiated. + StartTime *time.Time + + noSmithyDocumentSerde +} + +type ListSnapshotsOutput struct { + + // If nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. + NextToken *string + + // All of the returned snapshot objects. + Snapshots []types.Snapshot + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSnapshotsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListSnapshots{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListSnapshots{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListSnapshots(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 +} + +// ListSnapshotsAPIClient is a client that implements the ListSnapshots operation. +type ListSnapshotsAPIClient interface { + ListSnapshots(context.Context, *ListSnapshotsInput, ...func(*Options)) (*ListSnapshotsOutput, error) +} + +var _ ListSnapshotsAPIClient = (*Client)(nil) + +// ListSnapshotsPaginatorOptions is the paginator options for ListSnapshots +type ListSnapshotsPaginatorOptions struct { + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page 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 +} + +// ListSnapshotsPaginator is a paginator for ListSnapshots +type ListSnapshotsPaginator struct { + options ListSnapshotsPaginatorOptions + client ListSnapshotsAPIClient + params *ListSnapshotsInput + nextToken *string + firstPage bool +} + +// NewListSnapshotsPaginator returns a new ListSnapshotsPaginator +func NewListSnapshotsPaginator(client ListSnapshotsAPIClient, params *ListSnapshotsInput, optFns ...func(*ListSnapshotsPaginatorOptions)) *ListSnapshotsPaginator { + if params == nil { + params = &ListSnapshotsInput{} + } + + options := ListSnapshotsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSnapshotsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSnapshotsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSnapshots page. +func (p *ListSnapshotsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSnapshotsOutput, 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.ListSnapshots(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_opListSnapshots(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "ListSnapshots", + } +} diff --git a/service/redshiftserverless/api_op_ListTagsForResource.go b/service/redshiftserverless/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..043c1c6f5cd --- /dev/null +++ b/service/redshiftserverless/api_op_ListTagsForResource.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the tags assigned to a resource. +func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if params == nil { + params = &ListTagsForResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The Amazon Resource Name (ARN) of the resource to list tags for. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // A map of the key-value pairs assigned to the resource. + Tags []types.Tag + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != 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: "redshift-serverless", + OperationName: "ListTagsForResource", + } +} diff --git a/service/redshiftserverless/api_op_ListUsageLimits.go b/service/redshiftserverless/api_op_ListUsageLimits.go new file mode 100644 index 00000000000..4263f326feb --- /dev/null +++ b/service/redshiftserverless/api_op_ListUsageLimits.go @@ -0,0 +1,226 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all usage limits within Amazon Redshift Serverless. +func (c *Client) ListUsageLimits(ctx context.Context, params *ListUsageLimitsInput, optFns ...func(*Options)) (*ListUsageLimitsOutput, error) { + if params == nil { + params = &ListUsageLimitsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListUsageLimits", params, optFns, c.addOperationListUsageLimitsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListUsageLimitsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListUsageLimitsInput struct { + + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. The default is 100. + MaxResults *int32 + + // If your initial ListUsageLimits operation returns a nextToken, you can include + // the returned nextToken in subsequent ListUsageLimits operations, which returns + // results in the next page. + NextToken *string + + // The Amazon Resource Name (ARN) associated with the resource whose usage limits + // you want to list. + ResourceArn *string + + // The Amazon Redshift Serverless feature whose limits you want to see. + UsageType types.UsageLimitUsageType + + noSmithyDocumentSerde +} + +type ListUsageLimitsOutput struct { + + // When nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. Make the call again using + // the returned token to retrieve the next page. + NextToken *string + + // An array of returned usage limit objects. + UsageLimits []types.UsageLimit + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListUsageLimitsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListUsageLimits{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListUsageLimits{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListUsageLimits(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 +} + +// ListUsageLimitsAPIClient is a client that implements the ListUsageLimits +// operation. +type ListUsageLimitsAPIClient interface { + ListUsageLimits(context.Context, *ListUsageLimitsInput, ...func(*Options)) (*ListUsageLimitsOutput, error) +} + +var _ ListUsageLimitsAPIClient = (*Client)(nil) + +// ListUsageLimitsPaginatorOptions is the paginator options for ListUsageLimits +type ListUsageLimitsPaginatorOptions struct { + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. The default is 100. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListUsageLimitsPaginator is a paginator for ListUsageLimits +type ListUsageLimitsPaginator struct { + options ListUsageLimitsPaginatorOptions + client ListUsageLimitsAPIClient + params *ListUsageLimitsInput + nextToken *string + firstPage bool +} + +// NewListUsageLimitsPaginator returns a new ListUsageLimitsPaginator +func NewListUsageLimitsPaginator(client ListUsageLimitsAPIClient, params *ListUsageLimitsInput, optFns ...func(*ListUsageLimitsPaginatorOptions)) *ListUsageLimitsPaginator { + if params == nil { + params = &ListUsageLimitsInput{} + } + + options := ListUsageLimitsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListUsageLimitsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListUsageLimitsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListUsageLimits page. +func (p *ListUsageLimitsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListUsageLimitsOutput, 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.ListUsageLimits(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_opListUsageLimits(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "ListUsageLimits", + } +} diff --git a/service/redshiftserverless/api_op_ListWorkgroups.go b/service/redshiftserverless/api_op_ListWorkgroups.go new file mode 100644 index 00000000000..dbb6f12cce2 --- /dev/null +++ b/service/redshiftserverless/api_op_ListWorkgroups.go @@ -0,0 +1,221 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about a list of specified workgroups. +func (c *Client) ListWorkgroups(ctx context.Context, params *ListWorkgroupsInput, optFns ...func(*Options)) (*ListWorkgroupsOutput, error) { + if params == nil { + params = &ListWorkgroupsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListWorkgroups", params, optFns, c.addOperationListWorkgroupsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListWorkgroupsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListWorkgroupsInput struct { + + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page of results. + MaxResults *int32 + + // If your initial ListWorkgroups operation returns a nextToken, you can include + // the returned nextToken in subsequent ListNamespaces operations, which returns + // results in the next page. + NextToken *string + + noSmithyDocumentSerde +} + +type ListWorkgroupsOutput struct { + + // The returned array of workgroups. + // + // This member is required. + Workgroups []types.Workgroup + + // If nextToken is returned, there are more results available. The value of + // nextToken is a unique pagination token for each page. To retrieve the next page, + // make the call again using the returned token. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListWorkgroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListWorkgroups{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListWorkgroups{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); 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_opListWorkgroups(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 +} + +// ListWorkgroupsAPIClient is a client that implements the ListWorkgroups +// operation. +type ListWorkgroupsAPIClient interface { + ListWorkgroups(context.Context, *ListWorkgroupsInput, ...func(*Options)) (*ListWorkgroupsOutput, error) +} + +var _ ListWorkgroupsAPIClient = (*Client)(nil) + +// ListWorkgroupsPaginatorOptions is the paginator options for ListWorkgroups +type ListWorkgroupsPaginatorOptions struct { + // An optional parameter that specifies the maximum number of results to return. + // You can use nextToken to get the next page 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 +} + +// ListWorkgroupsPaginator is a paginator for ListWorkgroups +type ListWorkgroupsPaginator struct { + options ListWorkgroupsPaginatorOptions + client ListWorkgroupsAPIClient + params *ListWorkgroupsInput + nextToken *string + firstPage bool +} + +// NewListWorkgroupsPaginator returns a new ListWorkgroupsPaginator +func NewListWorkgroupsPaginator(client ListWorkgroupsAPIClient, params *ListWorkgroupsInput, optFns ...func(*ListWorkgroupsPaginatorOptions)) *ListWorkgroupsPaginator { + if params == nil { + params = &ListWorkgroupsInput{} + } + + options := ListWorkgroupsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListWorkgroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkgroupsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListWorkgroups page. +func (p *ListWorkgroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkgroupsOutput, 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.ListWorkgroups(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_opListWorkgroups(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "ListWorkgroups", + } +} diff --git a/service/redshiftserverless/api_op_PutResourcePolicy.go b/service/redshiftserverless/api_op_PutResourcePolicy.go new file mode 100644 index 00000000000..19fee354ecf --- /dev/null +++ b/service/redshiftserverless/api_op_PutResourcePolicy.go @@ -0,0 +1,132 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates or updates a resource policy. Currently, you can use policies to share +// snapshots across Amazon Web Services accounts. +func (c *Client) PutResourcePolicy(ctx context.Context, params *PutResourcePolicyInput, optFns ...func(*Options)) (*PutResourcePolicyOutput, error) { + if params == nil { + params = &PutResourcePolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutResourcePolicy", params, optFns, c.addOperationPutResourcePolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutResourcePolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutResourcePolicyInput struct { + + // The policy to create or update. For example, the following policy grants a user + // authorization to restore a snapshot. "{\"Version\": \"2012-10-17\", + // \"Statement\" : [{ \"Sid\": \"AllowUserRestoreFromSnapshot\", + // \"Principal\":{\"AWS\": [\"739247239426\"]}, \"Action\": + // [\"redshift-serverless:RestoreFromSnapshot\"] , \"Effect\": \"Allow\" }]}" + // + // This member is required. + Policy *string + + // The Amazon Resource Name (ARN) of the account to create or update a resource + // policy for. + // + // This member is required. + ResourceArn *string + + noSmithyDocumentSerde +} + +type PutResourcePolicyOutput struct { + + // The policy that was created or updated. + ResourcePolicy *types.ResourcePolicy + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutResourcePolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutResourcePolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutResourcePolicy{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutResourcePolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutResourcePolicy(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_opPutResourcePolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "PutResourcePolicy", + } +} diff --git a/service/redshiftserverless/api_op_RestoreFromRecoveryPoint.go b/service/redshiftserverless/api_op_RestoreFromRecoveryPoint.go new file mode 100644 index 00000000000..27b5154514c --- /dev/null +++ b/service/redshiftserverless/api_op_RestoreFromRecoveryPoint.go @@ -0,0 +1,134 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Restore the data from a recovery point. +func (c *Client) RestoreFromRecoveryPoint(ctx context.Context, params *RestoreFromRecoveryPointInput, optFns ...func(*Options)) (*RestoreFromRecoveryPointOutput, error) { + if params == nil { + params = &RestoreFromRecoveryPointInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RestoreFromRecoveryPoint", params, optFns, c.addOperationRestoreFromRecoveryPointMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RestoreFromRecoveryPointOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RestoreFromRecoveryPointInput struct { + + // The name of the namespace to restore data into. + // + // This member is required. + NamespaceName *string + + // The unique identifier of the recovery point to restore from. + // + // This member is required. + RecoveryPointId *string + + // The name of the workgroup used to restore data. + // + // This member is required. + WorkgroupName *string + + noSmithyDocumentSerde +} + +type RestoreFromRecoveryPointOutput struct { + + // The namespace that data was restored into. + Namespace *types.Namespace + + // The unique identifier of the recovery point used for the restore. + RecoveryPointId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRestoreFromRecoveryPointMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpRestoreFromRecoveryPoint{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRestoreFromRecoveryPoint{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpRestoreFromRecoveryPointValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRestoreFromRecoveryPoint(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_opRestoreFromRecoveryPoint(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "RestoreFromRecoveryPoint", + } +} diff --git a/service/redshiftserverless/api_op_RestoreFromSnapshot.go b/service/redshiftserverless/api_op_RestoreFromSnapshot.go new file mode 100644 index 00000000000..12d2c93e62e --- /dev/null +++ b/service/redshiftserverless/api_op_RestoreFromSnapshot.go @@ -0,0 +1,141 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Restores a namespace from a snapshot. +func (c *Client) RestoreFromSnapshot(ctx context.Context, params *RestoreFromSnapshotInput, optFns ...func(*Options)) (*RestoreFromSnapshotOutput, error) { + if params == nil { + params = &RestoreFromSnapshotInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RestoreFromSnapshot", params, optFns, c.addOperationRestoreFromSnapshotMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RestoreFromSnapshotOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RestoreFromSnapshotInput struct { + + // The name of the namespace to restore the snapshot to. + // + // This member is required. + NamespaceName *string + + // The name of the workgroup used to restore the snapshot. + // + // This member is required. + WorkgroupName *string + + // The Amazon Web Services account that owns the snapshot. + OwnerAccount *string + + // The Amazon Resource Name (ARN) of the snapshot to restore from. + SnapshotArn *string + + // The name of the snapshot to restore from. + SnapshotName *string + + noSmithyDocumentSerde +} + +type RestoreFromSnapshotOutput struct { + + // A collection of database objects and users. + Namespace *types.Namespace + + // The owner Amazon Web Services; account of the snapshot that was restored. + OwnerAccount *string + + // The name of the snapshot used to restore the namespace. + SnapshotName *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRestoreFromSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpRestoreFromSnapshot{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpRestoreFromSnapshot{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpRestoreFromSnapshotValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRestoreFromSnapshot(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_opRestoreFromSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "RestoreFromSnapshot", + } +} diff --git a/service/redshiftserverless/api_op_TagResource.go b/service/redshiftserverless/api_op_TagResource.go new file mode 100644 index 00000000000..1c789243fc5 --- /dev/null +++ b/service/redshiftserverless/api_op_TagResource.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Assigns one or more tags 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, c.addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The Amazon Resource Name (ARN) of the resource to tag. + // + // This member is required. + ResourceArn *string + + // The map of the key-value pairs used to tag the resource. + // + // This member is required. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpTagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != 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: "redshift-serverless", + OperationName: "TagResource", + } +} diff --git a/service/redshiftserverless/api_op_UntagResource.go b/service/redshiftserverless/api_op_UntagResource.go new file mode 100644 index 00000000000..2d1d3836d75 --- /dev/null +++ b/service/redshiftserverless/api_op_UntagResource.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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 or set of 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, c.addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The Amazon Resource Name (ARN) of the resource to remove tags from. + // + // This member is required. + ResourceArn *string + + // The tag or set of tags to remove from the resource. + // + // This member is required. + TagKeys []string + + noSmithyDocumentSerde +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUntagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != 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: "redshift-serverless", + OperationName: "UntagResource", + } +} diff --git a/service/redshiftserverless/api_op_UpdateEndpointAccess.go b/service/redshiftserverless/api_op_UpdateEndpointAccess.go new file mode 100644 index 00000000000..d467798137a --- /dev/null +++ b/service/redshiftserverless/api_op_UpdateEndpointAccess.go @@ -0,0 +1,125 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates an Amazon Redshift Serverless managed endpoint. +func (c *Client) UpdateEndpointAccess(ctx context.Context, params *UpdateEndpointAccessInput, optFns ...func(*Options)) (*UpdateEndpointAccessOutput, error) { + if params == nil { + params = &UpdateEndpointAccessInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateEndpointAccess", params, optFns, c.addOperationUpdateEndpointAccessMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateEndpointAccessOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateEndpointAccessInput struct { + + // The name of the VPC endpoint to update. + // + // This member is required. + EndpointName *string + + // The list of VPC security groups associated with the endpoint after the endpoint + // is modified. + VpcSecurityGroupIds []string + + noSmithyDocumentSerde +} + +type UpdateEndpointAccessOutput struct { + + // The updated VPC endpoint. + Endpoint *types.EndpointAccess + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateEndpointAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateEndpointAccess{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateEndpointAccess{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateEndpointAccessValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateEndpointAccess(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_opUpdateEndpointAccess(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "UpdateEndpointAccess", + } +} diff --git a/service/redshiftserverless/api_op_UpdateNamespace.go b/service/redshiftserverless/api_op_UpdateNamespace.go new file mode 100644 index 00000000000..ffc7605dad1 --- /dev/null +++ b/service/redshiftserverless/api_op_UpdateNamespace.go @@ -0,0 +1,146 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a namespace with the specified settings. +func (c *Client) UpdateNamespace(ctx context.Context, params *UpdateNamespaceInput, optFns ...func(*Options)) (*UpdateNamespaceOutput, error) { + if params == nil { + params = &UpdateNamespaceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateNamespace", params, optFns, c.addOperationUpdateNamespaceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateNamespaceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateNamespaceInput struct { + + // The name of the namespace. + // + // This member is required. + NamespaceName *string + + // The password of the administrator for the first database created in the + // namespace. + AdminUserPassword *string + + // The username of the administrator for the first database created in the + // namespace. + AdminUsername *string + + // The Amazon Resource Name (ARN) of the IAM role to set as a default in the + // namespace. + DefaultIamRoleArn *string + + // A list of IAM roles to associate with the namespace. + IamRoles []string + + // The ID of the Amazon Web Services Key Management Service key used to encrypt + // your data. + KmsKeyId *string + + // The types of logs the namespace can export. The export types are userlog, + // connectionlog, and useractivitylog. + LogExports []types.LogExport + + noSmithyDocumentSerde +} + +type UpdateNamespaceOutput struct { + + // A list of tag instances. + // + // This member is required. + Namespace *types.Namespace + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateNamespaceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateNamespace{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateNamespace{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateNamespaceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateNamespace(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_opUpdateNamespace(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "UpdateNamespace", + } +} diff --git a/service/redshiftserverless/api_op_UpdateSnapshot.go b/service/redshiftserverless/api_op_UpdateSnapshot.go new file mode 100644 index 00000000000..a97b4c3682a --- /dev/null +++ b/service/redshiftserverless/api_op_UpdateSnapshot.go @@ -0,0 +1,124 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a snapshot. +func (c *Client) UpdateSnapshot(ctx context.Context, params *UpdateSnapshotInput, optFns ...func(*Options)) (*UpdateSnapshotOutput, error) { + if params == nil { + params = &UpdateSnapshotInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateSnapshot", params, optFns, c.addOperationUpdateSnapshotMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateSnapshotOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateSnapshotInput struct { + + // The name of the snapshot. + // + // This member is required. + SnapshotName *string + + // The new retention period of the snapshot. + RetentionPeriod *int32 + + noSmithyDocumentSerde +} + +type UpdateSnapshotOutput struct { + + // The updated snapshot object. + Snapshot *types.Snapshot + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateSnapshotMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateSnapshot{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateSnapshot{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateSnapshotValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSnapshot(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_opUpdateSnapshot(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "UpdateSnapshot", + } +} diff --git a/service/redshiftserverless/api_op_UpdateUsageLimit.go b/service/redshiftserverless/api_op_UpdateUsageLimit.go new file mode 100644 index 00000000000..482f96deac6 --- /dev/null +++ b/service/redshiftserverless/api_op_UpdateUsageLimit.go @@ -0,0 +1,128 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update a usage limit in Amazon Redshift Serverless. You can't update the usage +// type or period of a usage limit. +func (c *Client) UpdateUsageLimit(ctx context.Context, params *UpdateUsageLimitInput, optFns ...func(*Options)) (*UpdateUsageLimitOutput, error) { + if params == nil { + params = &UpdateUsageLimitInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateUsageLimit", params, optFns, c.addOperationUpdateUsageLimitMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateUsageLimitOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateUsageLimitInput struct { + + // The identifier of the usage limit to update. + // + // This member is required. + UsageLimitId *string + + // The new limit amount. For more information about this parameter. + Amount *int64 + + // The new action that Amazon Redshift Serverless takes when the limit is reached. + BreachAction types.UsageLimitBreachAction + + noSmithyDocumentSerde +} + +type UpdateUsageLimitOutput struct { + + // The updated usage limit object. + UsageLimit *types.UsageLimit + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateUsageLimitMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateUsageLimit{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateUsageLimit{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateUsageLimitValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateUsageLimit(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_opUpdateUsageLimit(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "UpdateUsageLimit", + } +} diff --git a/service/redshiftserverless/api_op_UpdateWorkgroup.go b/service/redshiftserverless/api_op_UpdateWorkgroup.go new file mode 100644 index 00000000000..bb265e2b0c0 --- /dev/null +++ b/service/redshiftserverless/api_op_UpdateWorkgroup.go @@ -0,0 +1,146 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "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/redshiftserverless/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a workgroup with the specified configuration settings. +func (c *Client) UpdateWorkgroup(ctx context.Context, params *UpdateWorkgroupInput, optFns ...func(*Options)) (*UpdateWorkgroupOutput, error) { + if params == nil { + params = &UpdateWorkgroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateWorkgroup", params, optFns, c.addOperationUpdateWorkgroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateWorkgroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateWorkgroupInput struct { + + // The name of the workgroup to update. + // + // This member is required. + WorkgroupName *string + + // The new base data warehouse capacity in Redshift Processing Units (RPUs). + BaseCapacity *int32 + + // An array of parameters to set for advanced control over a database. The options + // are datestyle, enable_user_activity_logging, query_group, search_path, and + // max_query_execution_time. + ConfigParameters []types.ConfigParameter + + // The value that specifies whether to turn on enhanced virtual private cloud (VPC) + // routing, which forces Amazon Redshift Serverless to route traffic through your + // VPC. + EnhancedVpcRouting *bool + + // A value that specifies whether the workgroup can be accessible from a public + // network. + PubliclyAccessible *bool + + // An array of security group IDs to associate with the workgroup. + SecurityGroupIds []string + + // An array of VPC subnet IDs to associate with the workgroup. + SubnetIds []string + + noSmithyDocumentSerde +} + +type UpdateWorkgroupOutput struct { + + // The updated workgroup object. + // + // This member is required. + Workgroup *types.Workgroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateWorkgroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateWorkgroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateWorkgroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateWorkgroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateWorkgroup(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_opUpdateWorkgroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "redshift-serverless", + OperationName: "UpdateWorkgroup", + } +} diff --git a/service/redshiftserverless/deserializers.go b/service/redshiftserverless/deserializers.go new file mode 100644 index 00000000000..e96cfec8e5b --- /dev/null +++ b/service/redshiftserverless/deserializers.go @@ -0,0 +1,8532 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/redshiftserverless/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "math" + "strings" +) + +type awsAwsjson11_deserializeOpConvertRecoveryPointToSnapshot struct { +} + +func (*awsAwsjson11_deserializeOpConvertRecoveryPointToSnapshot) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpConvertRecoveryPointToSnapshot) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorConvertRecoveryPointToSnapshot(response, &metadata) + } + output := &ConvertRecoveryPointToSnapshotOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentConvertRecoveryPointToSnapshotOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorConvertRecoveryPointToSnapshot(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpCreateEndpointAccess struct { +} + +func (*awsAwsjson11_deserializeOpCreateEndpointAccess) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateEndpointAccess) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateEndpointAccess(response, &metadata) + } + output := &CreateEndpointAccessOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateEndpointAccessOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorCreateEndpointAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpCreateNamespace struct { +} + +func (*awsAwsjson11_deserializeOpCreateNamespace) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateNamespace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateNamespace(response, &metadata) + } + output := &CreateNamespaceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateNamespaceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorCreateNamespace(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("TooManyTagsException", errorCode): + return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpCreateSnapshot struct { +} + +func (*awsAwsjson11_deserializeOpCreateSnapshot) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateSnapshot) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateSnapshot(response, &metadata) + } + output := &CreateSnapshotOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateSnapshotOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorCreateSnapshot(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpCreateUsageLimit struct { +} + +func (*awsAwsjson11_deserializeOpCreateUsageLimit) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateUsageLimit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateUsageLimit(response, &metadata) + } + output := &CreateUsageLimitOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateUsageLimitOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorCreateUsageLimit(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpCreateWorkgroup struct { +} + +func (*awsAwsjson11_deserializeOpCreateWorkgroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateWorkgroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateWorkgroup(response, &metadata) + } + output := &CreateWorkgroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateWorkgroupOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorCreateWorkgroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InsufficientCapacityException", errorCode): + return awsAwsjson11_deserializeErrorInsufficientCapacityException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyTagsException", errorCode): + return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDeleteEndpointAccess struct { +} + +func (*awsAwsjson11_deserializeOpDeleteEndpointAccess) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteEndpointAccess) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteEndpointAccess(response, &metadata) + } + output := &DeleteEndpointAccessOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentDeleteEndpointAccessOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorDeleteEndpointAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDeleteNamespace struct { +} + +func (*awsAwsjson11_deserializeOpDeleteNamespace) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteNamespace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteNamespace(response, &metadata) + } + output := &DeleteNamespaceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentDeleteNamespaceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorDeleteNamespace(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDeleteResourcePolicy struct { +} + +func (*awsAwsjson11_deserializeOpDeleteResourcePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteResourcePolicy(response, &metadata) + } + output := &DeleteResourcePolicyOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentDeleteResourcePolicyOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDeleteSnapshot struct { +} + +func (*awsAwsjson11_deserializeOpDeleteSnapshot) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteSnapshot) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteSnapshot(response, &metadata) + } + output := &DeleteSnapshotOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentDeleteSnapshotOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorDeleteSnapshot(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDeleteUsageLimit struct { +} + +func (*awsAwsjson11_deserializeOpDeleteUsageLimit) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteUsageLimit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteUsageLimit(response, &metadata) + } + output := &DeleteUsageLimitOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentDeleteUsageLimitOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorDeleteUsageLimit(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDeleteWorkgroup struct { +} + +func (*awsAwsjson11_deserializeOpDeleteWorkgroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteWorkgroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteWorkgroup(response, &metadata) + } + output := &DeleteWorkgroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentDeleteWorkgroupOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorDeleteWorkgroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpGetCredentials struct { +} + +func (*awsAwsjson11_deserializeOpGetCredentials) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetCredentials) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetCredentials(response, &metadata) + } + output := &GetCredentialsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetCredentialsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorGetCredentials(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpGetEndpointAccess struct { +} + +func (*awsAwsjson11_deserializeOpGetEndpointAccess) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetEndpointAccess) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetEndpointAccess(response, &metadata) + } + output := &GetEndpointAccessOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetEndpointAccessOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorGetEndpointAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpGetNamespace struct { +} + +func (*awsAwsjson11_deserializeOpGetNamespace) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetNamespace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetNamespace(response, &metadata) + } + output := &GetNamespaceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetNamespaceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorGetNamespace(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpGetRecoveryPoint struct { +} + +func (*awsAwsjson11_deserializeOpGetRecoveryPoint) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetRecoveryPoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetRecoveryPoint(response, &metadata) + } + output := &GetRecoveryPointOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetRecoveryPointOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorGetRecoveryPoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpGetResourcePolicy struct { +} + +func (*awsAwsjson11_deserializeOpGetResourcePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetResourcePolicy(response, &metadata) + } + output := &GetResourcePolicyOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetResourcePolicyOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorGetResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpGetSnapshot struct { +} + +func (*awsAwsjson11_deserializeOpGetSnapshot) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetSnapshot) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetSnapshot(response, &metadata) + } + output := &GetSnapshotOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetSnapshotOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorGetSnapshot(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpGetUsageLimit struct { +} + +func (*awsAwsjson11_deserializeOpGetUsageLimit) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetUsageLimit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetUsageLimit(response, &metadata) + } + output := &GetUsageLimitOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetUsageLimitOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorGetUsageLimit(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpGetWorkgroup struct { +} + +func (*awsAwsjson11_deserializeOpGetWorkgroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetWorkgroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetWorkgroup(response, &metadata) + } + output := &GetWorkgroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetWorkgroupOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorGetWorkgroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListEndpointAccess struct { +} + +func (*awsAwsjson11_deserializeOpListEndpointAccess) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListEndpointAccess) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListEndpointAccess(response, &metadata) + } + output := &ListEndpointAccessOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListEndpointAccessOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorListEndpointAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListNamespaces struct { +} + +func (*awsAwsjson11_deserializeOpListNamespaces) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListNamespaces) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListNamespaces(response, &metadata) + } + output := &ListNamespacesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListNamespacesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorListNamespaces(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListRecoveryPoints struct { +} + +func (*awsAwsjson11_deserializeOpListRecoveryPoints) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListRecoveryPoints) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListRecoveryPoints(response, &metadata) + } + output := &ListRecoveryPointsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListRecoveryPointsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorListRecoveryPoints(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListSnapshots struct { +} + +func (*awsAwsjson11_deserializeOpListSnapshots) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListSnapshots) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListSnapshots(response, &metadata) + } + output := &ListSnapshotsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListSnapshotsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorListSnapshots(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListTagsForResource struct { +} + +func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + 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 awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListUsageLimits struct { +} + +func (*awsAwsjson11_deserializeOpListUsageLimits) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListUsageLimits) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListUsageLimits(response, &metadata) + } + output := &ListUsageLimitsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListUsageLimitsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorListUsageLimits(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidPaginationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidPaginationException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListWorkgroups struct { +} + +func (*awsAwsjson11_deserializeOpListWorkgroups) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListWorkgroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListWorkgroups(response, &metadata) + } + output := &ListWorkgroupsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentListWorkgroupsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorListWorkgroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpPutResourcePolicy struct { +} + +func (*awsAwsjson11_deserializeOpPutResourcePolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorPutResourcePolicy(response, &metadata) + } + output := &PutResourcePolicyOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentPutResourcePolicyOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpRestoreFromRecoveryPoint struct { +} + +func (*awsAwsjson11_deserializeOpRestoreFromRecoveryPoint) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpRestoreFromRecoveryPoint) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorRestoreFromRecoveryPoint(response, &metadata) + } + output := &RestoreFromRecoveryPointOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentRestoreFromRecoveryPointOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorRestoreFromRecoveryPoint(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpRestoreFromSnapshot struct { +} + +func (*awsAwsjson11_deserializeOpRestoreFromSnapshot) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpRestoreFromSnapshot) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorRestoreFromSnapshot(response, &metadata) + } + output := &RestoreFromSnapshotOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentRestoreFromSnapshotOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorRestoreFromSnapshot(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(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("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("TooManyTagsException", errorCode): + return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(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("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateEndpointAccess struct { +} + +func (*awsAwsjson11_deserializeOpUpdateEndpointAccess) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateEndpointAccess) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateEndpointAccess(response, &metadata) + } + output := &UpdateEndpointAccessOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentUpdateEndpointAccessOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorUpdateEndpointAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateNamespace struct { +} + +func (*awsAwsjson11_deserializeOpUpdateNamespace) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateNamespace) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateNamespace(response, &metadata) + } + output := &UpdateNamespaceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentUpdateNamespaceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorUpdateNamespace(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateSnapshot struct { +} + +func (*awsAwsjson11_deserializeOpUpdateSnapshot) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateSnapshot) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateSnapshot(response, &metadata) + } + output := &UpdateSnapshotOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentUpdateSnapshotOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorUpdateSnapshot(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateUsageLimit struct { +} + +func (*awsAwsjson11_deserializeOpUpdateUsageLimit) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateUsageLimit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateUsageLimit(response, &metadata) + } + output := &UpdateUsageLimitOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentUpdateUsageLimitOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorUpdateUsageLimit(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUpdateWorkgroup struct { +} + +func (*awsAwsjson11_deserializeOpUpdateWorkgroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateWorkgroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateWorkgroup(response, &metadata) + } + output := &UpdateWorkgroupOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentUpdateWorkgroupOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorUpdateWorkgroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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 awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InsufficientCapacityException", errorCode): + return awsAwsjson11_deserializeErrorInsufficientCapacityException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsjson11_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.AccessDeniedException{} + err := awsAwsjson11_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ConflictException{} + err := awsAwsjson11_deserializeDocumentConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorInsufficientCapacityException(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.InsufficientCapacityException{} + err := awsAwsjson11_deserializeDocumentInsufficientCapacityException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InternalServerException{} + err := awsAwsjson11_deserializeDocumentInternalServerException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorInvalidPaginationException(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.InvalidPaginationException{} + err := awsAwsjson11_deserializeDocumentInvalidPaginationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ServiceQuotaExceededException{} + err := awsAwsjson11_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 awsAwsjson11_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ThrottlingException{} + err := awsAwsjson11_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_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_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ValidationException{} + err := awsAwsjson11_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 awsAwsjson11_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Code = ptr.String(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAccountIdList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentConfigParameter(v **types.ConfigParameter, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConfigParameter + if *v == nil { + sv = &types.ConfigParameter{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "parameterKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ParameterKey to be of type string, got %T instead", value) + } + sv.ParameterKey = ptr.String(jtv) + } + + case "parameterValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ParameterValue to be of type string, got %T instead", value) + } + sv.ParameterValue = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentConfigParameterList(v *[]types.ConfigParameter, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.ConfigParameter + if *v == nil { + cv = []types.ConfigParameter{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ConfigParameter + destAddr := &col + if err := awsAwsjson11_deserializeDocumentConfigParameter(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentEndpoint(v **types.Endpoint, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Endpoint + if *v == nil { + sv = &types.Endpoint{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "address": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Address = ptr.String(jtv) + } + + case "port": + 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.Port = ptr.Int32(int32(i64)) + } + + case "vpcEndpoints": + if err := awsAwsjson11_deserializeDocumentVpcEndpointList(&sv.VpcEndpoints, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentEndpointAccess(v **types.EndpointAccess, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EndpointAccess + if *v == nil { + sv = &types.EndpointAccess{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "address": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Address = ptr.String(jtv) + } + + case "endpointArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.EndpointArn = ptr.String(jtv) + } + + case "endpointCreateTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.EndpointCreateTime = ptr.Time(t) + } + + case "endpointName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.EndpointName = ptr.String(jtv) + } + + case "endpointStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.EndpointStatus = ptr.String(jtv) + } + + case "port": + 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.Port = ptr.Int32(int32(i64)) + } + + case "subnetIds": + if err := awsAwsjson11_deserializeDocumentSubnetIdList(&sv.SubnetIds, value); err != nil { + return err + } + + case "vpcEndpoint": + if err := awsAwsjson11_deserializeDocumentVpcEndpoint(&sv.VpcEndpoint, value); err != nil { + return err + } + + case "vpcSecurityGroups": + if err := awsAwsjson11_deserializeDocumentVpcSecurityGroupMembershipList(&sv.VpcSecurityGroups, value); err != nil { + return err + } + + case "workgroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.WorkgroupName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentEndpointAccessList(v *[]types.EndpointAccess, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.EndpointAccess + if *v == nil { + cv = []types.EndpointAccess{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EndpointAccess + destAddr := &col + if err := awsAwsjson11_deserializeDocumentEndpointAccess(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentIamRoleArnList(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 IamRoleArn to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentInsufficientCapacityException(v **types.InsufficientCapacityException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InsufficientCapacityException + if *v == nil { + sv = &types.InsufficientCapacityException{} + } 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_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentInvalidPaginationException(v **types.InvalidPaginationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidPaginationException + if *v == nil { + sv = &types.InvalidPaginationException{} + } 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_deserializeDocumentLogExportList(v *[]types.LogExport, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.LogExport + if *v == nil { + cv = []types.LogExport{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LogExport + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LogExport to be of type string, got %T instead", value) + } + col = types.LogExport(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentNamespace(v **types.Namespace, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Namespace + if *v == nil { + sv = &types.Namespace{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "adminUsername": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DbUser to be of type string, got %T instead", value) + } + sv.AdminUsername = ptr.String(jtv) + } + + case "creationDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationDate = ptr.Time(t) + } + + case "dbName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DbName = ptr.String(jtv) + } + + case "defaultIamRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DefaultIamRoleArn = ptr.String(jtv) + } + + case "iamRoles": + if err := awsAwsjson11_deserializeDocumentIamRoleArnList(&sv.IamRoles, value); err != nil { + return err + } + + case "kmsKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.KmsKeyId = ptr.String(jtv) + } + + case "logExports": + if err := awsAwsjson11_deserializeDocumentLogExportList(&sv.LogExports, value); err != nil { + return err + } + + case "namespaceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NamespaceArn = ptr.String(jtv) + } + + case "namespaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NamespaceId = ptr.String(jtv) + } + + case "namespaceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NamespaceName to be of type string, got %T instead", value) + } + sv.NamespaceName = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NamespaceStatus to be of type string, got %T instead", value) + } + sv.Status = types.NamespaceStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentNamespaceList(v *[]types.Namespace, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.Namespace + if *v == nil { + cv = []types.Namespace{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Namespace + destAddr := &col + if err := awsAwsjson11_deserializeDocumentNamespace(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentNetworkInterface(v **types.NetworkInterface, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.NetworkInterface + if *v == nil { + sv = &types.NetworkInterface{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "availabilityZone": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AvailabilityZone = ptr.String(jtv) + } + + case "networkInterfaceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NetworkInterfaceId = ptr.String(jtv) + } + + case "privateIpAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.PrivateIpAddress = ptr.String(jtv) + } + + case "subnetId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SubnetId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentNetworkInterfaceList(v *[]types.NetworkInterface, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.NetworkInterface + if *v == nil { + cv = []types.NetworkInterface{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.NetworkInterface + destAddr := &col + if err := awsAwsjson11_deserializeDocumentNetworkInterface(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentRecoveryPoint(v **types.RecoveryPoint, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RecoveryPoint + if *v == nil { + sv = &types.RecoveryPoint{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "namespaceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NamespaceName to be of type string, got %T instead", value) + } + sv.NamespaceName = ptr.String(jtv) + } + + case "recoveryPointCreateTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.RecoveryPointCreateTime = ptr.Time(t) + } + + case "recoveryPointId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RecoveryPointId = ptr.String(jtv) + } + + case "totalSizeInMegaBytes": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TotalSizeInMegaBytes = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.TotalSizeInMegaBytes = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "workgroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkgroupName to be of type string, got %T instead", value) + } + sv.WorkgroupName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentRecoveryPointList(v *[]types.RecoveryPoint, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.RecoveryPoint + if *v == nil { + cv = []types.RecoveryPoint{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RecoveryPoint + destAddr := &col + if err := awsAwsjson11_deserializeDocumentRecoveryPoint(&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) + } + + 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 awsAwsjson11_deserializeDocumentResourcePolicy(v **types.ResourcePolicy, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourcePolicy + if *v == nil { + sv = &types.ResourcePolicy{} + } 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 String to be of type string, got %T instead", value) + } + sv.Policy = ptr.String(jtv) + } + + case "resourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentSecurityGroupIdList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecurityGroupId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentSnapshot(v **types.Snapshot, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Snapshot + if *v == nil { + sv = &types.Snapshot{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountsWithProvisionedRestoreAccess": + if err := awsAwsjson11_deserializeDocumentAccountIdList(&sv.AccountsWithProvisionedRestoreAccess, value); err != nil { + return err + } + + case "accountsWithRestoreAccess": + if err := awsAwsjson11_deserializeDocumentAccountIdList(&sv.AccountsWithRestoreAccess, value); err != nil { + return err + } + + case "actualIncrementalBackupSizeInMegaBytes": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ActualIncrementalBackupSizeInMegaBytes = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.ActualIncrementalBackupSizeInMegaBytes = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "adminUsername": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AdminUsername = ptr.String(jtv) + } + + case "backupProgressInMegaBytes": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.BackupProgressInMegaBytes = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.BackupProgressInMegaBytes = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "currentBackupRateInMegaBytesPerSecond": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CurrentBackupRateInMegaBytesPerSecond = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.CurrentBackupRateInMegaBytesPerSecond = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "elapsedTimeInSeconds": + 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.ElapsedTimeInSeconds = ptr.Int64(i64) + } + + case "estimatedSecondsToCompletion": + 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.EstimatedSecondsToCompletion = ptr.Int64(i64) + } + + case "kmsKeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KmsKeyId to be of type string, got %T instead", value) + } + sv.KmsKeyId = ptr.String(jtv) + } + + case "namespaceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NamespaceArn = ptr.String(jtv) + } + + case "namespaceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NamespaceName = ptr.String(jtv) + } + + case "ownerAccount": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.OwnerAccount = ptr.String(jtv) + } + + case "snapshotArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SnapshotArn = ptr.String(jtv) + } + + case "snapshotCreateTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.SnapshotCreateTime = ptr.Time(t) + } + + case "snapshotName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SnapshotName = ptr.String(jtv) + } + + case "snapshotRemainingDays": + 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.SnapshotRemainingDays = ptr.Int32(int32(i64)) + } + + case "snapshotRetentionPeriod": + 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.SnapshotRetentionPeriod = ptr.Int32(int32(i64)) + } + + case "snapshotRetentionStartTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.SnapshotRetentionStartTime = ptr.Time(t) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SnapshotStatus to be of type string, got %T instead", value) + } + sv.Status = types.SnapshotStatus(jtv) + } + + case "totalBackupSizeInMegaBytes": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TotalBackupSizeInMegaBytes = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.TotalBackupSizeInMegaBytes = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentSnapshotList(v *[]types.Snapshot, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.Snapshot + if *v == nil { + cv = []types.Snapshot{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Snapshot + destAddr := &col + if err := awsAwsjson11_deserializeDocumentSnapshot(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentSubnetIdList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SubnetId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Tag + if *v == nil { + sv = &types.Tag{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "key": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) + } + sv.Key = ptr.String(jtv) + } + + case "value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentTagList(v *[]types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.Tag + if *v == nil { + cv = []types.Tag{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Tag + destAddr := &col + if err := awsAwsjson11_deserializeDocumentTag(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Code = ptr.String(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.TooManyTagsException + if *v == nil { + sv = &types.TooManyTagsException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "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 awsAwsjson11_deserializeDocumentUsageLimit(v **types.UsageLimit, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.UsageLimit + if *v == nil { + sv = &types.UsageLimit{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "amount": + 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.Amount = ptr.Int64(i64) + } + + case "breachAction": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UsageLimitBreachAction to be of type string, got %T instead", value) + } + sv.BreachAction = types.UsageLimitBreachAction(jtv) + } + + case "period": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UsageLimitPeriod to be of type string, got %T instead", value) + } + sv.Period = types.UsageLimitPeriod(jtv) + } + + case "resourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ResourceArn = ptr.String(jtv) + } + + case "usageLimitArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.UsageLimitArn = ptr.String(jtv) + } + + case "usageLimitId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.UsageLimitId = ptr.String(jtv) + } + + case "usageType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UsageLimitUsageType to be of type string, got %T instead", value) + } + sv.UsageType = types.UsageLimitUsageType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentUsageLimits(v *[]types.UsageLimit, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.UsageLimit + if *v == nil { + cv = []types.UsageLimit{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.UsageLimit + destAddr := &col + if err := awsAwsjson11_deserializeDocumentUsageLimit(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentVpcEndpoint(v **types.VpcEndpoint, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.VpcEndpoint + if *v == nil { + sv = &types.VpcEndpoint{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "networkInterfaces": + if err := awsAwsjson11_deserializeDocumentNetworkInterfaceList(&sv.NetworkInterfaces, value); err != nil { + return err + } + + case "vpcEndpointId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VpcEndpointId = ptr.String(jtv) + } + + case "vpcId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.VpcId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentVpcEndpointList(v *[]types.VpcEndpoint, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.VpcEndpoint + if *v == nil { + cv = []types.VpcEndpoint{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.VpcEndpoint + destAddr := &col + if err := awsAwsjson11_deserializeDocumentVpcEndpoint(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentVpcSecurityGroupMembership(v **types.VpcSecurityGroupMembership, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.VpcSecurityGroupMembership + if *v == nil { + sv = &types.VpcSecurityGroupMembership{} + } 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 String to be of type string, got %T instead", value) + } + sv.Status = ptr.String(jtv) + } + + case "vpcSecurityGroupId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VpcSecurityGroupId to be of type string, got %T instead", value) + } + sv.VpcSecurityGroupId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentVpcSecurityGroupMembershipList(v *[]types.VpcSecurityGroupMembership, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.VpcSecurityGroupMembership + if *v == nil { + cv = []types.VpcSecurityGroupMembership{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.VpcSecurityGroupMembership + destAddr := &col + if err := awsAwsjson11_deserializeDocumentVpcSecurityGroupMembership(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentWorkgroup(v **types.Workgroup, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Workgroup + if *v == nil { + sv = &types.Workgroup{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "baseCapacity": + 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.BaseCapacity = ptr.Int32(int32(i64)) + } + + case "configParameters": + if err := awsAwsjson11_deserializeDocumentConfigParameterList(&sv.ConfigParameters, value); err != nil { + return err + } + + case "creationDate": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationDate = ptr.Time(t) + } + + case "endpoint": + if err := awsAwsjson11_deserializeDocumentEndpoint(&sv.Endpoint, value); err != nil { + return err + } + + case "enhancedVpcRouting": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.EnhancedVpcRouting = ptr.Bool(jtv) + } + + case "namespaceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NamespaceName = ptr.String(jtv) + } + + case "publiclyAccessible": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.PubliclyAccessible = ptr.Bool(jtv) + } + + case "securityGroupIds": + if err := awsAwsjson11_deserializeDocumentSecurityGroupIdList(&sv.SecurityGroupIds, value); err != nil { + return err + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkgroupStatus to be of type string, got %T instead", value) + } + sv.Status = types.WorkgroupStatus(jtv) + } + + case "subnetIds": + if err := awsAwsjson11_deserializeDocumentSubnetIdList(&sv.SubnetIds, value); err != nil { + return err + } + + case "workgroupArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.WorkgroupArn = ptr.String(jtv) + } + + case "workgroupId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.WorkgroupId = ptr.String(jtv) + } + + case "workgroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkgroupName to be of type string, got %T instead", value) + } + sv.WorkgroupName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentWorkgroupList(v *[]types.Workgroup, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.Workgroup + if *v == nil { + cv = []types.Workgroup{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Workgroup + destAddr := &col + if err := awsAwsjson11_deserializeDocumentWorkgroup(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeOpDocumentConvertRecoveryPointToSnapshotOutput(v **ConvertRecoveryPointToSnapshotOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ConvertRecoveryPointToSnapshotOutput + if *v == nil { + sv = &ConvertRecoveryPointToSnapshotOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "snapshot": + if err := awsAwsjson11_deserializeDocumentSnapshot(&sv.Snapshot, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentCreateEndpointAccessOutput(v **CreateEndpointAccessOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateEndpointAccessOutput + if *v == nil { + sv = &CreateEndpointAccessOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "endpoint": + if err := awsAwsjson11_deserializeDocumentEndpointAccess(&sv.Endpoint, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentCreateNamespaceOutput(v **CreateNamespaceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateNamespaceOutput + if *v == nil { + sv = &CreateNamespaceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "namespace": + if err := awsAwsjson11_deserializeDocumentNamespace(&sv.Namespace, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentCreateSnapshotOutput(v **CreateSnapshotOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateSnapshotOutput + if *v == nil { + sv = &CreateSnapshotOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "snapshot": + if err := awsAwsjson11_deserializeDocumentSnapshot(&sv.Snapshot, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentCreateUsageLimitOutput(v **CreateUsageLimitOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateUsageLimitOutput + if *v == nil { + sv = &CreateUsageLimitOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "usageLimit": + if err := awsAwsjson11_deserializeDocumentUsageLimit(&sv.UsageLimit, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentCreateWorkgroupOutput(v **CreateWorkgroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateWorkgroupOutput + if *v == nil { + sv = &CreateWorkgroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "workgroup": + if err := awsAwsjson11_deserializeDocumentWorkgroup(&sv.Workgroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDeleteEndpointAccessOutput(v **DeleteEndpointAccessOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteEndpointAccessOutput + if *v == nil { + sv = &DeleteEndpointAccessOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "endpoint": + if err := awsAwsjson11_deserializeDocumentEndpointAccess(&sv.Endpoint, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDeleteNamespaceOutput(v **DeleteNamespaceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteNamespaceOutput + if *v == nil { + sv = &DeleteNamespaceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "namespace": + if err := awsAwsjson11_deserializeDocumentNamespace(&sv.Namespace, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDeleteResourcePolicyOutput(v **DeleteResourcePolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteResourcePolicyOutput + if *v == nil { + sv = &DeleteResourcePolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDeleteSnapshotOutput(v **DeleteSnapshotOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteSnapshotOutput + if *v == nil { + sv = &DeleteSnapshotOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "snapshot": + if err := awsAwsjson11_deserializeDocumentSnapshot(&sv.Snapshot, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDeleteUsageLimitOutput(v **DeleteUsageLimitOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteUsageLimitOutput + if *v == nil { + sv = &DeleteUsageLimitOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "usageLimit": + if err := awsAwsjson11_deserializeDocumentUsageLimit(&sv.UsageLimit, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDeleteWorkgroupOutput(v **DeleteWorkgroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteWorkgroupOutput + if *v == nil { + sv = &DeleteWorkgroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "workgroup": + if err := awsAwsjson11_deserializeDocumentWorkgroup(&sv.Workgroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetCredentialsOutput(v **GetCredentialsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetCredentialsOutput + if *v == nil { + sv = &GetCredentialsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "dbPassword": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DbPassword to be of type string, got %T instead", value) + } + sv.DbPassword = ptr.String(jtv) + } + + case "dbUser": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DbUser to be of type string, got %T instead", value) + } + sv.DbUser = ptr.String(jtv) + } + + case "expiration": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Expiration = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "nextRefreshTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.NextRefreshTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetEndpointAccessOutput(v **GetEndpointAccessOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetEndpointAccessOutput + if *v == nil { + sv = &GetEndpointAccessOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "endpoint": + if err := awsAwsjson11_deserializeDocumentEndpointAccess(&sv.Endpoint, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetNamespaceOutput(v **GetNamespaceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetNamespaceOutput + if *v == nil { + sv = &GetNamespaceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "namespace": + if err := awsAwsjson11_deserializeDocumentNamespace(&sv.Namespace, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetRecoveryPointOutput(v **GetRecoveryPointOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetRecoveryPointOutput + if *v == nil { + sv = &GetRecoveryPointOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "recoveryPoint": + if err := awsAwsjson11_deserializeDocumentRecoveryPoint(&sv.RecoveryPoint, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetResourcePolicyOutput(v **GetResourcePolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetResourcePolicyOutput + if *v == nil { + sv = &GetResourcePolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "resourcePolicy": + if err := awsAwsjson11_deserializeDocumentResourcePolicy(&sv.ResourcePolicy, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetSnapshotOutput(v **GetSnapshotOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetSnapshotOutput + if *v == nil { + sv = &GetSnapshotOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "snapshot": + if err := awsAwsjson11_deserializeDocumentSnapshot(&sv.Snapshot, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetUsageLimitOutput(v **GetUsageLimitOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetUsageLimitOutput + if *v == nil { + sv = &GetUsageLimitOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "usageLimit": + if err := awsAwsjson11_deserializeDocumentUsageLimit(&sv.UsageLimit, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetWorkgroupOutput(v **GetWorkgroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetWorkgroupOutput + if *v == nil { + sv = &GetWorkgroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "workgroup": + if err := awsAwsjson11_deserializeDocumentWorkgroup(&sv.Workgroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListEndpointAccessOutput(v **ListEndpointAccessOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListEndpointAccessOutput + if *v == nil { + sv = &ListEndpointAccessOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "endpoints": + if err := awsAwsjson11_deserializeDocumentEndpointAccessList(&sv.Endpoints, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListNamespacesOutput(v **ListNamespacesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListNamespacesOutput + if *v == nil { + sv = &ListNamespacesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "namespaces": + if err := awsAwsjson11_deserializeDocumentNamespaceList(&sv.Namespaces, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListRecoveryPointsOutput(v **ListRecoveryPointsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListRecoveryPointsOutput + if *v == nil { + sv = &ListRecoveryPointsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "recoveryPoints": + if err := awsAwsjson11_deserializeDocumentRecoveryPointList(&sv.RecoveryPoints, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListSnapshotsOutput(v **ListSnapshotsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListSnapshotsOutput + if *v == nil { + sv = &ListSnapshotsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "snapshots": + if err := awsAwsjson11_deserializeDocumentSnapshotList(&sv.Snapshots, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "tags": + if err := awsAwsjson11_deserializeDocumentTagList(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListUsageLimitsOutput(v **ListUsageLimitsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListUsageLimitsOutput + if *v == nil { + sv = &ListUsageLimitsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "usageLimits": + if err := awsAwsjson11_deserializeDocumentUsageLimits(&sv.UsageLimits, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListWorkgroupsOutput(v **ListWorkgroupsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListWorkgroupsOutput + if *v == nil { + sv = &ListWorkgroupsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "workgroups": + if err := awsAwsjson11_deserializeDocumentWorkgroupList(&sv.Workgroups, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentPutResourcePolicyOutput(v **PutResourcePolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutResourcePolicyOutput + if *v == nil { + sv = &PutResourcePolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "resourcePolicy": + if err := awsAwsjson11_deserializeDocumentResourcePolicy(&sv.ResourcePolicy, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentRestoreFromRecoveryPointOutput(v **RestoreFromRecoveryPointOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *RestoreFromRecoveryPointOutput + if *v == nil { + sv = &RestoreFromRecoveryPointOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "namespace": + if err := awsAwsjson11_deserializeDocumentNamespace(&sv.Namespace, value); err != nil { + return err + } + + case "recoveryPointId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RecoveryPointId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentRestoreFromSnapshotOutput(v **RestoreFromSnapshotOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *RestoreFromSnapshotOutput + if *v == nil { + sv = &RestoreFromSnapshotOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "namespace": + if err := awsAwsjson11_deserializeDocumentNamespace(&sv.Namespace, value); err != nil { + return err + } + + case "ownerAccount": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.OwnerAccount = ptr.String(jtv) + } + + case "snapshotName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SnapshotName = 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_deserializeOpDocumentUpdateEndpointAccessOutput(v **UpdateEndpointAccessOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateEndpointAccessOutput + if *v == nil { + sv = &UpdateEndpointAccessOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "endpoint": + if err := awsAwsjson11_deserializeDocumentEndpointAccess(&sv.Endpoint, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentUpdateNamespaceOutput(v **UpdateNamespaceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateNamespaceOutput + if *v == nil { + sv = &UpdateNamespaceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "namespace": + if err := awsAwsjson11_deserializeDocumentNamespace(&sv.Namespace, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentUpdateSnapshotOutput(v **UpdateSnapshotOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateSnapshotOutput + if *v == nil { + sv = &UpdateSnapshotOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "snapshot": + if err := awsAwsjson11_deserializeDocumentSnapshot(&sv.Snapshot, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentUpdateUsageLimitOutput(v **UpdateUsageLimitOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateUsageLimitOutput + if *v == nil { + sv = &UpdateUsageLimitOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "usageLimit": + if err := awsAwsjson11_deserializeDocumentUsageLimit(&sv.UsageLimit, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentUpdateWorkgroupOutput(v **UpdateWorkgroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateWorkgroupOutput + if *v == nil { + sv = &UpdateWorkgroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "workgroup": + if err := awsAwsjson11_deserializeDocumentWorkgroup(&sv.Workgroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/redshiftserverless/doc.go b/service/redshiftserverless/doc.go index d5df5e738df..1e424100526 100644 --- a/service/redshiftserverless/doc.go +++ b/service/redshiftserverless/doc.go @@ -1,2 +1,23 @@ -// Package redshiftserverless is retracted. +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package redshiftserverless provides the API client, operations, and parameter +// types for Redshift Serverless. +// +// This is prerelease documentation for Amazon Redshift Serverless, which is in +// preview release. The documentation and the feature are both subject to change. +// We recommend that you use this feature only in test environments, and not in +// production environments. For preview terms and conditions, see Beta Service +// Participation in Amazon Web Services Service Terms +// (https://docs.aws.amazon.com/https:/aws.amazon.com/service-terms). This is an +// interface reference for Amazon Redshift Serverless. It contains documentation +// for one of the programming or command line interfaces you can use to manage +// Amazon Redshift Serverless. Amazon Redshift Serverless automatically provisions +// data warehouse capacity and intelligently scales the underlying resources based +// on workload demands. Amazon Redshift Serverless adjusts capacity in seconds to +// deliver consistently high performance and simplified operations for even the +// most demanding and volatile workloads. Amazon Redshift Serverless lets you focus +// on using your data to acquire new insights for your business and customers. To +// learn more about Amazon Redshift Serverless, see What is Amazon Redshift +// Serverless +// (https://docs.aws.amazon.com/redshift/latest/mgmt/serverless-whatis.html). package redshiftserverless diff --git a/service/redshiftserverless/endpoints.go b/service/redshiftserverless/endpoints.go new file mode 100644 index 00000000000..e88561915e0 --- /dev/null +++ b/service/redshiftserverless/endpoints.go @@ -0,0 +1,200 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +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/redshiftserverless/internal/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/url" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +func resolveDefaultEndpointConfiguration(o *Options) { + if o.EndpointResolver != nil { + return + } + o.EndpointResolver = NewDefaultEndpointResolver() +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "redshift-serverless" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions + resolver EndpointResolver +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + if w.awsResolver == nil { + goto fallback + } + endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) + if err == nil { + return endpoint, nil + } + + if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { + return endpoint, err + } + +fallback: + if w.resolver == nil { + return endpoint, fmt.Errorf("default endpoint resolver provided was nil") + } + return w.resolver.ResolveEndpoint(region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided +// fallbackResolver for resolution. +// +// fallbackResolver must not be nil +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + resolver: fallbackResolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} diff --git a/service/redshiftserverless/generated.json b/service/redshiftserverless/generated.json new file mode 100644 index 00000000000..baf329ef9e4 --- /dev/null +++ b/service/redshiftserverless/generated.json @@ -0,0 +1,64 @@ +{ + "dependencies": { + "github.com/aws/aws-sdk-go-v2": "v1.4.0", + "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", + "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", + "github.com/aws/smithy-go": "v1.4.0" + }, + "files": [ + "api_client.go", + "api_client_test.go", + "api_op_ConvertRecoveryPointToSnapshot.go", + "api_op_CreateEndpointAccess.go", + "api_op_CreateNamespace.go", + "api_op_CreateSnapshot.go", + "api_op_CreateUsageLimit.go", + "api_op_CreateWorkgroup.go", + "api_op_DeleteEndpointAccess.go", + "api_op_DeleteNamespace.go", + "api_op_DeleteResourcePolicy.go", + "api_op_DeleteSnapshot.go", + "api_op_DeleteUsageLimit.go", + "api_op_DeleteWorkgroup.go", + "api_op_GetCredentials.go", + "api_op_GetEndpointAccess.go", + "api_op_GetNamespace.go", + "api_op_GetRecoveryPoint.go", + "api_op_GetResourcePolicy.go", + "api_op_GetSnapshot.go", + "api_op_GetUsageLimit.go", + "api_op_GetWorkgroup.go", + "api_op_ListEndpointAccess.go", + "api_op_ListNamespaces.go", + "api_op_ListRecoveryPoints.go", + "api_op_ListSnapshots.go", + "api_op_ListTagsForResource.go", + "api_op_ListUsageLimits.go", + "api_op_ListWorkgroups.go", + "api_op_PutResourcePolicy.go", + "api_op_RestoreFromRecoveryPoint.go", + "api_op_RestoreFromSnapshot.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", + "api_op_UpdateEndpointAccess.go", + "api_op_UpdateNamespace.go", + "api_op_UpdateSnapshot.go", + "api_op_UpdateUsageLimit.go", + "api_op_UpdateWorkgroup.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/redshiftserverless", + "unstable": false +} diff --git a/service/redshiftserverless/go.mod b/service/redshiftserverless/go.mod index 18dfcaf4bd2..3e8c8a702db 100644 --- a/service/redshiftserverless/go.mod +++ b/service/redshiftserverless/go.mod @@ -2,9 +2,15 @@ module github.com/aws/aws-sdk-go-v2/service/redshiftserverless go 1.15 -retract ( - // Retract latest version of the client since module is not functional. - v1.0.1 - // API client was incorrectly released, and is not functional. - v1.0.0 +require ( + github.com/aws/aws-sdk-go-v2 v1.16.5 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.12 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.6 + github.com/aws/smithy-go v1.11.3 ) + +replace github.com/aws/aws-sdk-go-v2 => ../../ + +replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ + +replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/redshiftserverless/go.sum b/service/redshiftserverless/go.sum new file mode 100644 index 00000000000..86cce5bcbcc --- /dev/null +++ b/service/redshiftserverless/go.sum @@ -0,0 +1,11 @@ +github.com/aws/smithy-go v1.11.3 h1:DQixirEFM9IaKxX1olZ3ke3nvxRS2xMDteKIDWxozW8= +github.com/aws/smithy-go v1.11.3/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +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= +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/redshiftserverless/internal/endpoints/endpoints.go b/service/redshiftserverless/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..44cf3ee6bf0 --- /dev/null +++ b/service/redshiftserverless/internal/endpoints/endpoints.go @@ -0,0 +1,285 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver RedshiftServerless endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "redshift-serverless.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "redshift-serverless-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "redshift-serverless-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "redshift-serverless.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-north-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "redshift-serverless.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "redshift-serverless-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "redshift-serverless-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "redshift-serverless.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "redshift-serverless-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "redshift-serverless.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIso, + IsRegionalized: true, + }, + { + ID: "aws-iso-b", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "redshift-serverless-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "redshift-serverless.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "redshift-serverless.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "redshift-serverless-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "redshift-serverless-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "redshift-serverless.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/redshiftserverless/internal/endpoints/endpoints_test.go b/service/redshiftserverless/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/redshiftserverless/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/redshiftserverless/protocol_test.go b/service/redshiftserverless/protocol_test.go new file mode 100644 index 00000000000..c44376d79d0 --- /dev/null +++ b/service/redshiftserverless/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless diff --git a/service/redshiftserverless/serializers.go b/service/redshiftserverless/serializers.go new file mode 100644 index 00000000000..f782eb53bfa --- /dev/null +++ b/service/redshiftserverless/serializers.go @@ -0,0 +1,3035 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/redshiftserverless/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + "path" +) + +type awsAwsjson11_serializeOpConvertRecoveryPointToSnapshot struct { +} + +func (*awsAwsjson11_serializeOpConvertRecoveryPointToSnapshot) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpConvertRecoveryPointToSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ConvertRecoveryPointToSnapshotInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.ConvertRecoveryPointToSnapshot") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentConvertRecoveryPointToSnapshotInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpCreateEndpointAccess struct { +} + +func (*awsAwsjson11_serializeOpCreateEndpointAccess) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateEndpointAccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateEndpointAccessInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.CreateEndpointAccess") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateEndpointAccessInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpCreateNamespace struct { +} + +func (*awsAwsjson11_serializeOpCreateNamespace) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateNamespace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateNamespaceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.CreateNamespace") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateNamespaceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpCreateSnapshot struct { +} + +func (*awsAwsjson11_serializeOpCreateSnapshot) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateSnapshotInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.CreateSnapshot") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateSnapshotInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpCreateUsageLimit struct { +} + +func (*awsAwsjson11_serializeOpCreateUsageLimit) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateUsageLimit) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateUsageLimitInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.CreateUsageLimit") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateUsageLimitInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpCreateWorkgroup struct { +} + +func (*awsAwsjson11_serializeOpCreateWorkgroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateWorkgroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateWorkgroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.CreateWorkgroup") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateWorkgroupInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpDeleteEndpointAccess struct { +} + +func (*awsAwsjson11_serializeOpDeleteEndpointAccess) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteEndpointAccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteEndpointAccessInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.DeleteEndpointAccess") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteEndpointAccessInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpDeleteNamespace struct { +} + +func (*awsAwsjson11_serializeOpDeleteNamespace) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteNamespace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteNamespaceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.DeleteNamespace") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteNamespaceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpDeleteResourcePolicy struct { +} + +func (*awsAwsjson11_serializeOpDeleteResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteResourcePolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.DeleteResourcePolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteResourcePolicyInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpDeleteSnapshot struct { +} + +func (*awsAwsjson11_serializeOpDeleteSnapshot) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteSnapshotInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.DeleteSnapshot") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteSnapshotInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpDeleteUsageLimit struct { +} + +func (*awsAwsjson11_serializeOpDeleteUsageLimit) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteUsageLimit) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteUsageLimitInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.DeleteUsageLimit") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteUsageLimitInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpDeleteWorkgroup struct { +} + +func (*awsAwsjson11_serializeOpDeleteWorkgroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteWorkgroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteWorkgroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.DeleteWorkgroup") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteWorkgroupInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpGetCredentials struct { +} + +func (*awsAwsjson11_serializeOpGetCredentials) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetCredentials) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetCredentialsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.GetCredentials") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetCredentialsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpGetEndpointAccess struct { +} + +func (*awsAwsjson11_serializeOpGetEndpointAccess) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetEndpointAccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetEndpointAccessInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.GetEndpointAccess") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetEndpointAccessInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpGetNamespace struct { +} + +func (*awsAwsjson11_serializeOpGetNamespace) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetNamespace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetNamespaceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.GetNamespace") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetNamespaceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpGetRecoveryPoint struct { +} + +func (*awsAwsjson11_serializeOpGetRecoveryPoint) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetRecoveryPoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetRecoveryPointInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.GetRecoveryPoint") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetRecoveryPointInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpGetResourcePolicy struct { +} + +func (*awsAwsjson11_serializeOpGetResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetResourcePolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.GetResourcePolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetResourcePolicyInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpGetSnapshot struct { +} + +func (*awsAwsjson11_serializeOpGetSnapshot) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetSnapshotInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.GetSnapshot") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetSnapshotInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpGetUsageLimit struct { +} + +func (*awsAwsjson11_serializeOpGetUsageLimit) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetUsageLimit) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetUsageLimitInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.GetUsageLimit") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetUsageLimitInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpGetWorkgroup struct { +} + +func (*awsAwsjson11_serializeOpGetWorkgroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetWorkgroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetWorkgroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.GetWorkgroup") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetWorkgroupInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpListEndpointAccess struct { +} + +func (*awsAwsjson11_serializeOpListEndpointAccess) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListEndpointAccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListEndpointAccessInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.ListEndpointAccess") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListEndpointAccessInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpListNamespaces struct { +} + +func (*awsAwsjson11_serializeOpListNamespaces) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListNamespaces) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListNamespacesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.ListNamespaces") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListNamespacesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpListRecoveryPoints struct { +} + +func (*awsAwsjson11_serializeOpListRecoveryPoints) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListRecoveryPoints) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListRecoveryPointsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.ListRecoveryPoints") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListRecoveryPointsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpListSnapshots struct { +} + +func (*awsAwsjson11_serializeOpListSnapshots) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListSnapshots) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListSnapshotsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.ListSnapshots") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListSnapshotsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListTagsForResource struct { +} + +func (*awsAwsjson11_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.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_serializeOpListUsageLimits struct { +} + +func (*awsAwsjson11_serializeOpListUsageLimits) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListUsageLimits) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListUsageLimitsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.ListUsageLimits") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListUsageLimitsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpListWorkgroups struct { +} + +func (*awsAwsjson11_serializeOpListWorkgroups) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListWorkgroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListWorkgroupsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.ListWorkgroups") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListWorkgroupsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpPutResourcePolicy struct { +} + +func (*awsAwsjson11_serializeOpPutResourcePolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpPutResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutResourcePolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.PutResourcePolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentPutResourcePolicyInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpRestoreFromRecoveryPoint struct { +} + +func (*awsAwsjson11_serializeOpRestoreFromRecoveryPoint) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpRestoreFromRecoveryPoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RestoreFromRecoveryPointInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.RestoreFromRecoveryPoint") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentRestoreFromRecoveryPointInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpRestoreFromSnapshot struct { +} + +func (*awsAwsjson11_serializeOpRestoreFromSnapshot) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpRestoreFromSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RestoreFromSnapshotInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.RestoreFromSnapshot") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentRestoreFromSnapshotInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpTagResource struct { +} + +func (*awsAwsjson11_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.TagResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpUntagResource struct { +} + +func (*awsAwsjson11_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.UntagResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpUpdateEndpointAccess struct { +} + +func (*awsAwsjson11_serializeOpUpdateEndpointAccess) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateEndpointAccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateEndpointAccessInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.UpdateEndpointAccess") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateEndpointAccessInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpUpdateNamespace struct { +} + +func (*awsAwsjson11_serializeOpUpdateNamespace) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateNamespace) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateNamespaceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.UpdateNamespace") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateNamespaceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpUpdateSnapshot struct { +} + +func (*awsAwsjson11_serializeOpUpdateSnapshot) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateSnapshot) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateSnapshotInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.UpdateSnapshot") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateSnapshotInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpUpdateUsageLimit struct { +} + +func (*awsAwsjson11_serializeOpUpdateUsageLimit) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateUsageLimit) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateUsageLimitInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.UpdateUsageLimit") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateUsageLimitInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpUpdateWorkgroup struct { +} + +func (*awsAwsjson11_serializeOpUpdateWorkgroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateWorkgroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateWorkgroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("RedshiftServerless.UpdateWorkgroup") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateWorkgroupInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeDocumentConfigParameter(v *types.ConfigParameter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ParameterKey != nil { + ok := object.Key("parameterKey") + ok.String(*v.ParameterKey) + } + + if v.ParameterValue != nil { + ok := object.Key("parameterValue") + ok.String(*v.ParameterValue) + } + + return nil +} + +func awsAwsjson11_serializeDocumentConfigParameterList(v []types.ConfigParameter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentConfigParameter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentIamRoleArnList(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_serializeDocumentLogExportList(v []types.LogExport, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsAwsjson11_serializeDocumentSecurityGroupIdList(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_serializeDocumentSubnetIdList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentTag(v *types.Tag, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("key") + ok.String(*v.Key) + } + + if v.Value != nil { + ok := object.Key("value") + ok.String(*v.Value) + } + + return nil +} + +func awsAwsjson11_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentTagList(v []types.Tag, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentTag(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentVpcSecurityGroupIdList(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_serializeOpDocumentConvertRecoveryPointToSnapshotInput(v *ConvertRecoveryPointToSnapshotInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RecoveryPointId != nil { + ok := object.Key("recoveryPointId") + ok.String(*v.RecoveryPointId) + } + + if v.RetentionPeriod != nil { + ok := object.Key("retentionPeriod") + ok.Integer(*v.RetentionPeriod) + } + + if v.SnapshotName != nil { + ok := object.Key("snapshotName") + ok.String(*v.SnapshotName) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentCreateEndpointAccessInput(v *CreateEndpointAccessInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndpointName != nil { + ok := object.Key("endpointName") + ok.String(*v.EndpointName) + } + + if v.SubnetIds != nil { + ok := object.Key("subnetIds") + if err := awsAwsjson11_serializeDocumentSubnetIdList(v.SubnetIds, ok); err != nil { + return err + } + } + + if v.VpcSecurityGroupIds != nil { + ok := object.Key("vpcSecurityGroupIds") + if err := awsAwsjson11_serializeDocumentVpcSecurityGroupIdList(v.VpcSecurityGroupIds, ok); err != nil { + return err + } + } + + if v.WorkgroupName != nil { + ok := object.Key("workgroupName") + ok.String(*v.WorkgroupName) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentCreateNamespaceInput(v *CreateNamespaceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdminUsername != nil { + ok := object.Key("adminUsername") + ok.String(*v.AdminUsername) + } + + if v.AdminUserPassword != nil { + ok := object.Key("adminUserPassword") + ok.String(*v.AdminUserPassword) + } + + if v.DbName != nil { + ok := object.Key("dbName") + ok.String(*v.DbName) + } + + if v.DefaultIamRoleArn != nil { + ok := object.Key("defaultIamRoleArn") + ok.String(*v.DefaultIamRoleArn) + } + + if v.IamRoles != nil { + ok := object.Key("iamRoles") + if err := awsAwsjson11_serializeDocumentIamRoleArnList(v.IamRoles, ok); err != nil { + return err + } + } + + if v.KmsKeyId != nil { + ok := object.Key("kmsKeyId") + ok.String(*v.KmsKeyId) + } + + if v.LogExports != nil { + ok := object.Key("logExports") + if err := awsAwsjson11_serializeDocumentLogExportList(v.LogExports, ok); err != nil { + return err + } + } + + if v.NamespaceName != nil { + ok := object.Key("namespaceName") + ok.String(*v.NamespaceName) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentCreateSnapshotInput(v *CreateSnapshotInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NamespaceName != nil { + ok := object.Key("namespaceName") + ok.String(*v.NamespaceName) + } + + if v.RetentionPeriod != nil { + ok := object.Key("retentionPeriod") + ok.Integer(*v.RetentionPeriod) + } + + if v.SnapshotName != nil { + ok := object.Key("snapshotName") + ok.String(*v.SnapshotName) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentCreateUsageLimitInput(v *CreateUsageLimitInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Amount != nil { + ok := object.Key("amount") + ok.Long(*v.Amount) + } + + if len(v.BreachAction) > 0 { + ok := object.Key("breachAction") + ok.String(string(v.BreachAction)) + } + + if len(v.Period) > 0 { + ok := object.Key("period") + ok.String(string(v.Period)) + } + + if v.ResourceArn != nil { + ok := object.Key("resourceArn") + ok.String(*v.ResourceArn) + } + + if len(v.UsageType) > 0 { + ok := object.Key("usageType") + ok.String(string(v.UsageType)) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentCreateWorkgroupInput(v *CreateWorkgroupInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BaseCapacity != nil { + ok := object.Key("baseCapacity") + ok.Integer(*v.BaseCapacity) + } + + if v.ConfigParameters != nil { + ok := object.Key("configParameters") + if err := awsAwsjson11_serializeDocumentConfigParameterList(v.ConfigParameters, ok); err != nil { + return err + } + } + + if v.EnhancedVpcRouting != nil { + ok := object.Key("enhancedVpcRouting") + ok.Boolean(*v.EnhancedVpcRouting) + } + + if v.NamespaceName != nil { + ok := object.Key("namespaceName") + ok.String(*v.NamespaceName) + } + + if v.PubliclyAccessible != nil { + ok := object.Key("publiclyAccessible") + ok.Boolean(*v.PubliclyAccessible) + } + + if v.SecurityGroupIds != nil { + ok := object.Key("securityGroupIds") + if err := awsAwsjson11_serializeDocumentSecurityGroupIdList(v.SecurityGroupIds, ok); err != nil { + return err + } + } + + if v.SubnetIds != nil { + ok := object.Key("subnetIds") + if err := awsAwsjson11_serializeDocumentSubnetIdList(v.SubnetIds, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + if v.WorkgroupName != nil { + ok := object.Key("workgroupName") + ok.String(*v.WorkgroupName) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentDeleteEndpointAccessInput(v *DeleteEndpointAccessInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndpointName != nil { + ok := object.Key("endpointName") + ok.String(*v.EndpointName) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentDeleteNamespaceInput(v *DeleteNamespaceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FinalSnapshotName != nil { + ok := object.Key("finalSnapshotName") + ok.String(*v.FinalSnapshotName) + } + + if v.FinalSnapshotRetentionPeriod != nil { + ok := object.Key("finalSnapshotRetentionPeriod") + ok.Integer(*v.FinalSnapshotRetentionPeriod) + } + + if v.NamespaceName != nil { + ok := object.Key("namespaceName") + ok.String(*v.NamespaceName) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentDeleteResourcePolicyInput(v *DeleteResourcePolicyInput, 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_serializeOpDocumentDeleteSnapshotInput(v *DeleteSnapshotInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SnapshotName != nil { + ok := object.Key("snapshotName") + ok.String(*v.SnapshotName) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentDeleteUsageLimitInput(v *DeleteUsageLimitInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.UsageLimitId != nil { + ok := object.Key("usageLimitId") + ok.String(*v.UsageLimitId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentDeleteWorkgroupInput(v *DeleteWorkgroupInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.WorkgroupName != nil { + ok := object.Key("workgroupName") + ok.String(*v.WorkgroupName) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetCredentialsInput(v *GetCredentialsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DbName != nil { + ok := object.Key("dbName") + ok.String(*v.DbName) + } + + if v.DurationSeconds != nil { + ok := object.Key("durationSeconds") + ok.Integer(*v.DurationSeconds) + } + + if v.WorkgroupName != nil { + ok := object.Key("workgroupName") + ok.String(*v.WorkgroupName) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetEndpointAccessInput(v *GetEndpointAccessInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndpointName != nil { + ok := object.Key("endpointName") + ok.String(*v.EndpointName) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetNamespaceInput(v *GetNamespaceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NamespaceName != nil { + ok := object.Key("namespaceName") + ok.String(*v.NamespaceName) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetRecoveryPointInput(v *GetRecoveryPointInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RecoveryPointId != nil { + ok := object.Key("recoveryPointId") + ok.String(*v.RecoveryPointId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetResourcePolicyInput(v *GetResourcePolicyInput, 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_serializeOpDocumentGetSnapshotInput(v *GetSnapshotInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.OwnerAccount != nil { + ok := object.Key("ownerAccount") + ok.String(*v.OwnerAccount) + } + + if v.SnapshotArn != nil { + ok := object.Key("snapshotArn") + ok.String(*v.SnapshotArn) + } + + if v.SnapshotName != nil { + ok := object.Key("snapshotName") + ok.String(*v.SnapshotName) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetUsageLimitInput(v *GetUsageLimitInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.UsageLimitId != nil { + ok := object.Key("usageLimitId") + ok.String(*v.UsageLimitId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetWorkgroupInput(v *GetWorkgroupInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.WorkgroupName != nil { + ok := object.Key("workgroupName") + ok.String(*v.WorkgroupName) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentListEndpointAccessInput(v *ListEndpointAccessInput, 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.VpcId != nil { + ok := object.Key("vpcId") + ok.String(*v.VpcId) + } + + if v.WorkgroupName != nil { + ok := object.Key("workgroupName") + ok.String(*v.WorkgroupName) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentListNamespacesInput(v *ListNamespacesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentListRecoveryPointsInput(v *ListRecoveryPointsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndTime != nil { + ok := object.Key("endTime") + ok.Double(smithytime.FormatEpochSeconds(*v.EndTime)) + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NamespaceName != nil { + ok := object.Key("namespaceName") + ok.String(*v.NamespaceName) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if v.StartTime != nil { + ok := object.Key("startTime") + ok.Double(smithytime.FormatEpochSeconds(*v.StartTime)) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentListSnapshotsInput(v *ListSnapshotsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndTime != nil { + ok := object.Key("endTime") + ok.Double(smithytime.FormatEpochSeconds(*v.EndTime)) + } + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NamespaceArn != nil { + ok := object.Key("namespaceArn") + ok.String(*v.NamespaceArn) + } + + if v.NamespaceName != nil { + ok := object.Key("namespaceName") + ok.String(*v.NamespaceName) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if v.OwnerAccount != nil { + ok := object.Key("ownerAccount") + ok.String(*v.OwnerAccount) + } + + if v.StartTime != nil { + ok := object.Key("startTime") + ok.Double(smithytime.FormatEpochSeconds(*v.StartTime)) + } + + 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_serializeOpDocumentListUsageLimitsInput(v *ListUsageLimitsInput, 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.ResourceArn != nil { + ok := object.Key("resourceArn") + ok.String(*v.ResourceArn) + } + + if len(v.UsageType) > 0 { + ok := object.Key("usageType") + ok.String(string(v.UsageType)) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentListWorkgroupsInput(v *ListWorkgroupsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentPutResourcePolicyInput(v *PutResourcePolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Policy != nil { + ok := object.Key("policy") + ok.String(*v.Policy) + } + + if v.ResourceArn != nil { + ok := object.Key("resourceArn") + ok.String(*v.ResourceArn) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentRestoreFromRecoveryPointInput(v *RestoreFromRecoveryPointInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NamespaceName != nil { + ok := object.Key("namespaceName") + ok.String(*v.NamespaceName) + } + + if v.RecoveryPointId != nil { + ok := object.Key("recoveryPointId") + ok.String(*v.RecoveryPointId) + } + + if v.WorkgroupName != nil { + ok := object.Key("workgroupName") + ok.String(*v.WorkgroupName) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentRestoreFromSnapshotInput(v *RestoreFromSnapshotInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NamespaceName != nil { + ok := object.Key("namespaceName") + ok.String(*v.NamespaceName) + } + + if v.OwnerAccount != nil { + ok := object.Key("ownerAccount") + ok.String(*v.OwnerAccount) + } + + if v.SnapshotArn != nil { + ok := object.Key("snapshotArn") + ok.String(*v.SnapshotArn) + } + + if v.SnapshotName != nil { + ok := object.Key("snapshotName") + ok.String(*v.SnapshotName) + } + + if v.WorkgroupName != nil { + ok := object.Key("workgroupName") + ok.String(*v.WorkgroupName) + } + + 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_serializeOpDocumentUpdateEndpointAccessInput(v *UpdateEndpointAccessInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndpointName != nil { + ok := object.Key("endpointName") + ok.String(*v.EndpointName) + } + + if v.VpcSecurityGroupIds != nil { + ok := object.Key("vpcSecurityGroupIds") + if err := awsAwsjson11_serializeDocumentVpcSecurityGroupIdList(v.VpcSecurityGroupIds, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentUpdateNamespaceInput(v *UpdateNamespaceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdminUsername != nil { + ok := object.Key("adminUsername") + ok.String(*v.AdminUsername) + } + + if v.AdminUserPassword != nil { + ok := object.Key("adminUserPassword") + ok.String(*v.AdminUserPassword) + } + + if v.DefaultIamRoleArn != nil { + ok := object.Key("defaultIamRoleArn") + ok.String(*v.DefaultIamRoleArn) + } + + if v.IamRoles != nil { + ok := object.Key("iamRoles") + if err := awsAwsjson11_serializeDocumentIamRoleArnList(v.IamRoles, ok); err != nil { + return err + } + } + + if v.KmsKeyId != nil { + ok := object.Key("kmsKeyId") + ok.String(*v.KmsKeyId) + } + + if v.LogExports != nil { + ok := object.Key("logExports") + if err := awsAwsjson11_serializeDocumentLogExportList(v.LogExports, ok); err != nil { + return err + } + } + + if v.NamespaceName != nil { + ok := object.Key("namespaceName") + ok.String(*v.NamespaceName) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentUpdateSnapshotInput(v *UpdateSnapshotInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RetentionPeriod != nil { + ok := object.Key("retentionPeriod") + ok.Integer(*v.RetentionPeriod) + } + + if v.SnapshotName != nil { + ok := object.Key("snapshotName") + ok.String(*v.SnapshotName) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentUpdateUsageLimitInput(v *UpdateUsageLimitInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Amount != nil { + ok := object.Key("amount") + ok.Long(*v.Amount) + } + + if len(v.BreachAction) > 0 { + ok := object.Key("breachAction") + ok.String(string(v.BreachAction)) + } + + if v.UsageLimitId != nil { + ok := object.Key("usageLimitId") + ok.String(*v.UsageLimitId) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentUpdateWorkgroupInput(v *UpdateWorkgroupInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BaseCapacity != nil { + ok := object.Key("baseCapacity") + ok.Integer(*v.BaseCapacity) + } + + if v.ConfigParameters != nil { + ok := object.Key("configParameters") + if err := awsAwsjson11_serializeDocumentConfigParameterList(v.ConfigParameters, ok); err != nil { + return err + } + } + + if v.EnhancedVpcRouting != nil { + ok := object.Key("enhancedVpcRouting") + ok.Boolean(*v.EnhancedVpcRouting) + } + + if v.PubliclyAccessible != nil { + ok := object.Key("publiclyAccessible") + ok.Boolean(*v.PubliclyAccessible) + } + + if v.SecurityGroupIds != nil { + ok := object.Key("securityGroupIds") + if err := awsAwsjson11_serializeDocumentSecurityGroupIdList(v.SecurityGroupIds, ok); err != nil { + return err + } + } + + if v.SubnetIds != nil { + ok := object.Key("subnetIds") + if err := awsAwsjson11_serializeDocumentSubnetIdList(v.SubnetIds, ok); err != nil { + return err + } + } + + if v.WorkgroupName != nil { + ok := object.Key("workgroupName") + ok.String(*v.WorkgroupName) + } + + return nil +} diff --git a/service/redshiftserverless/types/enums.go b/service/redshiftserverless/types/enums.go new file mode 100644 index 00000000000..472c4aacc85 --- /dev/null +++ b/service/redshiftserverless/types/enums.go @@ -0,0 +1,149 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type LogExport string + +// Enum values for LogExport +const ( + LogExportUserActivityLog LogExport = "useractivitylog" + LogExportUserLog LogExport = "userlog" + LogExportConnectionLog LogExport = "connectionlog" +) + +// Values returns all known values for LogExport. Note that this can be expanded in +// the future, and 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 (LogExport) Values() []LogExport { + return []LogExport{ + "useractivitylog", + "userlog", + "connectionlog", + } +} + +type NamespaceStatus string + +// Enum values for NamespaceStatus +const ( + NamespaceStatusAvailable NamespaceStatus = "AVAILABLE" + NamespaceStatusModifying NamespaceStatus = "MODIFYING" + NamespaceStatusDeleting NamespaceStatus = "DELETING" +) + +// Values returns all known values for NamespaceStatus. Note that this can be +// expanded in the future, and 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 (NamespaceStatus) Values() []NamespaceStatus { + return []NamespaceStatus{ + "AVAILABLE", + "MODIFYING", + "DELETING", + } +} + +type SnapshotStatus string + +// Enum values for SnapshotStatus +const ( + SnapshotStatusAvailable SnapshotStatus = "AVAILABLE" + SnapshotStatusCreating SnapshotStatus = "CREATING" + SnapshotStatusDeleted SnapshotStatus = "DELETED" + SnapshotStatusCancelled SnapshotStatus = "CANCELLED" + SnapshotStatusFailed SnapshotStatus = "FAILED" + SnapshotStatusCopying SnapshotStatus = "COPYING" +) + +// Values returns all known values for SnapshotStatus. Note that this can be +// expanded in the future, and 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 (SnapshotStatus) Values() []SnapshotStatus { + return []SnapshotStatus{ + "AVAILABLE", + "CREATING", + "DELETED", + "CANCELLED", + "FAILED", + "COPYING", + } +} + +type UsageLimitBreachAction string + +// Enum values for UsageLimitBreachAction +const ( + UsageLimitBreachActionLog UsageLimitBreachAction = "log" + UsageLimitBreachActionEmitMetric UsageLimitBreachAction = "emit-metric" + UsageLimitBreachActionDeactivate UsageLimitBreachAction = "deactivate" +) + +// Values returns all known values for UsageLimitBreachAction. Note that this can +// be expanded in the future, and 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 (UsageLimitBreachAction) Values() []UsageLimitBreachAction { + return []UsageLimitBreachAction{ + "log", + "emit-metric", + "deactivate", + } +} + +type UsageLimitPeriod string + +// Enum values for UsageLimitPeriod +const ( + UsageLimitPeriodDaily UsageLimitPeriod = "daily" + UsageLimitPeriodWeekly UsageLimitPeriod = "weekly" + UsageLimitPeriodMonthly UsageLimitPeriod = "monthly" +) + +// Values returns all known values for UsageLimitPeriod. Note that this can be +// expanded in the future, and 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 (UsageLimitPeriod) Values() []UsageLimitPeriod { + return []UsageLimitPeriod{ + "daily", + "weekly", + "monthly", + } +} + +type UsageLimitUsageType string + +// Enum values for UsageLimitUsageType +const ( + UsageLimitUsageTypeServerlessCompute UsageLimitUsageType = "serverless-compute" + UsageLimitUsageTypeCrossRegionDatasharing UsageLimitUsageType = "cross-region-datasharing" +) + +// Values returns all known values for UsageLimitUsageType. Note that this can be +// expanded in the future, and 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 (UsageLimitUsageType) Values() []UsageLimitUsageType { + return []UsageLimitUsageType{ + "serverless-compute", + "cross-region-datasharing", + } +} + +type WorkgroupStatus string + +// Enum values for WorkgroupStatus +const ( + WorkgroupStatusCreating WorkgroupStatus = "CREATING" + WorkgroupStatusAvailable WorkgroupStatus = "AVAILABLE" + WorkgroupStatusModifying WorkgroupStatus = "MODIFYING" + WorkgroupStatusDeleting WorkgroupStatus = "DELETING" +) + +// Values returns all known values for WorkgroupStatus. Note that this can be +// expanded in the future, and 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 (WorkgroupStatus) Values() []WorkgroupStatus { + return []WorkgroupStatus{ + "CREATING", + "AVAILABLE", + "MODIFYING", + "DELETING", + } +} diff --git a/service/redshiftserverless/types/errors.go b/service/redshiftserverless/types/errors.go new file mode 100644 index 00000000000..0fda932e7e0 --- /dev/null +++ b/service/redshiftserverless/types/errors.go @@ -0,0 +1,207 @@ +// 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 + + Code *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { return "AccessDeniedException" } +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The submitted action has conflicts. +type ConflictException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { return "ConflictException" } +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// There is an insufficient capacity to perform the action. +type InsufficientCapacityException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *InsufficientCapacityException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InsufficientCapacityException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InsufficientCapacityException) ErrorCode() string { return "InsufficientCapacityException" } +func (e *InsufficientCapacityException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request processing has failed because of an unknown error, exception or +// failure. +type InternalServerException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { return "InternalServerException" } +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The provided pagination token is invalid. +type InvalidPaginationException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *InvalidPaginationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidPaginationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidPaginationException) ErrorCode() string { return "InvalidPaginationException" } +func (e *InvalidPaginationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The resource could not be found. +type ResourceNotFoundException struct { + Message *string + + ResourceName *string + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundException) ErrorCode() string { return "ResourceNotFoundException" } +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The service limit was exceeded. +type ServiceQuotaExceededException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { return "ServiceQuotaExceededException" } +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was denied due to request throttling. +type ThrottlingException struct { + Message *string + + Code *string + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { return "ThrottlingException" } +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request exceeded the number of tags allowed for a resource. +type TooManyTagsException struct { + Message *string + + ResourceName *string + + noSmithyDocumentSerde +} + +func (e *TooManyTagsException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TooManyTagsException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TooManyTagsException) ErrorCode() string { return "TooManyTagsException" } +func (e *TooManyTagsException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The input failed to satisfy the constraints specified by an AWS service. +type ValidationException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { return "ValidationException" } +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/redshiftserverless/types/types.go b/service/redshiftserverless/types/types.go new file mode 100644 index 00000000000..c7043a377f5 --- /dev/null +++ b/service/redshiftserverless/types/types.go @@ -0,0 +1,374 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// An array of key-value pairs to set for advanced control over Amazon Redshift +// Serverless. +type ConfigParameter struct { + + // The key of the parameter. The options are datestyle, + // enable_user_activity_logging, query_group, search_path, and + // max_query_execution_time. + ParameterKey *string + + // The value of the parameter to set. + ParameterValue *string + + noSmithyDocumentSerde +} + +// The VPC endpoint object. +type Endpoint struct { + + // The DNS address of the VPC endpoint. + Address *string + + // The port that Amazon Redshift Serverless listens on. + Port *int32 + + // An array of VpcEndpoint objects. + VpcEndpoints []VpcEndpoint + + noSmithyDocumentSerde +} + +// Information about an Amazon Redshift Serverless VPC endpoint. +type EndpointAccess struct { + + // The DNS address of the endpoint. + Address *string + + // The Amazon Resource Name (ARN) of the VPC endpoint. + EndpointArn *string + + // The time that the endpoint was created. + EndpointCreateTime *time.Time + + // The name of the VPC endpoint. + EndpointName *string + + // The status of the VPC endpoint. + EndpointStatus *string + + // The port number on which Amazon Redshift Serverless accepts incoming + // connections. + Port *int32 + + // The unique identifier of subnets where Amazon Redshift Serverless choose to + // deploy the VPC endpoint. + SubnetIds []string + + // The connection endpoint for connecting to Amazon Redshift Serverless. + VpcEndpoint *VpcEndpoint + + // The security groups associated with the endpoint. + VpcSecurityGroups []VpcSecurityGroupMembership + + // The name of the workgroup associated with the endpoint. + WorkgroupName *string + + noSmithyDocumentSerde +} + +// A collection of database objects and users. +type Namespace struct { + + // The username of the administrator for the first database created in the + // namespace. + AdminUsername *string + + // The date of when the namespace was created. + CreationDate *time.Time + + // The name of the first database created in the namespace. + DbName *string + + // The Amazon Resource Name (ARN) of the IAM role to set as a default in the + // namespace. + DefaultIamRoleArn *string + + // A list of IAM roles to associate with the namespace. + IamRoles []string + + // The ID of the Amazon Web Services Key Management Service key used to encrypt + // your data. + KmsKeyId *string + + // The types of logs the namespace can export. Available export types are User log, + // Connection log, and User activity log. + LogExports []LogExport + + // The Amazon Resource Name (ARN) associated with a namespace. + NamespaceArn *string + + // The unique identifier of a namespace. + NamespaceId *string + + // The name of the namespace. Must be between 3-64 alphanumeric characters in + // lowercase, and it cannot be a reserved word. A list of reserved words can be + // found in Reserved Words + // (https://docs.aws.amazon.com/redshift/latest/dg/r_pg_keywords.html) in the + // Amazon Redshift Database Developer Guide. + NamespaceName *string + + // The status of the namespace. + Status NamespaceStatus + + noSmithyDocumentSerde +} + +// Contains information about a network interface in an Amazon Redshift Serverless +// managed VPC endpoint. +type NetworkInterface struct { + + // The availability Zone. + AvailabilityZone *string + + // The unique identifier of the network interface. + NetworkInterfaceId *string + + // The IPv4 address of the network interface within the subnet. + PrivateIpAddress *string + + // The unique identifier of the subnet. + SubnetId *string + + noSmithyDocumentSerde +} + +// The automatically created recovery point of a namespace. Recovery points are +// created every 30 minutes and kept for 24 hours. +type RecoveryPoint struct { + + // The name of the namespace the recovery point is associated with. + NamespaceName *string + + // The time the recovery point is created. + RecoveryPointCreateTime *time.Time + + // The unique identifier of the recovery point. + RecoveryPointId *string + + // The total size of the data in the recovery point in megabytes. + TotalSizeInMegaBytes *float64 + + // The name of the workgroup the recovery point is associated with. + WorkgroupName *string + + noSmithyDocumentSerde +} + +// The resource policy object. Currently, you can use policies to share snapshots +// across Amazon Web Services accounts. +type ResourcePolicy struct { + + // The resource policy. + Policy *string + + // The Amazon Resource Name (ARN) of the policy. + ResourceArn *string + + noSmithyDocumentSerde +} + +// A snapshot object that contains databases. +type Snapshot struct { + + // All of the Amazon Web Services accounts that have access to restore a snapshot + // to a provisioned cluster. + AccountsWithProvisionedRestoreAccess []string + + // All of the Amazon Web Services accounts that have access to restore a snapshot + // to a namespace. + AccountsWithRestoreAccess []string + + // The size of the incremental backup in megabytes. + ActualIncrementalBackupSizeInMegaBytes *float64 + + // The username of the database within a snapshot. + AdminUsername *string + + // The size in megabytes of the data that has been backed up to a snapshot. + BackupProgressInMegaBytes *float64 + + // The rate at which data is backed up into a snapshot in megabytes per second. + CurrentBackupRateInMegaBytesPerSecond *float64 + + // The amount of time it took to back up data into a snapshot. + ElapsedTimeInSeconds *int64 + + // The estimated amount of seconds until the snapshot completes backup. + EstimatedSecondsToCompletion *int64 + + // The unique identifier of the KMS key used to encrypt the snapshot. + KmsKeyId *string + + // The Amazon Resource Name (ARN) of the namespace the snapshot was created from. + NamespaceArn *string + + // The name of the namepsace. + NamespaceName *string + + // The owner Amazon Web Services; account of the snapshot. + OwnerAccount *string + + // The Amazon Resource Name (ARN) of the snapshot. + SnapshotArn *string + + // The timestamp of when the snapshot was created. + SnapshotCreateTime *time.Time + + // The name of the snapshot. + SnapshotName *string + + // The amount of days until the snapshot is deleted. + SnapshotRemainingDays *int32 + + // The period of time, in days, of how long the snapshot is retained. + SnapshotRetentionPeriod *int32 + + // The timestamp of when data within the snapshot started getting retained. + SnapshotRetentionStartTime *time.Time + + // The status of the snapshot. + Status SnapshotStatus + + // The total size, in megabytes, of how big the snapshot is. + TotalBackupSizeInMegaBytes *float64 + + noSmithyDocumentSerde +} + +// A map of key-value pairs. +type Tag struct { + + // The key to use in the tag. + // + // This member is required. + Key *string + + // The value of the tag. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// The usage limit object. +type UsageLimit struct { + + // The limit amount. If time-based, this amount is in RPUs consumed per hour. If + // data-based, this amount is in terabytes (TB). The value must be a positive + // number. + Amount *int64 + + // The action that Amazon Redshift Serverless takes when the limit is reached. + BreachAction UsageLimitBreachAction + + // The time period that the amount applies to. A weekly period begins on Sunday. + // The default is monthly. + Period UsageLimitPeriod + + // The Amazon Resource Name (ARN) that identifies the Amazon Redshift Serverless + // resource. + ResourceArn *string + + // The Amazon Resource Name (ARN) of the resource associated with the usage limit. + UsageLimitArn *string + + // The identifier of the usage limit. + UsageLimitId *string + + // The Amazon Redshift Serverless feature to limit. + UsageType UsageLimitUsageType + + noSmithyDocumentSerde +} + +// The connection endpoint for connecting to Amazon Redshift Serverless through the +// proxy. +type VpcEndpoint struct { + + // One or more network interfaces of the endpoint. Also known as an interface + // endpoint. + NetworkInterfaces []NetworkInterface + + // The connection endpoint ID for connecting to Amazon Redshift Serverless. + VpcEndpointId *string + + // The VPC identifier that the endpoint is associated with. + VpcId *string + + noSmithyDocumentSerde +} + +// Describes the members of a VPC security group. +type VpcSecurityGroupMembership struct { + + // The status of the VPC security group. + Status *string + + // The unique identifier of the VPC security group. + VpcSecurityGroupId *string + + noSmithyDocumentSerde +} + +// The collection of computing resources from which an endpoint is created. +type Workgroup struct { + + // The base data warehouse capacity of the workgroup in Redshift Processing Units + // (RPUs). + BaseCapacity *int32 + + // An array of parameters to set for finer control over a database. The options are + // datestyle, enable_user_activity_logging, query_group, search_path, and + // max_query_execution_time. + ConfigParameters []ConfigParameter + + // The creation date of the workgroup. + CreationDate *time.Time + + // The endpoint that is created from the workgroup. + Endpoint *Endpoint + + // The value that specifies whether to enable enhanced virtual private cloud (VPC) + // routing, which forces Amazon Redshift Serverless to route traffic through your + // VPC. + EnhancedVpcRouting *bool + + // The namespace the workgroup is associated with. + NamespaceName *string + + // A value that specifies whether the workgroup can be accessible from a public + // network + PubliclyAccessible *bool + + // An array of security group IDs to associate with the workgroup. + SecurityGroupIds []string + + // The status of the workgroup. + Status WorkgroupStatus + + // An array of subnet IDs the workgroup is associated with. + SubnetIds []string + + // The Amazon Resource Name (ARN) that links to the workgroup. + WorkgroupArn *string + + // The unique identifier of the workgroup. + WorkgroupId *string + + // The name of the workgroup. + WorkgroupName *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/redshiftserverless/validators.go b/service/redshiftserverless/validators.go new file mode 100644 index 00000000000..6dc541729cf --- /dev/null +++ b/service/redshiftserverless/validators.go @@ -0,0 +1,1269 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package redshiftserverless + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/redshiftserverless/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpConvertRecoveryPointToSnapshot struct { +} + +func (*validateOpConvertRecoveryPointToSnapshot) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpConvertRecoveryPointToSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ConvertRecoveryPointToSnapshotInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpConvertRecoveryPointToSnapshotInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateEndpointAccess struct { +} + +func (*validateOpCreateEndpointAccess) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateEndpointAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateEndpointAccessInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateEndpointAccessInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateNamespace struct { +} + +func (*validateOpCreateNamespace) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateNamespace) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateNamespaceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateNamespaceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateSnapshot struct { +} + +func (*validateOpCreateSnapshot) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateSnapshotInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateSnapshotInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateUsageLimit struct { +} + +func (*validateOpCreateUsageLimit) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateUsageLimit) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateUsageLimitInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateUsageLimitInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateWorkgroup struct { +} + +func (*validateOpCreateWorkgroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateWorkgroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateWorkgroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateWorkgroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteEndpointAccess struct { +} + +func (*validateOpDeleteEndpointAccess) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteEndpointAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteEndpointAccessInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteEndpointAccessInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteNamespace struct { +} + +func (*validateOpDeleteNamespace) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteNamespace) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteNamespaceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteNamespaceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteResourcePolicy struct { +} + +func (*validateOpDeleteResourcePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteResourcePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteSnapshot struct { +} + +func (*validateOpDeleteSnapshot) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteSnapshotInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteSnapshotInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteUsageLimit struct { +} + +func (*validateOpDeleteUsageLimit) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteUsageLimit) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteUsageLimitInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteUsageLimitInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteWorkgroup struct { +} + +func (*validateOpDeleteWorkgroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteWorkgroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteWorkgroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteWorkgroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetCredentials struct { +} + +func (*validateOpGetCredentials) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetCredentials) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetCredentialsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetCredentialsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetEndpointAccess struct { +} + +func (*validateOpGetEndpointAccess) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetEndpointAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetEndpointAccessInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetEndpointAccessInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetNamespace struct { +} + +func (*validateOpGetNamespace) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetNamespace) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetNamespaceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetNamespaceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetRecoveryPoint struct { +} + +func (*validateOpGetRecoveryPoint) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetRecoveryPoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetRecoveryPointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetRecoveryPointInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetResourcePolicy struct { +} + +func (*validateOpGetResourcePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetResourcePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetUsageLimit struct { +} + +func (*validateOpGetUsageLimit) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetUsageLimit) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetUsageLimitInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetUsageLimitInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetWorkgroup struct { +} + +func (*validateOpGetWorkgroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetWorkgroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetWorkgroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetWorkgroupInput(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 validateOpPutResourcePolicy struct { +} + +func (*validateOpPutResourcePolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutResourcePolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutResourcePolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutResourcePolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRestoreFromRecoveryPoint struct { +} + +func (*validateOpRestoreFromRecoveryPoint) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRestoreFromRecoveryPoint) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RestoreFromRecoveryPointInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRestoreFromRecoveryPointInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRestoreFromSnapshot struct { +} + +func (*validateOpRestoreFromSnapshot) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRestoreFromSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RestoreFromSnapshotInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRestoreFromSnapshotInput(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 validateOpUpdateEndpointAccess struct { +} + +func (*validateOpUpdateEndpointAccess) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateEndpointAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateEndpointAccessInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateEndpointAccessInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateNamespace struct { +} + +func (*validateOpUpdateNamespace) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateNamespace) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateNamespaceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateNamespaceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateSnapshot struct { +} + +func (*validateOpUpdateSnapshot) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateSnapshot) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateSnapshotInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateSnapshotInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateUsageLimit struct { +} + +func (*validateOpUpdateUsageLimit) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateUsageLimit) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateUsageLimitInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateUsageLimitInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateWorkgroup struct { +} + +func (*validateOpUpdateWorkgroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateWorkgroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateWorkgroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateWorkgroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpConvertRecoveryPointToSnapshotValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpConvertRecoveryPointToSnapshot{}, middleware.After) +} + +func addOpCreateEndpointAccessValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateEndpointAccess{}, middleware.After) +} + +func addOpCreateNamespaceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateNamespace{}, middleware.After) +} + +func addOpCreateSnapshotValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateSnapshot{}, middleware.After) +} + +func addOpCreateUsageLimitValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateUsageLimit{}, middleware.After) +} + +func addOpCreateWorkgroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateWorkgroup{}, middleware.After) +} + +func addOpDeleteEndpointAccessValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteEndpointAccess{}, middleware.After) +} + +func addOpDeleteNamespaceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteNamespace{}, middleware.After) +} + +func addOpDeleteResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteResourcePolicy{}, middleware.After) +} + +func addOpDeleteSnapshotValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteSnapshot{}, middleware.After) +} + +func addOpDeleteUsageLimitValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteUsageLimit{}, middleware.After) +} + +func addOpDeleteWorkgroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteWorkgroup{}, middleware.After) +} + +func addOpGetCredentialsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetCredentials{}, middleware.After) +} + +func addOpGetEndpointAccessValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetEndpointAccess{}, middleware.After) +} + +func addOpGetNamespaceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetNamespace{}, middleware.After) +} + +func addOpGetRecoveryPointValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetRecoveryPoint{}, middleware.After) +} + +func addOpGetResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetResourcePolicy{}, middleware.After) +} + +func addOpGetUsageLimitValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetUsageLimit{}, middleware.After) +} + +func addOpGetWorkgroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetWorkgroup{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpPutResourcePolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutResourcePolicy{}, middleware.After) +} + +func addOpRestoreFromRecoveryPointValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRestoreFromRecoveryPoint{}, middleware.After) +} + +func addOpRestoreFromSnapshotValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRestoreFromSnapshot{}, 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 addOpUpdateEndpointAccessValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateEndpointAccess{}, middleware.After) +} + +func addOpUpdateNamespaceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateNamespace{}, middleware.After) +} + +func addOpUpdateSnapshotValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateSnapshot{}, middleware.After) +} + +func addOpUpdateUsageLimitValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateUsageLimit{}, middleware.After) +} + +func addOpUpdateWorkgroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateWorkgroup{}, 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 validateOpConvertRecoveryPointToSnapshotInput(v *ConvertRecoveryPointToSnapshotInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ConvertRecoveryPointToSnapshotInput"} + if v.RecoveryPointId == nil { + invalidParams.Add(smithy.NewErrParamRequired("RecoveryPointId")) + } + if v.SnapshotName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SnapshotName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateEndpointAccessInput(v *CreateEndpointAccessInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateEndpointAccessInput"} + if v.EndpointName == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndpointName")) + } + if v.SubnetIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("SubnetIds")) + } + if v.WorkgroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkgroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateNamespaceInput(v *CreateNamespaceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateNamespaceInput"} + if v.NamespaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("NamespaceName")) + } + 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 validateOpCreateSnapshotInput(v *CreateSnapshotInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateSnapshotInput"} + if v.NamespaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("NamespaceName")) + } + if v.SnapshotName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SnapshotName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateUsageLimitInput(v *CreateUsageLimitInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateUsageLimitInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if len(v.UsageType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("UsageType")) + } + if v.Amount == nil { + invalidParams.Add(smithy.NewErrParamRequired("Amount")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateWorkgroupInput(v *CreateWorkgroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateWorkgroupInput"} + if v.WorkgroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkgroupName")) + } + if v.NamespaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("NamespaceName")) + } + 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 validateOpDeleteEndpointAccessInput(v *DeleteEndpointAccessInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteEndpointAccessInput"} + if v.EndpointName == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndpointName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteNamespaceInput(v *DeleteNamespaceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteNamespaceInput"} + if v.NamespaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("NamespaceName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteResourcePolicyInput(v *DeleteResourcePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteResourcePolicyInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteSnapshotInput(v *DeleteSnapshotInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteSnapshotInput"} + if v.SnapshotName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SnapshotName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteUsageLimitInput(v *DeleteUsageLimitInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteUsageLimitInput"} + if v.UsageLimitId == nil { + invalidParams.Add(smithy.NewErrParamRequired("UsageLimitId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteWorkgroupInput(v *DeleteWorkgroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteWorkgroupInput"} + if v.WorkgroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkgroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetCredentialsInput(v *GetCredentialsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetCredentialsInput"} + if v.WorkgroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkgroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetEndpointAccessInput(v *GetEndpointAccessInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetEndpointAccessInput"} + if v.EndpointName == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndpointName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetNamespaceInput(v *GetNamespaceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetNamespaceInput"} + if v.NamespaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("NamespaceName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetRecoveryPointInput(v *GetRecoveryPointInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetRecoveryPointInput"} + if v.RecoveryPointId == nil { + invalidParams.Add(smithy.NewErrParamRequired("RecoveryPointId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetResourcePolicyInput(v *GetResourcePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetResourcePolicyInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetUsageLimitInput(v *GetUsageLimitInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetUsageLimitInput"} + if v.UsageLimitId == nil { + invalidParams.Add(smithy.NewErrParamRequired("UsageLimitId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetWorkgroupInput(v *GetWorkgroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetWorkgroupInput"} + if v.WorkgroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkgroupName")) + } + 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 validateOpPutResourcePolicyInput(v *PutResourcePolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutResourcePolicyInput"} + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.Policy == nil { + invalidParams.Add(smithy.NewErrParamRequired("Policy")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRestoreFromRecoveryPointInput(v *RestoreFromRecoveryPointInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RestoreFromRecoveryPointInput"} + if v.RecoveryPointId == nil { + invalidParams.Add(smithy.NewErrParamRequired("RecoveryPointId")) + } + if v.NamespaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("NamespaceName")) + } + if v.WorkgroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkgroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRestoreFromSnapshotInput(v *RestoreFromSnapshotInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RestoreFromSnapshotInput"} + if v.NamespaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("NamespaceName")) + } + if v.WorkgroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkgroupName")) + } + 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 validateOpUpdateEndpointAccessInput(v *UpdateEndpointAccessInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateEndpointAccessInput"} + if v.EndpointName == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndpointName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateNamespaceInput(v *UpdateNamespaceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateNamespaceInput"} + if v.NamespaceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("NamespaceName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateSnapshotInput(v *UpdateSnapshotInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateSnapshotInput"} + if v.SnapshotName == nil { + invalidParams.Add(smithy.NewErrParamRequired("SnapshotName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateUsageLimitInput(v *UpdateUsageLimitInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateUsageLimitInput"} + if v.UsageLimitId == nil { + invalidParams.Add(smithy.NewErrParamRequired("UsageLimitId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateWorkgroupInput(v *UpdateWorkgroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateWorkgroupInput"} + if v.WorkgroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("WorkgroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/secretsmanager/api_op_ListSecrets.go b/service/secretsmanager/api_op_ListSecrets.go index 16e70b3f10d..cefd7a24d3a 100644 --- a/service/secretsmanager/api_op_ListSecrets.go +++ b/service/secretsmanager/api_op_ListSecrets.go @@ -14,10 +14,12 @@ import ( // Lists the secrets that are stored by Secrets Manager in the Amazon Web Services // account, not including secrets that are marked for deletion. To see secrets -// marked for deletion, use the Secrets Manager console. To list the versions of a -// secret, use ListSecretVersionIds. To get the secret value from SecretString or -// SecretBinary, call GetSecretValue. For information about finding secrets in the -// console, see Find secrets in Secrets Manager +// marked for deletion, use the Secrets Manager console. ListSecrets is eventually +// consistent, however it might not reflect changes from the last five minutes. To +// get the latest information for a specific secret, use DescribeSecret. To list +// the versions of a secret, use ListSecretVersionIds. To get the secret value from +// SecretString or SecretBinary, call GetSecretValue. For information about finding +// secrets in the console, see Find secrets in Secrets Manager // (https://docs.aws.amazon.com/secretsmanager/latest/userguide/manage_search-secret.html). // Required permissions: secretsmanager:ListSecrets. For more information, see IAM // policy actions for Secrets Manager diff --git a/service/secretsmanager/api_op_PutSecretValue.go b/service/secretsmanager/api_op_PutSecretValue.go index 53ec3d0150a..ef00b87dcc1 100644 --- a/service/secretsmanager/api_op_PutSecretValue.go +++ b/service/secretsmanager/api_op_PutSecretValue.go @@ -26,10 +26,10 @@ import ( // automatically attaches the staging label AWSCURRENT to it . If this operation // moves the staging label AWSCURRENT from another version to this version, then // Secrets Manager also automatically moves the staging label AWSPREVIOUS to the -// version that AWSCURRENT was removed from. This operation is idempotent. If a -// version with a VersionId with the same value as the ClientRequestToken parameter -// already exists, and you specify the same secret data, the operation succeeds but -// does nothing. However, if the secret data is different, then the operation fails +// version that AWSCURRENT was removed from. This operation is idempotent. If you +// call this operation with a ClientRequestToken that matches an existing version's +// VersionId, and you specify the same secret data, the operation succeeds but does +// nothing. However, if the secret data is different, then the operation fails // because you can't modify an existing version; you can only create new ones. // Required permissions: secretsmanager:PutSecretValue. For more information, see // IAM policy actions for Secrets Manager diff --git a/service/secretsmanager/api_op_UpdateSecret.go b/service/secretsmanager/api_op_UpdateSecret.go index b35342e47bd..cf026e5e424 100644 --- a/service/secretsmanager/api_op_UpdateSecret.go +++ b/service/secretsmanager/api_op_UpdateSecret.go @@ -22,10 +22,10 @@ import ( // more versions than Secrets Manager removes, and you will reach the quota for // secret versions. If you include SecretString or SecretBinary to create a new // secret version, Secrets Manager automatically attaches the staging label -// AWSCURRENT to the new version. If you call this operation with a VersionId that -// matches an existing version's ClientRequestToken, the operation results in an -// error. You can't modify an existing version, you can only create a new version. -// To remove a version, remove all staging labels from it. See +// AWSCURRENT to the new version. If you call this operation with a +// ClientRequestToken that matches an existing version's VersionId, the operation +// results in an error. You can't modify an existing version, you can only create a +// new version. To remove a version, remove all staging labels from it. See // UpdateSecretVersionStage. If you don't specify an KMS encryption key, Secrets // Manager uses the Amazon Web Services managed key aws/secretsmanager. If this key // doesn't already exist in your account, then Secrets Manager creates it for you diff --git a/service/securityhub/deserializers.go b/service/securityhub/deserializers.go index 677c06cd7cc..1e31f986327 100644 --- a/service/securityhub/deserializers.go +++ b/service/securityhub/deserializers.go @@ -11622,6 +11622,292 @@ func awsRestjson1_deserializeDocumentAwsCertificateManagerCertificateResourceRec return nil } +func awsRestjson1_deserializeDocumentAwsCloudFormationStackDetails(v **types.AwsCloudFormationStackDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsCloudFormationStackDetails + if *v == nil { + sv = &types.AwsCloudFormationStackDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Capabilities": + if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Capabilities, value); err != nil { + return err + } + + case "CreationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.CreationTime = 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 "DisableRollback": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.DisableRollback = jtv + } + + case "DriftInformation": + if err := awsRestjson1_deserializeDocumentAwsCloudFormationStackDriftInformationDetails(&sv.DriftInformation, value); err != nil { + return err + } + + case "EnableTerminationProtection": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.EnableTerminationProtection = jtv + } + + case "LastUpdatedTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.LastUpdatedTime = ptr.String(jtv) + } + + case "NotificationArns": + if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.NotificationArns, value); err != nil { + return err + } + + case "Outputs": + if err := awsRestjson1_deserializeDocumentAwsCloudFormationStackOutputsList(&sv.Outputs, value); err != nil { + return err + } + + case "RoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RoleArn = ptr.String(jtv) + } + + case "StackId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.StackId = ptr.String(jtv) + } + + case "StackName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.StackName = ptr.String(jtv) + } + + case "StackStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.StackStatus = ptr.String(jtv) + } + + case "StackStatusReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.StackStatusReason = ptr.String(jtv) + } + + case "TimeoutInMinutes": + 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.TimeoutInMinutes = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsCloudFormationStackDriftInformationDetails(v **types.AwsCloudFormationStackDriftInformationDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsCloudFormationStackDriftInformationDetails + if *v == nil { + sv = &types.AwsCloudFormationStackDriftInformationDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "StackDriftStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.StackDriftStatus = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsCloudFormationStackOutputsDetails(v **types.AwsCloudFormationStackOutputsDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsCloudFormationStackOutputsDetails + if *v == nil { + sv = &types.AwsCloudFormationStackOutputsDetails{} + } 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 NonEmptyString to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "OutputKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.OutputKey = ptr.String(jtv) + } + + case "OutputValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.OutputValue = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsCloudFormationStackOutputsList(v *[]types.AwsCloudFormationStackOutputsDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.AwsCloudFormationStackOutputsDetails + if *v == nil { + cv = []types.AwsCloudFormationStackOutputsDetails{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AwsCloudFormationStackOutputsDetails + destAddr := &col + if err := awsRestjson1_deserializeDocumentAwsCloudFormationStackOutputsDetails(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionCacheBehavior(v **types.AwsCloudFrontDistributionCacheBehavior, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11954,6 +12240,103 @@ func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionLogging(v **types. return nil } +func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginCustomOriginConfig(v **types.AwsCloudFrontDistributionOriginCustomOriginConfig, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsCloudFrontDistributionOriginCustomOriginConfig + if *v == nil { + sv = &types.AwsCloudFrontDistributionOriginCustomOriginConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "HttpPort": + 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.HttpPort = int32(i64) + } + + case "HttpsPort": + 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.HttpsPort = int32(i64) + } + + case "OriginKeepaliveTimeout": + 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.OriginKeepaliveTimeout = int32(i64) + } + + case "OriginProtocolPolicy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.OriginProtocolPolicy = ptr.String(jtv) + } + + case "OriginReadTimeout": + 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.OriginReadTimeout = int32(i64) + } + + case "OriginSslProtocols": + if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginSslProtocols(&sv.OriginSslProtocols, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginGroup(v **types.AwsCloudFrontDistributionOriginGroup, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12207,6 +12590,11 @@ func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginItem(v **typ for key, value := range shape { switch key { + case "CustomOriginConfig": + if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginCustomOriginConfig(&sv.CustomOriginConfig, value); err != nil { + return err + } + case "DomainName": if value != nil { jtv, ok := value.(string) @@ -12358,6 +12746,55 @@ func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginS3OriginConf return nil } +func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionOriginSslProtocols(v **types.AwsCloudFrontDistributionOriginSslProtocols, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsCloudFrontDistributionOriginSslProtocols + if *v == nil { + sv = &types.AwsCloudFrontDistributionOriginSslProtocols{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Items": + if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Items, value); err != nil { + return err + } + + case "Quantity": + 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.Quantity = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentAwsCloudFrontDistributionViewerCertificate(v **types.AwsCloudFrontDistributionViewerCertificate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12618,6 +13055,339 @@ func awsRestjson1_deserializeDocumentAwsCloudTrailTrailDetails(v **types.AwsClou return nil } +func awsRestjson1_deserializeDocumentAwsCloudWatchAlarmDetails(v **types.AwsCloudWatchAlarmDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsCloudWatchAlarmDetails + if *v == nil { + sv = &types.AwsCloudWatchAlarmDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ActionsEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.ActionsEnabled = jtv + } + + case "AlarmActions": + if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.AlarmActions, value); err != nil { + return err + } + + case "AlarmArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.AlarmArn = ptr.String(jtv) + } + + case "AlarmConfigurationUpdatedTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.AlarmConfigurationUpdatedTimestamp = ptr.String(jtv) + } + + case "AlarmDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.AlarmDescription = ptr.String(jtv) + } + + case "AlarmName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.AlarmName = ptr.String(jtv) + } + + case "ComparisonOperator": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ComparisonOperator = ptr.String(jtv) + } + + case "DatapointsToAlarm": + 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.DatapointsToAlarm = int32(i64) + } + + case "Dimensions": + if err := awsRestjson1_deserializeDocumentAwsCloudWatchAlarmDimensionsList(&sv.Dimensions, value); err != nil { + return err + } + + case "EvaluateLowSampleCountPercentile": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.EvaluateLowSampleCountPercentile = ptr.String(jtv) + } + + case "EvaluationPeriods": + 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.EvaluationPeriods = int32(i64) + } + + case "ExtendedStatistic": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ExtendedStatistic = ptr.String(jtv) + } + + case "InsufficientDataActions": + if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.InsufficientDataActions, value); err != nil { + return err + } + + case "MetricName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.MetricName = ptr.String(jtv) + } + + case "Namespace": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Namespace = ptr.String(jtv) + } + + case "OkActions": + if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.OkActions, value); err != nil { + return err + } + + case "Period": + 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.Period = int32(i64) + } + + case "Statistic": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Statistic = ptr.String(jtv) + } + + case "Threshold": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Threshold = f64 + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Threshold = f64 + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "ThresholdMetricId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ThresholdMetricId = ptr.String(jtv) + } + + case "TreatMissingData": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.TreatMissingData = ptr.String(jtv) + } + + case "Unit": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Unit = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsCloudWatchAlarmDimensionsDetails(v **types.AwsCloudWatchAlarmDimensionsDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsCloudWatchAlarmDimensionsDetails + if *v == nil { + sv = &types.AwsCloudWatchAlarmDimensionsDetails{} + } 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 NonEmptyString to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsCloudWatchAlarmDimensionsList(v *[]types.AwsCloudWatchAlarmDimensionsDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.AwsCloudWatchAlarmDimensionsDetails + if *v == nil { + cv = []types.AwsCloudWatchAlarmDimensionsDetails{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AwsCloudWatchAlarmDimensionsDetails + destAddr := &col + if err := awsRestjson1_deserializeDocumentAwsCloudWatchAlarmDimensionsDetails(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentAwsCodeBuildProjectArtifactsDetails(v **types.AwsCodeBuildProjectArtifactsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14780,6 +15550,11 @@ func awsRestjson1_deserializeDocumentAwsEc2InstanceDetails(v **types.AwsEc2Insta sv.LaunchedAt = ptr.String(jtv) } + case "MetadataOptions": + if err := awsRestjson1_deserializeDocumentAwsEc2InstanceMetadataOptions(&sv.MetadataOptions, value); err != nil { + return err + } + case "NetworkInterfaces": if err := awsRestjson1_deserializeDocumentAwsEc2InstanceNetworkInterfacesList(&sv.NetworkInterfaces, value); err != nil { return err @@ -14803,6 +15578,15 @@ func awsRestjson1_deserializeDocumentAwsEc2InstanceDetails(v **types.AwsEc2Insta sv.Type = ptr.String(jtv) } + case "VirtualizationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.VirtualizationType = ptr.String(jtv) + } + case "VpcId": if value != nil { jtv, ok := value.(string) @@ -14821,6 +15605,86 @@ func awsRestjson1_deserializeDocumentAwsEc2InstanceDetails(v **types.AwsEc2Insta return nil } +func awsRestjson1_deserializeDocumentAwsEc2InstanceMetadataOptions(v **types.AwsEc2InstanceMetadataOptions, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsEc2InstanceMetadataOptions + if *v == nil { + sv = &types.AwsEc2InstanceMetadataOptions{} + } 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 NonEmptyString to be of type string, got %T instead", value) + } + sv.HttpEndpoint = ptr.String(jtv) + } + + case "HttpProtocolIpv6": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.HttpProtocolIpv6 = ptr.String(jtv) + } + + case "HttpPutResponseHopLimit": + 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.HttpPutResponseHopLimit = int32(i64) + } + + case "HttpTokens": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.HttpTokens = ptr.String(jtv) + } + + case "InstanceMetadataTags": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.InstanceMetadataTags = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentAwsEc2InstanceNetworkInterfacesDetails(v **types.AwsEc2InstanceNetworkInterfacesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16308,6 +17172,145 @@ func awsRestjson1_deserializeDocumentAwsEc2SubnetDetails(v **types.AwsEc2SubnetD return nil } +func awsRestjson1_deserializeDocumentAwsEc2TransitGatewayDetails(v **types.AwsEc2TransitGatewayDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsEc2TransitGatewayDetails + if *v == nil { + sv = &types.AwsEc2TransitGatewayDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AmazonSideAsn": + 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.AmazonSideAsn = int32(i64) + } + + case "AssociationDefaultRouteTableId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.AssociationDefaultRouteTableId = ptr.String(jtv) + } + + case "AutoAcceptSharedAttachments": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.AutoAcceptSharedAttachments = ptr.String(jtv) + } + + case "DefaultRouteTableAssociation": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.DefaultRouteTableAssociation = ptr.String(jtv) + } + + case "DefaultRouteTablePropagation": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.DefaultRouteTablePropagation = 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 "DnsSupport": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.DnsSupport = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "MulticastSupport": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.MulticastSupport = ptr.String(jtv) + } + + case "PropagationDefaultRouteTableId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.PropagationDefaultRouteTableId = ptr.String(jtv) + } + + case "TransitGatewayCidrBlocks": + if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.TransitGatewayCidrBlocks, value); err != nil { + return err + } + + case "VpnEcmpSupport": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.VpnEcmpSupport = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentAwsEc2VolumeAttachment(v **types.AwsEc2VolumeAttachment, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16445,6 +17448,15 @@ func awsRestjson1_deserializeDocumentAwsEc2VolumeDetails(v **types.AwsEc2VolumeD sv.CreateTime = ptr.String(jtv) } + case "DeviceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.DeviceName = ptr.String(jtv) + } + case "Encrypted": if value != nil { jtv, ok := value.(bool) @@ -16494,6 +17506,33 @@ func awsRestjson1_deserializeDocumentAwsEc2VolumeDetails(v **types.AwsEc2VolumeD sv.Status = ptr.String(jtv) } + case "VolumeId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.VolumeId = ptr.String(jtv) + } + + case "VolumeScanStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.VolumeScanStatus = ptr.String(jtv) + } + + case "VolumeType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.VolumeType = ptr.String(jtv) + } + default: _, _ = key, value @@ -16746,6 +17785,201 @@ func awsRestjson1_deserializeDocumentAwsEc2VpcEndpointServiceServiceTypeList(v * return nil } +func awsRestjson1_deserializeDocumentAwsEc2VpcPeeringConnectionDetails(v **types.AwsEc2VpcPeeringConnectionDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsEc2VpcPeeringConnectionDetails + if *v == nil { + sv = &types.AwsEc2VpcPeeringConnectionDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AccepterVpcInfo": + if err := awsRestjson1_deserializeDocumentAwsEc2VpcPeeringConnectionVpcInfoDetails(&sv.AccepterVpcInfo, value); err != nil { + return err + } + + case "ExpirationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ExpirationTime = ptr.String(jtv) + } + + case "RequesterVpcInfo": + if err := awsRestjson1_deserializeDocumentAwsEc2VpcPeeringConnectionVpcInfoDetails(&sv.RequesterVpcInfo, value); err != nil { + return err + } + + case "Status": + if err := awsRestjson1_deserializeDocumentAwsEc2VpcPeeringConnectionStatusDetails(&sv.Status, value); err != nil { + return err + } + + case "VpcPeeringConnectionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.VpcPeeringConnectionId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsEc2VpcPeeringConnectionStatusDetails(v **types.AwsEc2VpcPeeringConnectionStatusDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsEc2VpcPeeringConnectionStatusDetails + if *v == nil { + sv = &types.AwsEc2VpcPeeringConnectionStatusDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Code = ptr.String(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsEc2VpcPeeringConnectionVpcInfoDetails(v **types.AwsEc2VpcPeeringConnectionVpcInfoDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsEc2VpcPeeringConnectionVpcInfoDetails + if *v == nil { + sv = &types.AwsEc2VpcPeeringConnectionVpcInfoDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CidrBlock": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.CidrBlock = ptr.String(jtv) + } + + case "CidrBlockSet": + if err := awsRestjson1_deserializeDocumentVpcInfoCidrBlockSetList(&sv.CidrBlockSet, value); err != nil { + return err + } + + case "Ipv6CidrBlockSet": + if err := awsRestjson1_deserializeDocumentVpcInfoIpv6CidrBlockSetList(&sv.Ipv6CidrBlockSet, value); err != nil { + return err + } + + case "OwnerId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.OwnerId = ptr.String(jtv) + } + + case "PeeringOptions": + if err := awsRestjson1_deserializeDocumentVpcInfoPeeringOptionsDetails(&sv.PeeringOptions, value); err != nil { + return err + } + + 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 "VpcId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.VpcId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentAwsEc2VpnConnectionDetails(v **types.AwsEc2VpnConnectionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -17938,11 +19172,42 @@ func awsRestjson1_deserializeDocumentAwsEcsClusterDetails(v **types.AwsEcsCluste for key, value := range shape { switch key { + case "ActiveServicesCount": + 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.ActiveServicesCount = int32(i64) + } + case "CapacityProviders": if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.CapacityProviders, value); err != nil { return err } + case "ClusterArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ClusterArn = ptr.String(jtv) + } + + case "ClusterName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ClusterName = ptr.String(jtv) + } + case "ClusterSettings": if err := awsRestjson1_deserializeDocumentAwsEcsClusterClusterSettingsList(&sv.ClusterSettings, value); err != nil { return err @@ -17958,6 +19223,104 @@ func awsRestjson1_deserializeDocumentAwsEcsClusterDetails(v **types.AwsEcsCluste return err } + case "RegisteredContainerInstancesCount": + 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.RegisteredContainerInstancesCount = int32(i64) + } + + case "RunningTasksCount": + 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.RunningTasksCount = int32(i64) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Status = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsEcsContainerDetails(v **types.AwsEcsContainerDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsEcsContainerDetails + if *v == nil { + sv = &types.AwsEcsContainerDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + 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 "MountPoints": + if err := awsRestjson1_deserializeDocumentAwsMountPointList(&sv.MountPoints, 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) + } + + case "Privileged": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Privileged = jtv + } + default: _, _ = key, value @@ -17967,6 +19330,40 @@ func awsRestjson1_deserializeDocumentAwsEcsClusterDetails(v **types.AwsEcsCluste return nil } +func awsRestjson1_deserializeDocumentAwsEcsContainerDetailsList(v *[]types.AwsEcsContainerDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.AwsEcsContainerDetails + if *v == nil { + cv = []types.AwsEcsContainerDetails{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AwsEcsContainerDetails + destAddr := &col + if err := awsRestjson1_deserializeDocumentAwsEcsContainerDetails(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentAwsEcsServiceCapacityProviderStrategyDetails(v **types.AwsEcsServiceCapacityProviderStrategyDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -21568,7 +22965,7 @@ func awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionVolumesList(v *[]types. return nil } -func awsRestjson1_deserializeDocumentAwsEksClusterDetails(v **types.AwsEksClusterDetails, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsEcsTaskDetails(v **types.AwsEcsTaskDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -21581,77 +22978,72 @@ func awsRestjson1_deserializeDocumentAwsEksClusterDetails(v **types.AwsEksCluste return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AwsEksClusterDetails + var sv *types.AwsEcsTaskDetails if *v == nil { - sv = &types.AwsEksClusterDetails{} + sv = &types.AwsEcsTaskDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "Arn": + case "ClusterArn": 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) + sv.ClusterArn = ptr.String(jtv) } - case "CertificateAuthorityData": + case "Containers": + if err := awsRestjson1_deserializeDocumentAwsEcsContainerDetailsList(&sv.Containers, value); err != nil { + return err + } + + case "CreatedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.CertificateAuthorityData = ptr.String(jtv) + sv.CreatedAt = ptr.String(jtv) } - case "ClusterStatus": + case "Group": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.ClusterStatus = ptr.String(jtv) + sv.Group = ptr.String(jtv) } - case "Endpoint": + case "StartedAt": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Endpoint = ptr.String(jtv) + sv.StartedAt = ptr.String(jtv) } - case "Logging": - if err := awsRestjson1_deserializeDocumentAwsEksClusterLoggingDetails(&sv.Logging, value); err != nil { - return err - } - - case "Name": + case "StartedBy": 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 "ResourcesVpcConfig": - if err := awsRestjson1_deserializeDocumentAwsEksClusterResourcesVpcConfigDetails(&sv.ResourcesVpcConfig, value); err != nil { - return err + sv.StartedBy = ptr.String(jtv) } - case "RoleArn": + case "TaskDefinitionArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.RoleArn = ptr.String(jtv) + sv.TaskDefinitionArn = ptr.String(jtv) } case "Version": @@ -21663,6 +23055,11 @@ func awsRestjson1_deserializeDocumentAwsEksClusterDetails(v **types.AwsEksCluste sv.Version = ptr.String(jtv) } + case "Volumes": + if err := awsRestjson1_deserializeDocumentAwsEcsTaskVolumeDetailsList(&sv.Volumes, value); err != nil { + return err + } + default: _, _ = key, value @@ -21672,7 +23069,7 @@ func awsRestjson1_deserializeDocumentAwsEksClusterDetails(v **types.AwsEksCluste return nil } -func awsRestjson1_deserializeDocumentAwsEksClusterLoggingClusterLoggingDetails(v **types.AwsEksClusterLoggingClusterLoggingDetails, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsEcsTaskVolumeDetails(v **types.AwsEcsTaskVolumeDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -21685,27 +23082,27 @@ func awsRestjson1_deserializeDocumentAwsEksClusterLoggingClusterLoggingDetails(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AwsEksClusterLoggingClusterLoggingDetails + var sv *types.AwsEcsTaskVolumeDetails if *v == nil { - sv = &types.AwsEksClusterLoggingClusterLoggingDetails{} + sv = &types.AwsEcsTaskVolumeDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "Enabled": + case "Host": + if err := awsRestjson1_deserializeDocumentAwsEcsTaskVolumeHostDetails(&sv.Host, value); err != nil { + return err + } + + case "Name": 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 NonEmptyString to be of type string, got %T instead", value) } - sv.Enabled = jtv - } - - case "Types": - if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Types, value); err != nil { - return err + sv.Name = ptr.String(jtv) } default: @@ -21717,7 +23114,7 @@ func awsRestjson1_deserializeDocumentAwsEksClusterLoggingClusterLoggingDetails(v return nil } -func awsRestjson1_deserializeDocumentAwsEksClusterLoggingClusterLoggingList(v *[]types.AwsEksClusterLoggingClusterLoggingDetails, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsEcsTaskVolumeDetailsList(v *[]types.AwsEcsTaskVolumeDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -21730,17 +23127,17 @@ func awsRestjson1_deserializeDocumentAwsEksClusterLoggingClusterLoggingList(v *[ return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AwsEksClusterLoggingClusterLoggingDetails + var cv []types.AwsEcsTaskVolumeDetails if *v == nil { - cv = []types.AwsEksClusterLoggingClusterLoggingDetails{} + cv = []types.AwsEcsTaskVolumeDetails{} } else { cv = *v } for _, value := range shape { - var col types.AwsEksClusterLoggingClusterLoggingDetails + var col types.AwsEcsTaskVolumeDetails destAddr := &col - if err := awsRestjson1_deserializeDocumentAwsEksClusterLoggingClusterLoggingDetails(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentAwsEcsTaskVolumeDetails(&destAddr, value); err != nil { return err } col = *destAddr @@ -21751,7 +23148,7 @@ func awsRestjson1_deserializeDocumentAwsEksClusterLoggingClusterLoggingList(v *[ return nil } -func awsRestjson1_deserializeDocumentAwsEksClusterLoggingDetails(v **types.AwsEksClusterLoggingDetails, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsEcsTaskVolumeHostDetails(v **types.AwsEcsTaskVolumeHostDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -21764,18 +23161,22 @@ func awsRestjson1_deserializeDocumentAwsEksClusterLoggingDetails(v **types.AwsEk return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AwsEksClusterLoggingDetails + var sv *types.AwsEcsTaskVolumeHostDetails if *v == nil { - sv = &types.AwsEksClusterLoggingDetails{} + sv = &types.AwsEcsTaskVolumeHostDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "ClusterLogging": - if err := awsRestjson1_deserializeDocumentAwsEksClusterLoggingClusterLoggingList(&sv.ClusterLogging, value); err != nil { - return err + case "SourcePath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.SourcePath = ptr.String(jtv) } default: @@ -21787,7 +23188,7 @@ func awsRestjson1_deserializeDocumentAwsEksClusterLoggingDetails(v **types.AwsEk return nil } -func awsRestjson1_deserializeDocumentAwsEksClusterResourcesVpcConfigDetails(v **types.AwsEksClusterResourcesVpcConfigDetails, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsEfsAccessPointDetails(v **types.AwsEfsAccessPointDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -21800,22 +23201,58 @@ func awsRestjson1_deserializeDocumentAwsEksClusterResourcesVpcConfigDetails(v ** return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AwsEksClusterResourcesVpcConfigDetails + var sv *types.AwsEfsAccessPointDetails if *v == nil { - sv = &types.AwsEksClusterResourcesVpcConfigDetails{} + sv = &types.AwsEfsAccessPointDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "SecurityGroupIds": - if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SecurityGroupIds, value); err != nil { + case "AccessPointId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.AccessPointId = ptr.String(jtv) + } + + 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 "ClientToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ClientToken = ptr.String(jtv) + } + + case "FileSystemId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.FileSystemId = ptr.String(jtv) + } + + case "PosixUser": + if err := awsRestjson1_deserializeDocumentAwsEfsAccessPointPosixUserDetails(&sv.PosixUser, value); err != nil { return err } - case "SubnetIds": - if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SubnetIds, value); err != nil { + case "RootDirectory": + if err := awsRestjson1_deserializeDocumentAwsEfsAccessPointRootDirectoryDetails(&sv.RootDirectory, value); err != nil { return err } @@ -21828,7 +23265,7 @@ func awsRestjson1_deserializeDocumentAwsEksClusterResourcesVpcConfigDetails(v ** return nil } -func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentDetails(v **types.AwsElasticBeanstalkEnvironmentDetails, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsEfsAccessPointPosixUserDetails(v **types.AwsEfsAccessPointPosixUserDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -21841,145 +23278,243 @@ func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentDetails(v **t return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AwsElasticBeanstalkEnvironmentDetails + var sv *types.AwsEfsAccessPointPosixUserDetails if *v == nil { - sv = &types.AwsElasticBeanstalkEnvironmentDetails{} + sv = &types.AwsEfsAccessPointPosixUserDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "ApplicationName": + case "Gid": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.ApplicationName = ptr.String(jtv) + sv.Gid = ptr.String(jtv) } - case "Cname": + case "SecondaryGids": + if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SecondaryGids, value); err != nil { + return err + } + + case "Uid": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Cname = ptr.String(jtv) + sv.Uid = ptr.String(jtv) } - case "DateCreated": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsEfsAccessPointRootDirectoryCreationInfoDetails(v **types.AwsEfsAccessPointRootDirectoryCreationInfoDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsEfsAccessPointRootDirectoryCreationInfoDetails + if *v == nil { + sv = &types.AwsEfsAccessPointRootDirectoryCreationInfoDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "OwnerGid": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.DateCreated = ptr.String(jtv) + sv.OwnerGid = ptr.String(jtv) } - case "DateUpdated": + case "OwnerUid": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.DateUpdated = ptr.String(jtv) + sv.OwnerUid = ptr.String(jtv) } - case "Description": + case "Permissions": 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.Permissions = ptr.String(jtv) } - case "EndpointUrl": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsEfsAccessPointRootDirectoryDetails(v **types.AwsEfsAccessPointRootDirectoryDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsEfsAccessPointRootDirectoryDetails + if *v == nil { + sv = &types.AwsEfsAccessPointRootDirectoryDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreationInfo": + if err := awsRestjson1_deserializeDocumentAwsEfsAccessPointRootDirectoryCreationInfoDetails(&sv.CreationInfo, value); err != nil { + return err + } + + case "Path": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.EndpointUrl = ptr.String(jtv) + sv.Path = ptr.String(jtv) } - case "EnvironmentArn": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsEksClusterDetails(v **types.AwsEksClusterDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsEksClusterDetails + if *v == nil { + sv = &types.AwsEksClusterDetails{} + } 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.EnvironmentArn = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } - case "EnvironmentId": + case "CertificateAuthorityData": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.EnvironmentId = ptr.String(jtv) - } - - case "EnvironmentLinks": - if err := awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentEnvironmentLinks(&sv.EnvironmentLinks, value); err != nil { - return err + sv.CertificateAuthorityData = ptr.String(jtv) } - case "EnvironmentName": + case "ClusterStatus": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.EnvironmentName = ptr.String(jtv) - } - - case "OptionSettings": - if err := awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentOptionSettings(&sv.OptionSettings, value); err != nil { - return err + sv.ClusterStatus = ptr.String(jtv) } - case "PlatformArn": + case "Endpoint": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.PlatformArn = ptr.String(jtv) + sv.Endpoint = ptr.String(jtv) } - case "SolutionStackName": + case "Logging": + if err := awsRestjson1_deserializeDocumentAwsEksClusterLoggingDetails(&sv.Logging, 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.SolutionStackName = ptr.String(jtv) + sv.Name = ptr.String(jtv) } - case "Status": + case "ResourcesVpcConfig": + if err := awsRestjson1_deserializeDocumentAwsEksClusterResourcesVpcConfigDetails(&sv.ResourcesVpcConfig, value); err != nil { + return err + } + + case "RoleArn": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Status = ptr.String(jtv) - } - - case "Tier": - if err := awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentTier(&sv.Tier, value); err != nil { - return err + sv.RoleArn = ptr.String(jtv) } - case "VersionLabel": + case "Version": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.VersionLabel = ptr.String(jtv) + sv.Version = ptr.String(jtv) } default: @@ -21991,7 +23526,7 @@ func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentDetails(v **t return nil } -func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentEnvironmentLink(v **types.AwsElasticBeanstalkEnvironmentEnvironmentLink, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsEksClusterLoggingClusterLoggingDetails(v **types.AwsEksClusterLoggingClusterLoggingDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -22004,31 +23539,27 @@ func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentEnvironmentLi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AwsElasticBeanstalkEnvironmentEnvironmentLink + var sv *types.AwsEksClusterLoggingClusterLoggingDetails if *v == nil { - sv = &types.AwsElasticBeanstalkEnvironmentEnvironmentLink{} + sv = &types.AwsEksClusterLoggingClusterLoggingDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "EnvironmentName": + case "Enabled": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) } - sv.EnvironmentName = ptr.String(jtv) + sv.Enabled = jtv } - case "LinkName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.LinkName = ptr.String(jtv) + case "Types": + if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.Types, value); err != nil { + return err } default: @@ -22040,7 +23571,7 @@ func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentEnvironmentLi return nil } -func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentEnvironmentLinks(v *[]types.AwsElasticBeanstalkEnvironmentEnvironmentLink, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsEksClusterLoggingClusterLoggingList(v *[]types.AwsEksClusterLoggingClusterLoggingDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -22053,17 +23584,17 @@ func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentEnvironmentLi return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AwsElasticBeanstalkEnvironmentEnvironmentLink + var cv []types.AwsEksClusterLoggingClusterLoggingDetails if *v == nil { - cv = []types.AwsElasticBeanstalkEnvironmentEnvironmentLink{} + cv = []types.AwsEksClusterLoggingClusterLoggingDetails{} } else { cv = *v } for _, value := range shape { - var col types.AwsElasticBeanstalkEnvironmentEnvironmentLink + var col types.AwsEksClusterLoggingClusterLoggingDetails destAddr := &col - if err := awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentEnvironmentLink(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentAwsEksClusterLoggingClusterLoggingDetails(&destAddr, value); err != nil { return err } col = *destAddr @@ -22074,7 +23605,7 @@ func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentEnvironmentLi return nil } -func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentOptionSetting(v **types.AwsElasticBeanstalkEnvironmentOptionSetting, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsEksClusterLoggingDetails(v **types.AwsEksClusterLoggingDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -22087,49 +23618,18 @@ func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentOptionSetting return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AwsElasticBeanstalkEnvironmentOptionSetting + var sv *types.AwsEksClusterLoggingDetails if *v == nil { - sv = &types.AwsElasticBeanstalkEnvironmentOptionSetting{} + sv = &types.AwsEksClusterLoggingDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "Namespace": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.Namespace = ptr.String(jtv) - } - - case "OptionName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.OptionName = ptr.String(jtv) - } - - case "ResourceName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.ResourceName = ptr.String(jtv) - } - - case "Value": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.Value = ptr.String(jtv) + case "ClusterLogging": + if err := awsRestjson1_deserializeDocumentAwsEksClusterLoggingClusterLoggingList(&sv.ClusterLogging, value); err != nil { + return err } default: @@ -22141,7 +23641,7 @@ func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentOptionSetting return nil } -func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentOptionSettings(v *[]types.AwsElasticBeanstalkEnvironmentOptionSetting, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsEksClusterResourcesVpcConfigDetails(v **types.AwsEksClusterResourcesVpcConfigDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -22149,23 +23649,377 @@ func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentOptionSetting 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.AwsElasticBeanstalkEnvironmentOptionSetting + var sv *types.AwsEksClusterResourcesVpcConfigDetails if *v == nil { - cv = []types.AwsElasticBeanstalkEnvironmentOptionSetting{} + sv = &types.AwsEksClusterResourcesVpcConfigDetails{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.AwsElasticBeanstalkEnvironmentOptionSetting - destAddr := &col - if err := awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentOptionSetting(&destAddr, value); err != nil { - return err + for key, value := range shape { + switch key { + case "SecurityGroupIds": + if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SecurityGroupIds, value); err != nil { + return err + } + + case "SubnetIds": + if err := awsRestjson1_deserializeDocumentNonEmptyStringList(&sv.SubnetIds, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentDetails(v **types.AwsElasticBeanstalkEnvironmentDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsElasticBeanstalkEnvironmentDetails + if *v == nil { + sv = &types.AwsElasticBeanstalkEnvironmentDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ApplicationName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ApplicationName = ptr.String(jtv) + } + + case "Cname": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Cname = ptr.String(jtv) + } + + 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) + } + sv.DateCreated = ptr.String(jtv) + } + + case "DateUpdated": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.DateUpdated = 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 "EndpointUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.EndpointUrl = ptr.String(jtv) + } + + case "EnvironmentArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.EnvironmentArn = ptr.String(jtv) + } + + case "EnvironmentId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.EnvironmentId = ptr.String(jtv) + } + + case "EnvironmentLinks": + if err := awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentEnvironmentLinks(&sv.EnvironmentLinks, value); err != nil { + return err + } + + case "EnvironmentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.EnvironmentName = ptr.String(jtv) + } + + case "OptionSettings": + if err := awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentOptionSettings(&sv.OptionSettings, value); err != nil { + return err + } + + case "PlatformArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.PlatformArn = ptr.String(jtv) + } + + case "SolutionStackName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.SolutionStackName = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Status = ptr.String(jtv) + } + + case "Tier": + if err := awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentTier(&sv.Tier, value); err != nil { + return err + } + + case "VersionLabel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.VersionLabel = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentEnvironmentLink(v **types.AwsElasticBeanstalkEnvironmentEnvironmentLink, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsElasticBeanstalkEnvironmentEnvironmentLink + if *v == nil { + sv = &types.AwsElasticBeanstalkEnvironmentEnvironmentLink{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EnvironmentName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.EnvironmentName = ptr.String(jtv) + } + + case "LinkName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.LinkName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentEnvironmentLinks(v *[]types.AwsElasticBeanstalkEnvironmentEnvironmentLink, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.AwsElasticBeanstalkEnvironmentEnvironmentLink + if *v == nil { + cv = []types.AwsElasticBeanstalkEnvironmentEnvironmentLink{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AwsElasticBeanstalkEnvironmentEnvironmentLink + destAddr := &col + if err := awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentEnvironmentLink(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentOptionSetting(v **types.AwsElasticBeanstalkEnvironmentOptionSetting, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsElasticBeanstalkEnvironmentOptionSetting + if *v == nil { + sv = &types.AwsElasticBeanstalkEnvironmentOptionSetting{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Namespace": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Namespace = ptr.String(jtv) + } + + case "OptionName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.OptionName = ptr.String(jtv) + } + + case "ResourceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ResourceName = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentOptionSettings(v *[]types.AwsElasticBeanstalkEnvironmentOptionSetting, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.AwsElasticBeanstalkEnvironmentOptionSetting + if *v == nil { + cv = []types.AwsElasticBeanstalkEnvironmentOptionSetting{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AwsElasticBeanstalkEnvironmentOptionSetting + destAddr := &col + if err := awsRestjson1_deserializeDocumentAwsElasticBeanstalkEnvironmentOptionSetting(&destAddr, value); err != nil { + return err } col = *destAddr cv = append(cv, col) @@ -25595,6 +27449,135 @@ func awsRestjson1_deserializeDocumentAwsIamUserPolicyList(v *[]types.AwsIamUserP return nil } +func awsRestjson1_deserializeDocumentAwsKinesisStreamDetails(v **types.AwsKinesisStreamDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsKinesisStreamDetails + if *v == nil { + sv = &types.AwsKinesisStreamDetails{} + } 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 "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 "RetentionPeriodHours": + 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.RetentionPeriodHours = int32(i64) + } + + case "ShardCount": + 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.ShardCount = int32(i64) + } + + case "StreamEncryption": + if err := awsRestjson1_deserializeDocumentAwsKinesisStreamStreamEncryptionDetails(&sv.StreamEncryption, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsKinesisStreamStreamEncryptionDetails(v **types.AwsKinesisStreamStreamEncryptionDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsKinesisStreamStreamEncryptionDetails + if *v == nil { + sv = &types.AwsKinesisStreamStreamEncryptionDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EncryptionType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.EncryptionType = ptr.String(jtv) + } + + case "KeyId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.KeyId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentAwsKmsKeyDetails(v **types.AwsKmsKeyDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -26332,6 +28315,89 @@ func awsRestjson1_deserializeDocumentAwsLambdaLayerVersionDetails(v **types.AwsL return nil } +func awsRestjson1_deserializeDocumentAwsMountPoint(v **types.AwsMountPoint, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsMountPoint + if *v == nil { + sv = &types.AwsMountPoint{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ContainerPath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ContainerPath = ptr.String(jtv) + } + + case "SourceVolume": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.SourceVolume = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsMountPointList(v *[]types.AwsMountPoint, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.AwsMountPoint + if *v == nil { + cv = []types.AwsMountPoint{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AwsMountPoint + destAddr := &col + if err := awsRestjson1_deserializeDocumentAwsMountPoint(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentAwsNetworkFirewallFirewallDetails(v **types.AwsNetworkFirewallFirewallDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -26689,6 +28755,60 @@ func awsRestjson1_deserializeDocumentAwsNetworkFirewallRuleGroupDetails(v **type return nil } +func awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainAdvancedSecurityOptionsDetails(v **types.AwsOpenSearchServiceDomainAdvancedSecurityOptionsDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsOpenSearchServiceDomainAdvancedSecurityOptionsDetails + if *v == nil { + sv = &types.AwsOpenSearchServiceDomainAdvancedSecurityOptionsDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Enabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Enabled = jtv + } + + case "InternalUserDatabaseEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.InternalUserDatabaseEnabled = jtv + } + + case "MasterUserOptions": + if err := awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainMasterUserOptionsDetails(&sv.MasterUserOptions, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainClusterConfigDetails(v **types.AwsOpenSearchServiceDomainClusterConfigDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -26893,6 +29013,11 @@ func awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainDetails(v **types sv.AccessPolicies = ptr.String(jtv) } + case "AdvancedSecurityOptions": + if err := awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainAdvancedSecurityOptionsDetails(&sv.AdvancedSecurityOptions, value); err != nil { + return err + } + case "Arn": if value != nil { jtv, ok := value.(string) @@ -27207,6 +29332,64 @@ func awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainLogPublishingOpti return nil } +func awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainMasterUserOptionsDetails(v **types.AwsOpenSearchServiceDomainMasterUserOptionsDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsOpenSearchServiceDomainMasterUserOptionsDetails + if *v == nil { + sv = &types.AwsOpenSearchServiceDomainMasterUserOptionsDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MasterUserArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.MasterUserArn = ptr.String(jtv) + } + + case "MasterUserName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.MasterUserName = ptr.String(jtv) + } + + case "MasterUserPassword": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.MasterUserPassword = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentAwsOpenSearchServiceDomainNodeToNodeEncryptionOptionsDetails(v **types.AwsOpenSearchServiceDomainNodeToNodeEncryptionOptionsDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -34370,6 +36553,11 @@ func awsRestjson1_deserializeDocumentAwsSecurityFinding(v **types.AwsSecurityFin return err } + case "Threats": + if err := awsRestjson1_deserializeDocumentThreatList(&sv.Threats, value); err != nil { + return err + } + case "Title": if value != nil { jtv, ok := value.(string) @@ -35080,6 +37268,51 @@ func awsRestjson1_deserializeDocumentAwsSnsTopicDetails(v **types.AwsSnsTopicDet for key, value := range shape { switch key { + case "ApplicationSuccessFeedbackRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ApplicationSuccessFeedbackRoleArn = ptr.String(jtv) + } + + case "FirehoseFailureFeedbackRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.FirehoseFailureFeedbackRoleArn = ptr.String(jtv) + } + + case "FirehoseSuccessFeedbackRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.FirehoseSuccessFeedbackRoleArn = ptr.String(jtv) + } + + case "HttpFailureFeedbackRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.HttpFailureFeedbackRoleArn = ptr.String(jtv) + } + + case "HttpSuccessFeedbackRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.HttpSuccessFeedbackRoleArn = ptr.String(jtv) + } + case "KmsMasterKeyId": if value != nil { jtv, ok := value.(string) @@ -35098,6 +37331,24 @@ func awsRestjson1_deserializeDocumentAwsSnsTopicDetails(v **types.AwsSnsTopicDet sv.Owner = ptr.String(jtv) } + case "SqsFailureFeedbackRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.SqsFailureFeedbackRoleArn = ptr.String(jtv) + } + + case "SqsSuccessFeedbackRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.SqsSuccessFeedbackRoleArn = ptr.String(jtv) + } + case "Subscription": if err := awsRestjson1_deserializeDocumentAwsSnsTopicSubscriptionList(&sv.Subscription, value); err != nil { return err @@ -35471,40 +37722,897 @@ func awsRestjson1_deserializeDocumentAwsSsmComplianceSummary(v **types.AwsSsmCom sv.NonCompliantUnspecifiedCount = int32(i64) } - case "OverallSeverity": + case "OverallSeverity": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.OverallSeverity = ptr.String(jtv) + } + + case "PatchBaselineId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.PatchBaselineId = ptr.String(jtv) + } + + case "PatchGroup": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.PatchGroup = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Status = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsSsmPatch(v **types.AwsSsmPatch, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsSsmPatch + if *v == nil { + sv = &types.AwsSsmPatch{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ComplianceSummary": + if err := awsRestjson1_deserializeDocumentAwsSsmComplianceSummary(&sv.ComplianceSummary, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsSsmPatchComplianceDetails(v **types.AwsSsmPatchComplianceDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsSsmPatchComplianceDetails + if *v == nil { + sv = &types.AwsSsmPatchComplianceDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Patch": + if err := awsRestjson1_deserializeDocumentAwsSsmPatch(&sv.Patch, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsWafRateBasedRuleDetails(v **types.AwsWafRateBasedRuleDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsWafRateBasedRuleDetails + if *v == nil { + sv = &types.AwsWafRateBasedRuleDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MatchPredicates": + if err := awsRestjson1_deserializeDocumentAwsWafRateBasedRuleMatchPredicateList(&sv.MatchPredicates, value); err != nil { + return err + } + + case "MetricName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.MetricName = 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 "RateKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RateKey = ptr.String(jtv) + } + + case "RateLimit": + 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.RateLimit = i64 + } + + case "RuleId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RuleId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsWafRateBasedRuleMatchPredicate(v **types.AwsWafRateBasedRuleMatchPredicate, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsWafRateBasedRuleMatchPredicate + if *v == nil { + sv = &types.AwsWafRateBasedRuleMatchPredicate{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DataId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.DataId = ptr.String(jtv) + } + + case "Negated": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Negated = jtv + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsWafRateBasedRuleMatchPredicateList(v *[]types.AwsWafRateBasedRuleMatchPredicate, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.AwsWafRateBasedRuleMatchPredicate + if *v == nil { + cv = []types.AwsWafRateBasedRuleMatchPredicate{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AwsWafRateBasedRuleMatchPredicate + destAddr := &col + if err := awsRestjson1_deserializeDocumentAwsWafRateBasedRuleMatchPredicate(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleDetails(v **types.AwsWafRegionalRateBasedRuleDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsWafRegionalRateBasedRuleDetails + if *v == nil { + sv = &types.AwsWafRegionalRateBasedRuleDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MatchPredicates": + if err := awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleMatchPredicateList(&sv.MatchPredicates, value); err != nil { + return err + } + + case "MetricName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.MetricName = 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 "RateKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RateKey = ptr.String(jtv) + } + + case "RateLimit": + 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.RateLimit = i64 + } + + case "RuleId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RuleId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleMatchPredicate(v **types.AwsWafRegionalRateBasedRuleMatchPredicate, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsWafRegionalRateBasedRuleMatchPredicate + if *v == nil { + sv = &types.AwsWafRegionalRateBasedRuleMatchPredicate{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DataId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.DataId = ptr.String(jtv) + } + + case "Negated": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Negated = jtv + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleMatchPredicateList(v *[]types.AwsWafRegionalRateBasedRuleMatchPredicate, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.AwsWafRegionalRateBasedRuleMatchPredicate + if *v == nil { + cv = []types.AwsWafRegionalRateBasedRuleMatchPredicate{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AwsWafRegionalRateBasedRuleMatchPredicate + destAddr := &col + if err := awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleMatchPredicate(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAwsWafRegionalRuleDetails(v **types.AwsWafRegionalRuleDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsWafRegionalRuleDetails + if *v == nil { + sv = &types.AwsWafRegionalRuleDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MetricName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.MetricName = 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 "PredicateList": + if err := awsRestjson1_deserializeDocumentAwsWafRegionalRulePredicateList(&sv.PredicateList, value); err != nil { + return err + } + + case "RuleId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RuleId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsWafRegionalRuleGroupDetails(v **types.AwsWafRegionalRuleGroupDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsWafRegionalRuleGroupDetails + if *v == nil { + sv = &types.AwsWafRegionalRuleGroupDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MetricName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.MetricName = 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 "RuleGroupId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RuleGroupId = ptr.String(jtv) + } + + case "Rules": + if err := awsRestjson1_deserializeDocumentAwsWafRegionalRuleGroupRulesList(&sv.Rules, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsWafRegionalRuleGroupRulesActionDetails(v **types.AwsWafRegionalRuleGroupRulesActionDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsWafRegionalRuleGroupRulesActionDetails + if *v == nil { + sv = &types.AwsWafRegionalRuleGroupRulesActionDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsWafRegionalRuleGroupRulesDetails(v **types.AwsWafRegionalRuleGroupRulesDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsWafRegionalRuleGroupRulesDetails + if *v == nil { + sv = &types.AwsWafRegionalRuleGroupRulesDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Action": + if err := awsRestjson1_deserializeDocumentAwsWafRegionalRuleGroupRulesActionDetails(&sv.Action, value); err != nil { + return err + } + + case "Priority": + 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.Priority = int32(i64) + } + + case "RuleId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RuleId = ptr.String(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsWafRegionalRuleGroupRulesList(v *[]types.AwsWafRegionalRuleGroupRulesDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.AwsWafRegionalRuleGroupRulesDetails + if *v == nil { + cv = []types.AwsWafRegionalRuleGroupRulesDetails{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AwsWafRegionalRuleGroupRulesDetails + destAddr := &col + if err := awsRestjson1_deserializeDocumentAwsWafRegionalRuleGroupRulesDetails(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAwsWafRegionalRulePredicateList(v *[]types.AwsWafRegionalRulePredicateListDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.AwsWafRegionalRulePredicateListDetails + if *v == nil { + cv = []types.AwsWafRegionalRulePredicateListDetails{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AwsWafRegionalRulePredicateListDetails + destAddr := &col + if err := awsRestjson1_deserializeDocumentAwsWafRegionalRulePredicateListDetails(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAwsWafRegionalRulePredicateListDetails(v **types.AwsWafRegionalRulePredicateListDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsWafRegionalRulePredicateListDetails + if *v == nil { + sv = &types.AwsWafRegionalRulePredicateListDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DataId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.DataId = ptr.String(jtv) + } + + case "Negated": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Negated = jtv + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsWafRegionalWebAclDetails(v **types.AwsWafRegionalWebAclDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsWafRegionalWebAclDetails + if *v == nil { + sv = &types.AwsWafRegionalWebAclDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DefaultAction": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.OverallSeverity = ptr.String(jtv) + sv.DefaultAction = ptr.String(jtv) } - case "PatchBaselineId": + case "MetricName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.PatchBaselineId = ptr.String(jtv) + sv.MetricName = ptr.String(jtv) } - case "PatchGroup": + 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.PatchGroup = ptr.String(jtv) + sv.Name = ptr.String(jtv) } - case "Status": + case "RulesList": + if err := awsRestjson1_deserializeDocumentAwsWafRegionalWebAclRulesList(&sv.RulesList, value); err != nil { + return err + } + + case "WebAclId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.Status = ptr.String(jtv) + sv.WebAclId = ptr.String(jtv) } default: @@ -35516,7 +38624,7 @@ func awsRestjson1_deserializeDocumentAwsSsmComplianceSummary(v **types.AwsSsmCom return nil } -func awsRestjson1_deserializeDocumentAwsSsmPatch(v **types.AwsSsmPatch, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsWafRegionalWebAclRulesList(v *[]types.AwsWafRegionalWebAclRulesListDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -35524,35 +38632,33 @@ func awsRestjson1_deserializeDocumentAwsSsmPatch(v **types.AwsSsmPatch, value in 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.AwsSsmPatch + var cv []types.AwsWafRegionalWebAclRulesListDetails if *v == nil { - sv = &types.AwsSsmPatch{} + cv = []types.AwsWafRegionalWebAclRulesListDetails{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "ComplianceSummary": - if err := awsRestjson1_deserializeDocumentAwsSsmComplianceSummary(&sv.ComplianceSummary, value); err != nil { - return err - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.AwsWafRegionalWebAclRulesListDetails + destAddr := &col + if err := awsRestjson1_deserializeDocumentAwsWafRegionalWebAclRulesListDetails(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentAwsSsmPatchComplianceDetails(v **types.AwsSsmPatchComplianceDetails, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsWafRegionalWebAclRulesListActionDetails(v **types.AwsWafRegionalWebAclRulesListActionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -35565,18 +38671,22 @@ func awsRestjson1_deserializeDocumentAwsSsmPatchComplianceDetails(v **types.AwsS return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AwsSsmPatchComplianceDetails + var sv *types.AwsWafRegionalWebAclRulesListActionDetails if *v == nil { - sv = &types.AwsSsmPatchComplianceDetails{} + sv = &types.AwsWafRegionalWebAclRulesListActionDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "Patch": - if err := awsRestjson1_deserializeDocumentAwsSsmPatch(&sv.Patch, value); err != nil { - return err + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) } default: @@ -35588,7 +38698,7 @@ func awsRestjson1_deserializeDocumentAwsSsmPatchComplianceDetails(v **types.AwsS return nil } -func awsRestjson1_deserializeDocumentAwsWafRateBasedRuleDetails(v **types.AwsWafRateBasedRuleDetails, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsWafRegionalWebAclRulesListDetails(v **types.AwsWafRegionalWebAclRulesListDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -35601,58 +38711,36 @@ func awsRestjson1_deserializeDocumentAwsWafRateBasedRuleDetails(v **types.AwsWaf return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AwsWafRateBasedRuleDetails + var sv *types.AwsWafRegionalWebAclRulesListDetails if *v == nil { - sv = &types.AwsWafRateBasedRuleDetails{} + sv = &types.AwsWafRegionalWebAclRulesListDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "MatchPredicates": - if err := awsRestjson1_deserializeDocumentAwsWafRateBasedRuleMatchPredicateList(&sv.MatchPredicates, value); err != nil { + case "Action": + if err := awsRestjson1_deserializeDocumentAwsWafRegionalWebAclRulesListActionDetails(&sv.Action, value); err != nil { return err } - case "MetricName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.MetricName = 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 "RateKey": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.RateKey = ptr.String(jtv) + case "OverrideAction": + if err := awsRestjson1_deserializeDocumentAwsWafRegionalWebAclRulesListOverrideActionDetails(&sv.OverrideAction, value); err != nil { + return err } - case "RateLimit": + case "Priority": 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 Integer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.RateLimit = i64 + sv.Priority = int32(i64) } case "RuleId": @@ -35664,6 +38752,15 @@ func awsRestjson1_deserializeDocumentAwsWafRateBasedRuleDetails(v **types.AwsWaf sv.RuleId = ptr.String(jtv) } + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + default: _, _ = key, value @@ -35673,7 +38770,7 @@ func awsRestjson1_deserializeDocumentAwsWafRateBasedRuleDetails(v **types.AwsWaf return nil } -func awsRestjson1_deserializeDocumentAwsWafRateBasedRuleMatchPredicate(v **types.AwsWafRateBasedRuleMatchPredicate, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsWafRegionalWebAclRulesListOverrideActionDetails(v **types.AwsWafRegionalWebAclRulesListOverrideActionDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -35686,33 +38783,15 @@ func awsRestjson1_deserializeDocumentAwsWafRateBasedRuleMatchPredicate(v **types return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AwsWafRateBasedRuleMatchPredicate + var sv *types.AwsWafRegionalWebAclRulesListOverrideActionDetails if *v == nil { - sv = &types.AwsWafRateBasedRuleMatchPredicate{} + sv = &types.AwsWafRegionalWebAclRulesListOverrideActionDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "DataId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) - } - sv.DataId = ptr.String(jtv) - } - - case "Negated": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.Negated = jtv - } - case "Type": if value != nil { jtv, ok := value.(string) @@ -35731,7 +38810,7 @@ func awsRestjson1_deserializeDocumentAwsWafRateBasedRuleMatchPredicate(v **types return nil } -func awsRestjson1_deserializeDocumentAwsWafRateBasedRuleMatchPredicateList(v *[]types.AwsWafRateBasedRuleMatchPredicate, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsWafRuleDetails(v **types.AwsWafRuleDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -35739,33 +38818,62 @@ func awsRestjson1_deserializeDocumentAwsWafRateBasedRuleMatchPredicateList(v *[] 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.AwsWafRateBasedRuleMatchPredicate + var sv *types.AwsWafRuleDetails if *v == nil { - cv = []types.AwsWafRateBasedRuleMatchPredicate{} + sv = &types.AwsWafRuleDetails{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.AwsWafRateBasedRuleMatchPredicate - destAddr := &col - if err := awsRestjson1_deserializeDocumentAwsWafRateBasedRuleMatchPredicate(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "MetricName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.MetricName = 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 "PredicateList": + if err := awsRestjson1_deserializeDocumentAwsWafRulePredicateList(&sv.PredicateList, value); err != nil { + return err + } + + case "RuleId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.RuleId = ptr.String(jtv) + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleDetails(v **types.AwsWafRegionalRateBasedRuleDetails, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsWafRuleGroupDetails(v **types.AwsWafRuleGroupDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -35778,20 +38886,15 @@ func awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleDetails(v **type return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AwsWafRegionalRateBasedRuleDetails + var sv *types.AwsWafRuleGroupDetails if *v == nil { - sv = &types.AwsWafRegionalRateBasedRuleDetails{} + sv = &types.AwsWafRuleGroupDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "MatchPredicates": - if err := awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleMatchPredicateList(&sv.MatchPredicates, value); err != nil { - return err - } - case "MetricName": if value != nil { jtv, ok := value.(string) @@ -35810,35 +38913,58 @@ func awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleDetails(v **type sv.Name = ptr.String(jtv) } - case "RateKey": + case "RuleGroupId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.RateKey = ptr.String(jtv) + sv.RuleGroupId = ptr.String(jtv) } - case "RateLimit": - 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.RateLimit = i64 + case "Rules": + if err := awsRestjson1_deserializeDocumentAwsWafRuleGroupRulesList(&sv.Rules, value); err != nil { + return err } - case "RuleId": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsWafRuleGroupRulesActionDetails(v **types.AwsWafRuleGroupRulesActionDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsWafRuleGroupRulesActionDetails + if *v == nil { + sv = &types.AwsWafRuleGroupRulesActionDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Type": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) } - sv.RuleId = ptr.String(jtv) + sv.Type = ptr.String(jtv) } default: @@ -35850,7 +38976,7 @@ func awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleDetails(v **type return nil } -func awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleMatchPredicate(v **types.AwsWafRegionalRateBasedRuleMatchPredicate, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsWafRuleGroupRulesDetails(v **types.AwsWafRuleGroupRulesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -35863,31 +38989,40 @@ func awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleMatchPredicate(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AwsWafRegionalRateBasedRuleMatchPredicate + var sv *types.AwsWafRuleGroupRulesDetails if *v == nil { - sv = &types.AwsWafRegionalRateBasedRuleMatchPredicate{} + sv = &types.AwsWafRuleGroupRulesDetails{} } else { sv = *v } for key, value := range shape { switch key { - case "DataId": + case "Action": + if err := awsRestjson1_deserializeDocumentAwsWafRuleGroupRulesActionDetails(&sv.Action, value); err != nil { + return err + } + + case "Priority": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) } - sv.DataId = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Priority = int32(i64) } - case "Negated": + case "RuleId": 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 NonEmptyString to be of type string, got %T instead", value) } - sv.Negated = jtv + sv.RuleId = ptr.String(jtv) } case "Type": @@ -35908,7 +39043,7 @@ func awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleMatchPredicate(v return nil } -func awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleMatchPredicateList(v *[]types.AwsWafRegionalRateBasedRuleMatchPredicate, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsWafRuleGroupRulesList(v *[]types.AwsWafRuleGroupRulesDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -35921,17 +39056,51 @@ func awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleMatchPredicateLi return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AwsWafRegionalRateBasedRuleMatchPredicate + var cv []types.AwsWafRuleGroupRulesDetails if *v == nil { - cv = []types.AwsWafRegionalRateBasedRuleMatchPredicate{} + cv = []types.AwsWafRuleGroupRulesDetails{} } else { cv = *v } for _, value := range shape { - var col types.AwsWafRegionalRateBasedRuleMatchPredicate + var col types.AwsWafRuleGroupRulesDetails destAddr := &col - if err := awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleMatchPredicate(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentAwsWafRuleGroupRulesDetails(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAwsWafRulePredicateList(v *[]types.AwsWafRulePredicateListDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.AwsWafRulePredicateListDetails + if *v == nil { + cv = []types.AwsWafRulePredicateListDetails{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AwsWafRulePredicateListDetails + destAddr := &col + if err := awsRestjson1_deserializeDocumentAwsWafRulePredicateListDetails(&destAddr, value); err != nil { return err } col = *destAddr @@ -35942,6 +39111,64 @@ func awsRestjson1_deserializeDocumentAwsWafRegionalRateBasedRuleMatchPredicateLi return nil } +func awsRestjson1_deserializeDocumentAwsWafRulePredicateListDetails(v **types.AwsWafRulePredicateListDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AwsWafRulePredicateListDetails + if *v == nil { + sv = &types.AwsWafRulePredicateListDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DataId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.DataId = ptr.String(jtv) + } + + case "Negated": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Negated = jtv + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentAwsWafWebAclDetails(v **types.AwsWafWebAclDetails, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -36811,6 +40038,15 @@ func awsRestjson1_deserializeDocumentContainerDetails(v **types.ContainerDetails for key, value := range shape { switch key { + case "ContainerRuntime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ContainerRuntime = ptr.String(jtv) + } + case "ImageId": if value != nil { jtv, ok := value.(string) @@ -36847,6 +40083,20 @@ func awsRestjson1_deserializeDocumentContainerDetails(v **types.ContainerDetails sv.Name = ptr.String(jtv) } + case "Privileged": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Privileged = jtv + } + + case "VolumeMounts": + if err := awsRestjson1_deserializeDocumentVolumeMountList(&sv.VolumeMounts, value); err != nil { + return err + } + default: _, _ = key, value @@ -37466,6 +40716,107 @@ func awsRestjson1_deserializeDocumentFieldMap(v *map[string]string, value interf return nil } +func awsRestjson1_deserializeDocumentFilePathList(v *[]types.FilePaths, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.FilePaths + if *v == nil { + cv = []types.FilePaths{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FilePaths + destAddr := &col + if err := awsRestjson1_deserializeDocumentFilePaths(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentFilePaths(v **types.FilePaths, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.FilePaths + if *v == nil { + sv = &types.FilePaths{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FileName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.FileName = ptr.String(jtv) + } + + case "FilePath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.FilePath = ptr.String(jtv) + } + + case "Hash": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Hash = ptr.String(jtv) + } + + case "ResourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentFindingAggregator(v **types.FindingAggregator, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -41600,6 +44951,11 @@ func awsRestjson1_deserializeDocumentResourceDetails(v **types.ResourceDetails, return err } + case "AwsCloudFormationStack": + if err := awsRestjson1_deserializeDocumentAwsCloudFormationStackDetails(&sv.AwsCloudFormationStack, value); err != nil { + return err + } + case "AwsCloudFrontDistribution": if err := awsRestjson1_deserializeDocumentAwsCloudFrontDistributionDetails(&sv.AwsCloudFrontDistribution, value); err != nil { return err @@ -41610,6 +44966,11 @@ func awsRestjson1_deserializeDocumentResourceDetails(v **types.ResourceDetails, return err } + case "AwsCloudWatchAlarm": + if err := awsRestjson1_deserializeDocumentAwsCloudWatchAlarmDetails(&sv.AwsCloudWatchAlarm, value); err != nil { + return err + } + case "AwsCodeBuildProject": if err := awsRestjson1_deserializeDocumentAwsCodeBuildProjectDetails(&sv.AwsCodeBuildProject, value); err != nil { return err @@ -41650,6 +45011,11 @@ func awsRestjson1_deserializeDocumentResourceDetails(v **types.ResourceDetails, return err } + case "AwsEc2TransitGateway": + if err := awsRestjson1_deserializeDocumentAwsEc2TransitGatewayDetails(&sv.AwsEc2TransitGateway, value); err != nil { + return err + } + case "AwsEc2Volume": if err := awsRestjson1_deserializeDocumentAwsEc2VolumeDetails(&sv.AwsEc2Volume, value); err != nil { return err @@ -41665,6 +45031,11 @@ func awsRestjson1_deserializeDocumentResourceDetails(v **types.ResourceDetails, return err } + case "AwsEc2VpcPeeringConnection": + if err := awsRestjson1_deserializeDocumentAwsEc2VpcPeeringConnectionDetails(&sv.AwsEc2VpcPeeringConnection, value); err != nil { + return err + } + case "AwsEc2VpnConnection": if err := awsRestjson1_deserializeDocumentAwsEc2VpnConnectionDetails(&sv.AwsEc2VpnConnection, value); err != nil { return err @@ -41685,16 +45056,31 @@ func awsRestjson1_deserializeDocumentResourceDetails(v **types.ResourceDetails, return err } + case "AwsEcsContainer": + if err := awsRestjson1_deserializeDocumentAwsEcsContainerDetails(&sv.AwsEcsContainer, value); err != nil { + return err + } + case "AwsEcsService": if err := awsRestjson1_deserializeDocumentAwsEcsServiceDetails(&sv.AwsEcsService, value); err != nil { return err } + case "AwsEcsTask": + if err := awsRestjson1_deserializeDocumentAwsEcsTaskDetails(&sv.AwsEcsTask, value); err != nil { + return err + } + case "AwsEcsTaskDefinition": if err := awsRestjson1_deserializeDocumentAwsEcsTaskDefinitionDetails(&sv.AwsEcsTaskDefinition, value); err != nil { return err } + case "AwsEfsAccessPoint": + if err := awsRestjson1_deserializeDocumentAwsEfsAccessPointDetails(&sv.AwsEfsAccessPoint, value); err != nil { + return err + } + case "AwsEksCluster": if err := awsRestjson1_deserializeDocumentAwsEksClusterDetails(&sv.AwsEksCluster, value); err != nil { return err @@ -41745,6 +45131,11 @@ func awsRestjson1_deserializeDocumentResourceDetails(v **types.ResourceDetails, return err } + case "AwsKinesisStream": + if err := awsRestjson1_deserializeDocumentAwsKinesisStreamDetails(&sv.AwsKinesisStream, value); err != nil { + return err + } + case "AwsKmsKey": if err := awsRestjson1_deserializeDocumentAwsKmsKeyDetails(&sv.AwsKmsKey, value); err != nil { return err @@ -41860,6 +45251,31 @@ func awsRestjson1_deserializeDocumentResourceDetails(v **types.ResourceDetails, return err } + case "AwsWafRegionalRule": + if err := awsRestjson1_deserializeDocumentAwsWafRegionalRuleDetails(&sv.AwsWafRegionalRule, value); err != nil { + return err + } + + case "AwsWafRegionalRuleGroup": + if err := awsRestjson1_deserializeDocumentAwsWafRegionalRuleGroupDetails(&sv.AwsWafRegionalRuleGroup, value); err != nil { + return err + } + + case "AwsWafRegionalWebAcl": + if err := awsRestjson1_deserializeDocumentAwsWafRegionalWebAclDetails(&sv.AwsWafRegionalWebAcl, value); err != nil { + return err + } + + case "AwsWafRule": + if err := awsRestjson1_deserializeDocumentAwsWafRuleDetails(&sv.AwsWafRule, value); err != nil { + return err + } + + case "AwsWafRuleGroup": + if err := awsRestjson1_deserializeDocumentAwsWafRuleGroupDetails(&sv.AwsWafRuleGroup, value); err != nil { + return err + } + case "AwsWafWebAcl": if err := awsRestjson1_deserializeDocumentAwsWafWebAclDetails(&sv.AwsWafWebAcl, value); err != nil { return err @@ -44610,6 +48026,73 @@ func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interfac return nil } +func awsRestjson1_deserializeDocumentThreat(v **types.Threat, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Threat + if *v == nil { + sv = &types.Threat{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FilePaths": + if err := awsRestjson1_deserializeDocumentFilePathList(&sv.FilePaths, value); err != nil { + return err + } + + case "ItemCount": + 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.ItemCount = int32(i64) + } + + 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 "Severity": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Severity = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentThreatIntelIndicator(v **types.ThreatIntelIndicator, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -44729,6 +48212,40 @@ func awsRestjson1_deserializeDocumentThreatIntelIndicatorList(v *[]types.ThreatI return nil } +func awsRestjson1_deserializeDocumentThreatList(v *[]types.Threat, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.Threat + if *v == nil { + cv = []types.Threat{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Threat + destAddr := &col + if err := awsRestjson1_deserializeDocumentThreat(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentTypeList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -44765,6 +48282,295 @@ func awsRestjson1_deserializeDocumentTypeList(v *[]string, value interface{}) er return nil } +func awsRestjson1_deserializeDocumentVolumeMount(v **types.VolumeMount, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.VolumeMount + if *v == nil { + sv = &types.VolumeMount{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MountPath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.MountPath = 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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentVolumeMountList(v *[]types.VolumeMount, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.VolumeMount + if *v == nil { + cv = []types.VolumeMount{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.VolumeMount + destAddr := &col + if err := awsRestjson1_deserializeDocumentVolumeMount(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentVpcInfoCidrBlockSetDetails(v **types.VpcInfoCidrBlockSetDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.VpcInfoCidrBlockSetDetails + if *v == nil { + sv = &types.VpcInfoCidrBlockSetDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CidrBlock": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.CidrBlock = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentVpcInfoCidrBlockSetList(v *[]types.VpcInfoCidrBlockSetDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.VpcInfoCidrBlockSetDetails + if *v == nil { + cv = []types.VpcInfoCidrBlockSetDetails{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.VpcInfoCidrBlockSetDetails + destAddr := &col + if err := awsRestjson1_deserializeDocumentVpcInfoCidrBlockSetDetails(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentVpcInfoIpv6CidrBlockSetDetails(v **types.VpcInfoIpv6CidrBlockSetDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.VpcInfoIpv6CidrBlockSetDetails + if *v == nil { + sv = &types.VpcInfoIpv6CidrBlockSetDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Ipv6CidrBlock": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.Ipv6CidrBlock = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentVpcInfoIpv6CidrBlockSetList(v *[]types.VpcInfoIpv6CidrBlockSetDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of 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.VpcInfoIpv6CidrBlockSetDetails + if *v == nil { + cv = []types.VpcInfoIpv6CidrBlockSetDetails{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.VpcInfoIpv6CidrBlockSetDetails + destAddr := &col + if err := awsRestjson1_deserializeDocumentVpcInfoIpv6CidrBlockSetDetails(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentVpcInfoPeeringOptionsDetails(v **types.VpcInfoPeeringOptionsDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.VpcInfoPeeringOptionsDetails + if *v == nil { + sv = &types.VpcInfoPeeringOptionsDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AllowDnsResolutionFromRemoteVpc": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AllowDnsResolutionFromRemoteVpc = jtv + } + + case "AllowEgressFromLocalClassicLinkToRemoteVpc": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AllowEgressFromLocalClassicLinkToRemoteVpc = jtv + } + + case "AllowEgressFromLocalVpcToRemoteClassicLink": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AllowEgressFromLocalVpcToRemoteClassicLink = jtv + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentVulnerability(v **types.Vulnerability, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/securityhub/serializers.go b/service/securityhub/serializers.go index e567c257f3c..4b788bf7807 100644 --- a/service/securityhub/serializers.go +++ b/service/securityhub/serializers.go @@ -5364,6 +5364,143 @@ func awsRestjson1_serializeDocumentAwsCertificateManagerCertificateResourceRecor return nil } +func awsRestjson1_serializeDocumentAwsCloudFormationStackDetails(v *types.AwsCloudFormationStackDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Capabilities != nil { + ok := object.Key("Capabilities") + if err := awsRestjson1_serializeDocumentNonEmptyStringList(v.Capabilities, ok); err != nil { + return err + } + } + + if v.CreationTime != nil { + ok := object.Key("CreationTime") + ok.String(*v.CreationTime) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.DisableRollback { + ok := object.Key("DisableRollback") + ok.Boolean(v.DisableRollback) + } + + if v.DriftInformation != nil { + ok := object.Key("DriftInformation") + if err := awsRestjson1_serializeDocumentAwsCloudFormationStackDriftInformationDetails(v.DriftInformation, ok); err != nil { + return err + } + } + + if v.EnableTerminationProtection { + ok := object.Key("EnableTerminationProtection") + ok.Boolean(v.EnableTerminationProtection) + } + + if v.LastUpdatedTime != nil { + ok := object.Key("LastUpdatedTime") + ok.String(*v.LastUpdatedTime) + } + + if v.NotificationArns != nil { + ok := object.Key("NotificationArns") + if err := awsRestjson1_serializeDocumentNonEmptyStringList(v.NotificationArns, ok); err != nil { + return err + } + } + + if v.Outputs != nil { + ok := object.Key("Outputs") + if err := awsRestjson1_serializeDocumentAwsCloudFormationStackOutputsList(v.Outputs, ok); err != nil { + return err + } + } + + if v.RoleArn != nil { + ok := object.Key("RoleArn") + ok.String(*v.RoleArn) + } + + if v.StackId != nil { + ok := object.Key("StackId") + ok.String(*v.StackId) + } + + if v.StackName != nil { + ok := object.Key("StackName") + ok.String(*v.StackName) + } + + if v.StackStatus != nil { + ok := object.Key("StackStatus") + ok.String(*v.StackStatus) + } + + if v.StackStatusReason != nil { + ok := object.Key("StackStatusReason") + ok.String(*v.StackStatusReason) + } + + if v.TimeoutInMinutes != 0 { + ok := object.Key("TimeoutInMinutes") + ok.Integer(v.TimeoutInMinutes) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsCloudFormationStackDriftInformationDetails(v *types.AwsCloudFormationStackDriftInformationDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.StackDriftStatus != nil { + ok := object.Key("StackDriftStatus") + ok.String(*v.StackDriftStatus) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsCloudFormationStackOutputsDetails(v *types.AwsCloudFormationStackOutputsDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.OutputKey != nil { + ok := object.Key("OutputKey") + ok.String(*v.OutputKey) + } + + if v.OutputValue != nil { + ok := object.Key("OutputValue") + ok.String(*v.OutputValue) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsCloudFormationStackOutputsList(v []types.AwsCloudFormationStackOutputsDetails, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAwsCloudFormationStackOutputsDetails(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentAwsCloudFrontDistributionCacheBehavior(v *types.AwsCloudFrontDistributionCacheBehavior, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5521,6 +5658,45 @@ func awsRestjson1_serializeDocumentAwsCloudFrontDistributionLogging(v *types.Aws return nil } +func awsRestjson1_serializeDocumentAwsCloudFrontDistributionOriginCustomOriginConfig(v *types.AwsCloudFrontDistributionOriginCustomOriginConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.HttpPort != 0 { + ok := object.Key("HttpPort") + ok.Integer(v.HttpPort) + } + + if v.HttpsPort != 0 { + ok := object.Key("HttpsPort") + ok.Integer(v.HttpsPort) + } + + if v.OriginKeepaliveTimeout != 0 { + ok := object.Key("OriginKeepaliveTimeout") + ok.Integer(v.OriginKeepaliveTimeout) + } + + if v.OriginProtocolPolicy != nil { + ok := object.Key("OriginProtocolPolicy") + ok.String(*v.OriginProtocolPolicy) + } + + if v.OriginReadTimeout != 0 { + ok := object.Key("OriginReadTimeout") + ok.Integer(v.OriginReadTimeout) + } + + if v.OriginSslProtocols != nil { + ok := object.Key("OriginSslProtocols") + if err := awsRestjson1_serializeDocumentAwsCloudFrontDistributionOriginSslProtocols(v.OriginSslProtocols, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentAwsCloudFrontDistributionOriginGroup(v *types.AwsCloudFrontDistributionOriginGroup, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5610,6 +5786,13 @@ func awsRestjson1_serializeDocumentAwsCloudFrontDistributionOriginItem(v *types. object := value.Object() defer object.Close() + if v.CustomOriginConfig != nil { + ok := object.Key("CustomOriginConfig") + if err := awsRestjson1_serializeDocumentAwsCloudFrontDistributionOriginCustomOriginConfig(v.CustomOriginConfig, ok); err != nil { + return err + } + } + if v.DomainName != nil { ok := object.Key("DomainName") ok.String(*v.DomainName) @@ -5674,6 +5857,25 @@ func awsRestjson1_serializeDocumentAwsCloudFrontDistributionOriginS3OriginConfig return nil } +func awsRestjson1_serializeDocumentAwsCloudFrontDistributionOriginSslProtocols(v *types.AwsCloudFrontDistributionOriginSslProtocols, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Items != nil { + ok := object.Key("Items") + if err := awsRestjson1_serializeDocumentNonEmptyStringList(v.Items, ok); err != nil { + return err + } + } + + if v.Quantity != 0 { + ok := object.Key("Quantity") + ok.Integer(v.Quantity) + } + + return nil +} + func awsRestjson1_serializeDocumentAwsCloudFrontDistributionViewerCertificate(v *types.AwsCloudFrontDistributionViewerCertificate, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5798,6 +6000,174 @@ func awsRestjson1_serializeDocumentAwsCloudTrailTrailDetails(v *types.AwsCloudTr return nil } +func awsRestjson1_serializeDocumentAwsCloudWatchAlarmDetails(v *types.AwsCloudWatchAlarmDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ActionsEnabled { + ok := object.Key("ActionsEnabled") + ok.Boolean(v.ActionsEnabled) + } + + if v.AlarmActions != nil { + ok := object.Key("AlarmActions") + if err := awsRestjson1_serializeDocumentNonEmptyStringList(v.AlarmActions, ok); err != nil { + return err + } + } + + if v.AlarmArn != nil { + ok := object.Key("AlarmArn") + ok.String(*v.AlarmArn) + } + + if v.AlarmConfigurationUpdatedTimestamp != nil { + ok := object.Key("AlarmConfigurationUpdatedTimestamp") + ok.String(*v.AlarmConfigurationUpdatedTimestamp) + } + + if v.AlarmDescription != nil { + ok := object.Key("AlarmDescription") + ok.String(*v.AlarmDescription) + } + + if v.AlarmName != nil { + ok := object.Key("AlarmName") + ok.String(*v.AlarmName) + } + + if v.ComparisonOperator != nil { + ok := object.Key("ComparisonOperator") + ok.String(*v.ComparisonOperator) + } + + if v.DatapointsToAlarm != 0 { + ok := object.Key("DatapointsToAlarm") + ok.Integer(v.DatapointsToAlarm) + } + + if v.Dimensions != nil { + ok := object.Key("Dimensions") + if err := awsRestjson1_serializeDocumentAwsCloudWatchAlarmDimensionsList(v.Dimensions, ok); err != nil { + return err + } + } + + if v.EvaluateLowSampleCountPercentile != nil { + ok := object.Key("EvaluateLowSampleCountPercentile") + ok.String(*v.EvaluateLowSampleCountPercentile) + } + + if v.EvaluationPeriods != 0 { + ok := object.Key("EvaluationPeriods") + ok.Integer(v.EvaluationPeriods) + } + + if v.ExtendedStatistic != nil { + ok := object.Key("ExtendedStatistic") + ok.String(*v.ExtendedStatistic) + } + + if v.InsufficientDataActions != nil { + ok := object.Key("InsufficientDataActions") + if err := awsRestjson1_serializeDocumentNonEmptyStringList(v.InsufficientDataActions, ok); err != nil { + return err + } + } + + if v.MetricName != nil { + ok := object.Key("MetricName") + ok.String(*v.MetricName) + } + + if v.Namespace != nil { + ok := object.Key("Namespace") + ok.String(*v.Namespace) + } + + if v.OkActions != nil { + ok := object.Key("OkActions") + if err := awsRestjson1_serializeDocumentNonEmptyStringList(v.OkActions, ok); err != nil { + return err + } + } + + if v.Period != 0 { + ok := object.Key("Period") + ok.Integer(v.Period) + } + + if v.Statistic != nil { + ok := object.Key("Statistic") + ok.String(*v.Statistic) + } + + if v.Threshold != 0 { + ok := object.Key("Threshold") + switch { + case math.IsNaN(v.Threshold): + ok.String("NaN") + + case math.IsInf(v.Threshold, 1): + ok.String("Infinity") + + case math.IsInf(v.Threshold, -1): + ok.String("-Infinity") + + default: + ok.Double(v.Threshold) + + } + } + + if v.ThresholdMetricId != nil { + ok := object.Key("ThresholdMetricId") + ok.String(*v.ThresholdMetricId) + } + + if v.TreatMissingData != nil { + ok := object.Key("TreatMissingData") + ok.String(*v.TreatMissingData) + } + + if v.Unit != nil { + ok := object.Key("Unit") + ok.String(*v.Unit) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsCloudWatchAlarmDimensionsDetails(v *types.AwsCloudWatchAlarmDimensionsDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsCloudWatchAlarmDimensionsList(v []types.AwsCloudWatchAlarmDimensionsDetails, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAwsCloudWatchAlarmDimensionsDetails(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentAwsCodeBuildProjectArtifactsDetails(v *types.AwsCodeBuildProjectArtifactsDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6812,6 +7182,13 @@ func awsRestjson1_serializeDocumentAwsEc2InstanceDetails(v *types.AwsEc2Instance ok.String(*v.LaunchedAt) } + if v.MetadataOptions != nil { + ok := object.Key("MetadataOptions") + if err := awsRestjson1_serializeDocumentAwsEc2InstanceMetadataOptions(v.MetadataOptions, ok); err != nil { + return err + } + } + if v.NetworkInterfaces != nil { ok := object.Key("NetworkInterfaces") if err := awsRestjson1_serializeDocumentAwsEc2InstanceNetworkInterfacesList(v.NetworkInterfaces, ok); err != nil { @@ -6829,6 +7206,11 @@ func awsRestjson1_serializeDocumentAwsEc2InstanceDetails(v *types.AwsEc2Instance ok.String(*v.Type) } + if v.VirtualizationType != nil { + ok := object.Key("VirtualizationType") + ok.String(*v.VirtualizationType) + } + if v.VpcId != nil { ok := object.Key("VpcId") ok.String(*v.VpcId) @@ -6837,21 +7219,53 @@ func awsRestjson1_serializeDocumentAwsEc2InstanceDetails(v *types.AwsEc2Instance return nil } -func awsRestjson1_serializeDocumentAwsEc2InstanceNetworkInterfacesDetails(v *types.AwsEc2InstanceNetworkInterfacesDetails, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentAwsEc2InstanceMetadataOptions(v *types.AwsEc2InstanceMetadataOptions, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.NetworkInterfaceId != nil { - ok := object.Key("NetworkInterfaceId") - ok.String(*v.NetworkInterfaceId) + if v.HttpEndpoint != nil { + ok := object.Key("HttpEndpoint") + ok.String(*v.HttpEndpoint) } - return nil -} + if v.HttpProtocolIpv6 != nil { + ok := object.Key("HttpProtocolIpv6") + ok.String(*v.HttpProtocolIpv6) + } -func awsRestjson1_serializeDocumentAwsEc2InstanceNetworkInterfacesList(v []types.AwsEc2InstanceNetworkInterfacesDetails, value smithyjson.Value) error { - array := value.Array() - defer array.Close() + if v.HttpPutResponseHopLimit != 0 { + ok := object.Key("HttpPutResponseHopLimit") + ok.Integer(v.HttpPutResponseHopLimit) + } + + if v.HttpTokens != nil { + ok := object.Key("HttpTokens") + ok.String(*v.HttpTokens) + } + + if v.InstanceMetadataTags != nil { + ok := object.Key("InstanceMetadataTags") + ok.String(*v.InstanceMetadataTags) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsEc2InstanceNetworkInterfacesDetails(v *types.AwsEc2InstanceNetworkInterfacesDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NetworkInterfaceId != nil { + ok := object.Key("NetworkInterfaceId") + ok.String(*v.NetworkInterfaceId) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsEc2InstanceNetworkInterfacesList(v []types.AwsEc2InstanceNetworkInterfacesDetails, value smithyjson.Value) error { + array := value.Array() + defer array.Close() for i := range v { av := array.Value() @@ -7487,6 +7901,75 @@ func awsRestjson1_serializeDocumentAwsEc2SubnetDetails(v *types.AwsEc2SubnetDeta return nil } +func awsRestjson1_serializeDocumentAwsEc2TransitGatewayDetails(v *types.AwsEc2TransitGatewayDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AmazonSideAsn != 0 { + ok := object.Key("AmazonSideAsn") + ok.Integer(v.AmazonSideAsn) + } + + if v.AssociationDefaultRouteTableId != nil { + ok := object.Key("AssociationDefaultRouteTableId") + ok.String(*v.AssociationDefaultRouteTableId) + } + + if v.AutoAcceptSharedAttachments != nil { + ok := object.Key("AutoAcceptSharedAttachments") + ok.String(*v.AutoAcceptSharedAttachments) + } + + if v.DefaultRouteTableAssociation != nil { + ok := object.Key("DefaultRouteTableAssociation") + ok.String(*v.DefaultRouteTableAssociation) + } + + if v.DefaultRouteTablePropagation != nil { + ok := object.Key("DefaultRouteTablePropagation") + ok.String(*v.DefaultRouteTablePropagation) + } + + if v.Description != nil { + ok := object.Key("Description") + ok.String(*v.Description) + } + + if v.DnsSupport != nil { + ok := object.Key("DnsSupport") + ok.String(*v.DnsSupport) + } + + if v.Id != nil { + ok := object.Key("Id") + ok.String(*v.Id) + } + + if v.MulticastSupport != nil { + ok := object.Key("MulticastSupport") + ok.String(*v.MulticastSupport) + } + + if v.PropagationDefaultRouteTableId != nil { + ok := object.Key("PropagationDefaultRouteTableId") + ok.String(*v.PropagationDefaultRouteTableId) + } + + if v.TransitGatewayCidrBlocks != nil { + ok := object.Key("TransitGatewayCidrBlocks") + if err := awsRestjson1_serializeDocumentNonEmptyStringList(v.TransitGatewayCidrBlocks, ok); err != nil { + return err + } + } + + if v.VpnEcmpSupport != nil { + ok := object.Key("VpnEcmpSupport") + ok.String(*v.VpnEcmpSupport) + } + + return nil +} + func awsRestjson1_serializeDocumentAwsEc2VolumeAttachment(v *types.AwsEc2VolumeAttachment, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -7543,6 +8026,11 @@ func awsRestjson1_serializeDocumentAwsEc2VolumeDetails(v *types.AwsEc2VolumeDeta ok.String(*v.CreateTime) } + if v.DeviceName != nil { + ok := object.Key("DeviceName") + ok.String(*v.DeviceName) + } + if v.Encrypted { ok := object.Key("Encrypted") ok.Boolean(v.Encrypted) @@ -7568,6 +8056,21 @@ func awsRestjson1_serializeDocumentAwsEc2VolumeDetails(v *types.AwsEc2VolumeDeta ok.String(*v.Status) } + if v.VolumeId != nil { + ok := object.Key("VolumeId") + ok.String(*v.VolumeId) + } + + if v.VolumeScanStatus != nil { + ok := object.Key("VolumeScanStatus") + ok.String(*v.VolumeScanStatus) + } + + if v.VolumeType != nil { + ok := object.Key("VolumeType") + ok.String(*v.VolumeType) + } + return nil } @@ -7699,6 +8202,109 @@ func awsRestjson1_serializeDocumentAwsEc2VpcEndpointServiceServiceTypeList(v []t return nil } +func awsRestjson1_serializeDocumentAwsEc2VpcPeeringConnectionDetails(v *types.AwsEc2VpcPeeringConnectionDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccepterVpcInfo != nil { + ok := object.Key("AccepterVpcInfo") + if err := awsRestjson1_serializeDocumentAwsEc2VpcPeeringConnectionVpcInfoDetails(v.AccepterVpcInfo, ok); err != nil { + return err + } + } + + if v.ExpirationTime != nil { + ok := object.Key("ExpirationTime") + ok.String(*v.ExpirationTime) + } + + if v.RequesterVpcInfo != nil { + ok := object.Key("RequesterVpcInfo") + if err := awsRestjson1_serializeDocumentAwsEc2VpcPeeringConnectionVpcInfoDetails(v.RequesterVpcInfo, ok); err != nil { + return err + } + } + + if v.Status != nil { + ok := object.Key("Status") + if err := awsRestjson1_serializeDocumentAwsEc2VpcPeeringConnectionStatusDetails(v.Status, ok); err != nil { + return err + } + } + + if v.VpcPeeringConnectionId != nil { + ok := object.Key("VpcPeeringConnectionId") + ok.String(*v.VpcPeeringConnectionId) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsEc2VpcPeeringConnectionStatusDetails(v *types.AwsEc2VpcPeeringConnectionStatusDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Code != nil { + ok := object.Key("Code") + ok.String(*v.Code) + } + + if v.Message != nil { + ok := object.Key("Message") + ok.String(*v.Message) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsEc2VpcPeeringConnectionVpcInfoDetails(v *types.AwsEc2VpcPeeringConnectionVpcInfoDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CidrBlock != nil { + ok := object.Key("CidrBlock") + ok.String(*v.CidrBlock) + } + + if v.CidrBlockSet != nil { + ok := object.Key("CidrBlockSet") + if err := awsRestjson1_serializeDocumentVpcInfoCidrBlockSetList(v.CidrBlockSet, ok); err != nil { + return err + } + } + + if v.Ipv6CidrBlockSet != nil { + ok := object.Key("Ipv6CidrBlockSet") + if err := awsRestjson1_serializeDocumentVpcInfoIpv6CidrBlockSetList(v.Ipv6CidrBlockSet, ok); err != nil { + return err + } + } + + if v.OwnerId != nil { + ok := object.Key("OwnerId") + ok.String(*v.OwnerId) + } + + if v.PeeringOptions != nil { + ok := object.Key("PeeringOptions") + if err := awsRestjson1_serializeDocumentVpcInfoPeeringOptionsDetails(v.PeeringOptions, ok); err != nil { + return err + } + } + + if v.Region != nil { + ok := object.Key("Region") + ok.String(*v.Region) + } + + if v.VpcId != nil { + ok := object.Key("VpcId") + ok.String(*v.VpcId) + } + + return nil +} + func awsRestjson1_serializeDocumentAwsEc2VpnConnectionDetails(v *types.AwsEc2VpnConnectionDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -8228,6 +8834,11 @@ func awsRestjson1_serializeDocumentAwsEcsClusterDetails(v *types.AwsEcsClusterDe object := value.Object() defer object.Close() + if v.ActiveServicesCount != 0 { + ok := object.Key("ActiveServicesCount") + ok.Integer(v.ActiveServicesCount) + } + if v.CapacityProviders != nil { ok := object.Key("CapacityProviders") if err := awsRestjson1_serializeDocumentNonEmptyStringList(v.CapacityProviders, ok); err != nil { @@ -8235,6 +8846,16 @@ func awsRestjson1_serializeDocumentAwsEcsClusterDetails(v *types.AwsEcsClusterDe } } + if v.ClusterArn != nil { + ok := object.Key("ClusterArn") + ok.String(*v.ClusterArn) + } + + if v.ClusterName != nil { + ok := object.Key("ClusterName") + ok.String(*v.ClusterName) + } + if v.ClusterSettings != nil { ok := object.Key("ClusterSettings") if err := awsRestjson1_serializeDocumentAwsEcsClusterClusterSettingsList(v.ClusterSettings, ok); err != nil { @@ -8256,6 +8877,63 @@ func awsRestjson1_serializeDocumentAwsEcsClusterDetails(v *types.AwsEcsClusterDe } } + if v.RegisteredContainerInstancesCount != 0 { + ok := object.Key("RegisteredContainerInstancesCount") + ok.Integer(v.RegisteredContainerInstancesCount) + } + + if v.RunningTasksCount != 0 { + ok := object.Key("RunningTasksCount") + ok.Integer(v.RunningTasksCount) + } + + if v.Status != nil { + ok := object.Key("Status") + ok.String(*v.Status) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsEcsContainerDetails(v *types.AwsEcsContainerDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Image != nil { + ok := object.Key("Image") + ok.String(*v.Image) + } + + if v.MountPoints != nil { + ok := object.Key("MountPoints") + if err := awsRestjson1_serializeDocumentAwsMountPointList(v.MountPoints, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.Privileged { + ok := object.Key("Privileged") + ok.Boolean(v.Privileged) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsEcsContainerDetailsList(v []types.AwsEcsContainerDetails, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAwsEcsContainerDetails(&v[i], av); err != nil { + return err + } + } return nil } @@ -9878,52 +10556,45 @@ func awsRestjson1_serializeDocumentAwsEcsTaskDefinitionVolumesList(v []types.Aws return nil } -func awsRestjson1_serializeDocumentAwsEksClusterDetails(v *types.AwsEksClusterDetails, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentAwsEcsTaskDetails(v *types.AwsEcsTaskDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.Arn != nil { - ok := object.Key("Arn") - ok.String(*v.Arn) - } - - if v.CertificateAuthorityData != nil { - ok := object.Key("CertificateAuthorityData") - ok.String(*v.CertificateAuthorityData) + if v.ClusterArn != nil { + ok := object.Key("ClusterArn") + ok.String(*v.ClusterArn) } - if v.ClusterStatus != nil { - ok := object.Key("ClusterStatus") - ok.String(*v.ClusterStatus) + if v.Containers != nil { + ok := object.Key("Containers") + if err := awsRestjson1_serializeDocumentAwsEcsContainerDetailsList(v.Containers, ok); err != nil { + return err + } } - if v.Endpoint != nil { - ok := object.Key("Endpoint") - ok.String(*v.Endpoint) + if v.CreatedAt != nil { + ok := object.Key("CreatedAt") + ok.String(*v.CreatedAt) } - if v.Logging != nil { - ok := object.Key("Logging") - if err := awsRestjson1_serializeDocumentAwsEksClusterLoggingDetails(v.Logging, ok); err != nil { - return err - } + if v.Group != nil { + ok := object.Key("Group") + ok.String(*v.Group) } - if v.Name != nil { - ok := object.Key("Name") - ok.String(*v.Name) + if v.StartedAt != nil { + ok := object.Key("StartedAt") + ok.String(*v.StartedAt) } - if v.ResourcesVpcConfig != nil { - ok := object.Key("ResourcesVpcConfig") - if err := awsRestjson1_serializeDocumentAwsEksClusterResourcesVpcConfigDetails(v.ResourcesVpcConfig, ok); err != nil { - return err - } + if v.StartedBy != nil { + ok := object.Key("StartedBy") + ok.String(*v.StartedBy) } - if v.RoleArn != nil { - ok := object.Key("RoleArn") - ok.String(*v.RoleArn) + if v.TaskDefinitionArn != nil { + ok := object.Key("TaskDefinitionArn") + ok.String(*v.TaskDefinitionArn) } if v.Version != nil { @@ -9931,14 +10602,227 @@ func awsRestjson1_serializeDocumentAwsEksClusterDetails(v *types.AwsEksClusterDe ok.String(*v.Version) } + if v.Volumes != nil { + ok := object.Key("Volumes") + if err := awsRestjson1_serializeDocumentAwsEcsTaskVolumeDetailsList(v.Volumes, ok); err != nil { + return err + } + } + return nil } -func awsRestjson1_serializeDocumentAwsEksClusterLoggingClusterLoggingDetails(v *types.AwsEksClusterLoggingClusterLoggingDetails, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentAwsEcsTaskVolumeDetails(v *types.AwsEcsTaskVolumeDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.Enabled { + if v.Host != nil { + ok := object.Key("Host") + if err := awsRestjson1_serializeDocumentAwsEcsTaskVolumeHostDetails(v.Host, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsEcsTaskVolumeDetailsList(v []types.AwsEcsTaskVolumeDetails, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAwsEcsTaskVolumeDetails(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentAwsEcsTaskVolumeHostDetails(v *types.AwsEcsTaskVolumeHostDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SourcePath != nil { + ok := object.Key("SourcePath") + ok.String(*v.SourcePath) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsEfsAccessPointDetails(v *types.AwsEfsAccessPointDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccessPointId != nil { + ok := object.Key("AccessPointId") + ok.String(*v.AccessPointId) + } + + if v.Arn != nil { + ok := object.Key("Arn") + ok.String(*v.Arn) + } + + if v.ClientToken != nil { + ok := object.Key("ClientToken") + ok.String(*v.ClientToken) + } + + if v.FileSystemId != nil { + ok := object.Key("FileSystemId") + ok.String(*v.FileSystemId) + } + + if v.PosixUser != nil { + ok := object.Key("PosixUser") + if err := awsRestjson1_serializeDocumentAwsEfsAccessPointPosixUserDetails(v.PosixUser, ok); err != nil { + return err + } + } + + if v.RootDirectory != nil { + ok := object.Key("RootDirectory") + if err := awsRestjson1_serializeDocumentAwsEfsAccessPointRootDirectoryDetails(v.RootDirectory, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsEfsAccessPointPosixUserDetails(v *types.AwsEfsAccessPointPosixUserDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Gid != nil { + ok := object.Key("Gid") + ok.String(*v.Gid) + } + + if v.SecondaryGids != nil { + ok := object.Key("SecondaryGids") + if err := awsRestjson1_serializeDocumentNonEmptyStringList(v.SecondaryGids, ok); err != nil { + return err + } + } + + if v.Uid != nil { + ok := object.Key("Uid") + ok.String(*v.Uid) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsEfsAccessPointRootDirectoryCreationInfoDetails(v *types.AwsEfsAccessPointRootDirectoryCreationInfoDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.OwnerGid != nil { + ok := object.Key("OwnerGid") + ok.String(*v.OwnerGid) + } + + if v.OwnerUid != nil { + ok := object.Key("OwnerUid") + ok.String(*v.OwnerUid) + } + + if v.Permissions != nil { + ok := object.Key("Permissions") + ok.String(*v.Permissions) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsEfsAccessPointRootDirectoryDetails(v *types.AwsEfsAccessPointRootDirectoryDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CreationInfo != nil { + ok := object.Key("CreationInfo") + if err := awsRestjson1_serializeDocumentAwsEfsAccessPointRootDirectoryCreationInfoDetails(v.CreationInfo, ok); err != nil { + return err + } + } + + if v.Path != nil { + ok := object.Key("Path") + ok.String(*v.Path) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsEksClusterDetails(v *types.AwsEksClusterDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Arn != nil { + ok := object.Key("Arn") + ok.String(*v.Arn) + } + + if v.CertificateAuthorityData != nil { + ok := object.Key("CertificateAuthorityData") + ok.String(*v.CertificateAuthorityData) + } + + if v.ClusterStatus != nil { + ok := object.Key("ClusterStatus") + ok.String(*v.ClusterStatus) + } + + if v.Endpoint != nil { + ok := object.Key("Endpoint") + ok.String(*v.Endpoint) + } + + if v.Logging != nil { + ok := object.Key("Logging") + if err := awsRestjson1_serializeDocumentAwsEksClusterLoggingDetails(v.Logging, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.ResourcesVpcConfig != nil { + ok := object.Key("ResourcesVpcConfig") + if err := awsRestjson1_serializeDocumentAwsEksClusterResourcesVpcConfigDetails(v.ResourcesVpcConfig, ok); err != nil { + return err + } + } + + if v.RoleArn != nil { + ok := object.Key("RoleArn") + ok.String(*v.RoleArn) + } + + if v.Version != nil { + ok := object.Key("Version") + ok.String(*v.Version) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsEksClusterLoggingClusterLoggingDetails(v *types.AwsEksClusterLoggingClusterLoggingDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Enabled { ok := object.Key("Enabled") ok.Boolean(v.Enabled) } @@ -11716,6 +12600,57 @@ func awsRestjson1_serializeDocumentAwsIamUserPolicyList(v []types.AwsIamUserPoli return nil } +func awsRestjson1_serializeDocumentAwsKinesisStreamDetails(v *types.AwsKinesisStreamDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Arn != nil { + ok := object.Key("Arn") + ok.String(*v.Arn) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.RetentionPeriodHours != 0 { + ok := object.Key("RetentionPeriodHours") + ok.Integer(v.RetentionPeriodHours) + } + + if v.ShardCount != 0 { + ok := object.Key("ShardCount") + ok.Integer(v.ShardCount) + } + + if v.StreamEncryption != nil { + ok := object.Key("StreamEncryption") + if err := awsRestjson1_serializeDocumentAwsKinesisStreamStreamEncryptionDetails(v.StreamEncryption, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsKinesisStreamStreamEncryptionDetails(v *types.AwsKinesisStreamStreamEncryptionDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EncryptionType != nil { + ok := object.Key("EncryptionType") + ok.String(*v.EncryptionType) + } + + if v.KeyId != nil { + ok := object.Key("KeyId") + ok.String(*v.KeyId) + } + + return nil +} + func awsRestjson1_serializeDocumentAwsKmsKeyDetails(v *types.AwsKmsKeyDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -12054,6 +12989,36 @@ func awsRestjson1_serializeDocumentAwsLambdaLayerVersionDetails(v *types.AwsLamb return nil } +func awsRestjson1_serializeDocumentAwsMountPoint(v *types.AwsMountPoint, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ContainerPath != nil { + ok := object.Key("ContainerPath") + ok.String(*v.ContainerPath) + } + + if v.SourceVolume != nil { + ok := object.Key("SourceVolume") + ok.String(*v.SourceVolume) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsMountPointList(v []types.AwsMountPoint, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAwsMountPoint(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentAwsNetworkFirewallFirewallDetails(v *types.AwsNetworkFirewallFirewallDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -12216,6 +13181,30 @@ func awsRestjson1_serializeDocumentAwsNetworkFirewallRuleGroupDetails(v *types.A return nil } +func awsRestjson1_serializeDocumentAwsOpenSearchServiceDomainAdvancedSecurityOptionsDetails(v *types.AwsOpenSearchServiceDomainAdvancedSecurityOptionsDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Enabled { + ok := object.Key("Enabled") + ok.Boolean(v.Enabled) + } + + if v.InternalUserDatabaseEnabled { + ok := object.Key("InternalUserDatabaseEnabled") + ok.Boolean(v.InternalUserDatabaseEnabled) + } + + if v.MasterUserOptions != nil { + ok := object.Key("MasterUserOptions") + if err := awsRestjson1_serializeDocumentAwsOpenSearchServiceDomainMasterUserOptionsDetails(v.MasterUserOptions, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentAwsOpenSearchServiceDomainClusterConfigDetails(v *types.AwsOpenSearchServiceDomainClusterConfigDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -12296,8 +13285,15 @@ func awsRestjson1_serializeDocumentAwsOpenSearchServiceDomainDetails(v *types.Aw ok.String(*v.AccessPolicies) } - if v.Arn != nil { - ok := object.Key("Arn") + if v.AdvancedSecurityOptions != nil { + ok := object.Key("AdvancedSecurityOptions") + if err := awsRestjson1_serializeDocumentAwsOpenSearchServiceDomainAdvancedSecurityOptionsDetails(v.AdvancedSecurityOptions, ok); err != nil { + return err + } + } + + if v.Arn != nil { + ok := object.Key("Arn") ok.String(*v.Arn) } @@ -12474,6 +13470,28 @@ func awsRestjson1_serializeDocumentAwsOpenSearchServiceDomainLogPublishingOption return nil } +func awsRestjson1_serializeDocumentAwsOpenSearchServiceDomainMasterUserOptionsDetails(v *types.AwsOpenSearchServiceDomainMasterUserOptionsDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MasterUserArn != nil { + ok := object.Key("MasterUserArn") + ok.String(*v.MasterUserArn) + } + + if v.MasterUserName != nil { + ok := object.Key("MasterUserName") + ok.String(*v.MasterUserName) + } + + if v.MasterUserPassword != nil { + ok := object.Key("MasterUserPassword") + ok.String(*v.MasterUserPassword) + } + + return nil +} + func awsRestjson1_serializeDocumentAwsOpenSearchServiceDomainNodeToNodeEncryptionOptionsDetails(v *types.AwsOpenSearchServiceDomainNodeToNodeEncryptionOptionsDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -15836,6 +16854,13 @@ func awsRestjson1_serializeDocumentAwsSecurityFinding(v *types.AwsSecurityFindin } } + if v.Threats != nil { + ok := object.Key("Threats") + if err := awsRestjson1_serializeDocumentThreatList(v.Threats, ok); err != nil { + return err + } + } + if v.Title != nil { ok := object.Key("Title") ok.String(*v.Title) @@ -16593,6 +17618,31 @@ func awsRestjson1_serializeDocumentAwsSnsTopicDetails(v *types.AwsSnsTopicDetail object := value.Object() defer object.Close() + if v.ApplicationSuccessFeedbackRoleArn != nil { + ok := object.Key("ApplicationSuccessFeedbackRoleArn") + ok.String(*v.ApplicationSuccessFeedbackRoleArn) + } + + if v.FirehoseFailureFeedbackRoleArn != nil { + ok := object.Key("FirehoseFailureFeedbackRoleArn") + ok.String(*v.FirehoseFailureFeedbackRoleArn) + } + + if v.FirehoseSuccessFeedbackRoleArn != nil { + ok := object.Key("FirehoseSuccessFeedbackRoleArn") + ok.String(*v.FirehoseSuccessFeedbackRoleArn) + } + + if v.HttpFailureFeedbackRoleArn != nil { + ok := object.Key("HttpFailureFeedbackRoleArn") + ok.String(*v.HttpFailureFeedbackRoleArn) + } + + if v.HttpSuccessFeedbackRoleArn != nil { + ok := object.Key("HttpSuccessFeedbackRoleArn") + ok.String(*v.HttpSuccessFeedbackRoleArn) + } + if v.KmsMasterKeyId != nil { ok := object.Key("KmsMasterKeyId") ok.String(*v.KmsMasterKeyId) @@ -16603,6 +17653,16 @@ func awsRestjson1_serializeDocumentAwsSnsTopicDetails(v *types.AwsSnsTopicDetail ok.String(*v.Owner) } + if v.SqsFailureFeedbackRoleArn != nil { + ok := object.Key("SqsFailureFeedbackRoleArn") + ok.String(*v.SqsFailureFeedbackRoleArn) + } + + if v.SqsSuccessFeedbackRoleArn != nil { + ok := object.Key("SqsSuccessFeedbackRoleArn") + ok.String(*v.SqsSuccessFeedbackRoleArn) + } + if v.Subscription != nil { ok := object.Key("Subscription") if err := awsRestjson1_serializeDocumentAwsSnsTopicSubscriptionList(v.Subscription, ok); err != nil { @@ -16900,9 +17960,392 @@ func awsRestjson1_serializeDocumentAwsWafRegionalRateBasedRuleDetails(v *types.A ok.String(*v.RateKey) } - if v.RateLimit != 0 { - ok := object.Key("RateLimit") - ok.Long(v.RateLimit) + if v.RateLimit != 0 { + ok := object.Key("RateLimit") + ok.Long(v.RateLimit) + } + + if v.RuleId != nil { + ok := object.Key("RuleId") + ok.String(*v.RuleId) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsWafRegionalRateBasedRuleMatchPredicate(v *types.AwsWafRegionalRateBasedRuleMatchPredicate, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DataId != nil { + ok := object.Key("DataId") + ok.String(*v.DataId) + } + + if v.Negated { + ok := object.Key("Negated") + ok.Boolean(v.Negated) + } + + if v.Type != nil { + ok := object.Key("Type") + ok.String(*v.Type) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsWafRegionalRateBasedRuleMatchPredicateList(v []types.AwsWafRegionalRateBasedRuleMatchPredicate, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAwsWafRegionalRateBasedRuleMatchPredicate(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentAwsWafRegionalRuleDetails(v *types.AwsWafRegionalRuleDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MetricName != nil { + ok := object.Key("MetricName") + ok.String(*v.MetricName) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.PredicateList != nil { + ok := object.Key("PredicateList") + if err := awsRestjson1_serializeDocumentAwsWafRegionalRulePredicateList(v.PredicateList, ok); err != nil { + return err + } + } + + if v.RuleId != nil { + ok := object.Key("RuleId") + ok.String(*v.RuleId) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsWafRegionalRuleGroupDetails(v *types.AwsWafRegionalRuleGroupDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MetricName != nil { + ok := object.Key("MetricName") + ok.String(*v.MetricName) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.RuleGroupId != nil { + ok := object.Key("RuleGroupId") + ok.String(*v.RuleGroupId) + } + + if v.Rules != nil { + ok := object.Key("Rules") + if err := awsRestjson1_serializeDocumentAwsWafRegionalRuleGroupRulesList(v.Rules, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsWafRegionalRuleGroupRulesActionDetails(v *types.AwsWafRegionalRuleGroupRulesActionDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Type != nil { + ok := object.Key("Type") + ok.String(*v.Type) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsWafRegionalRuleGroupRulesDetails(v *types.AwsWafRegionalRuleGroupRulesDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Action != nil { + ok := object.Key("Action") + if err := awsRestjson1_serializeDocumentAwsWafRegionalRuleGroupRulesActionDetails(v.Action, ok); err != nil { + return err + } + } + + if v.Priority != 0 { + ok := object.Key("Priority") + ok.Integer(v.Priority) + } + + if v.RuleId != nil { + ok := object.Key("RuleId") + ok.String(*v.RuleId) + } + + if v.Type != nil { + ok := object.Key("Type") + ok.String(*v.Type) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsWafRegionalRuleGroupRulesList(v []types.AwsWafRegionalRuleGroupRulesDetails, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAwsWafRegionalRuleGroupRulesDetails(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentAwsWafRegionalRulePredicateList(v []types.AwsWafRegionalRulePredicateListDetails, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAwsWafRegionalRulePredicateListDetails(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentAwsWafRegionalRulePredicateListDetails(v *types.AwsWafRegionalRulePredicateListDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DataId != nil { + ok := object.Key("DataId") + ok.String(*v.DataId) + } + + if v.Negated { + ok := object.Key("Negated") + ok.Boolean(v.Negated) + } + + if v.Type != nil { + ok := object.Key("Type") + ok.String(*v.Type) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsWafRegionalWebAclDetails(v *types.AwsWafRegionalWebAclDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DefaultAction != nil { + ok := object.Key("DefaultAction") + ok.String(*v.DefaultAction) + } + + if v.MetricName != nil { + ok := object.Key("MetricName") + ok.String(*v.MetricName) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.RulesList != nil { + ok := object.Key("RulesList") + if err := awsRestjson1_serializeDocumentAwsWafRegionalWebAclRulesList(v.RulesList, ok); err != nil { + return err + } + } + + if v.WebAclId != nil { + ok := object.Key("WebAclId") + ok.String(*v.WebAclId) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsWafRegionalWebAclRulesList(v []types.AwsWafRegionalWebAclRulesListDetails, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAwsWafRegionalWebAclRulesListDetails(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentAwsWafRegionalWebAclRulesListActionDetails(v *types.AwsWafRegionalWebAclRulesListActionDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Type != nil { + ok := object.Key("Type") + ok.String(*v.Type) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsWafRegionalWebAclRulesListDetails(v *types.AwsWafRegionalWebAclRulesListDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Action != nil { + ok := object.Key("Action") + if err := awsRestjson1_serializeDocumentAwsWafRegionalWebAclRulesListActionDetails(v.Action, ok); err != nil { + return err + } + } + + if v.OverrideAction != nil { + ok := object.Key("OverrideAction") + if err := awsRestjson1_serializeDocumentAwsWafRegionalWebAclRulesListOverrideActionDetails(v.OverrideAction, ok); err != nil { + return err + } + } + + if v.Priority != 0 { + ok := object.Key("Priority") + ok.Integer(v.Priority) + } + + if v.RuleId != nil { + ok := object.Key("RuleId") + ok.String(*v.RuleId) + } + + if v.Type != nil { + ok := object.Key("Type") + ok.String(*v.Type) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsWafRegionalWebAclRulesListOverrideActionDetails(v *types.AwsWafRegionalWebAclRulesListOverrideActionDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Type != nil { + ok := object.Key("Type") + ok.String(*v.Type) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsWafRuleDetails(v *types.AwsWafRuleDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MetricName != nil { + ok := object.Key("MetricName") + ok.String(*v.MetricName) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.PredicateList != nil { + ok := object.Key("PredicateList") + if err := awsRestjson1_serializeDocumentAwsWafRulePredicateList(v.PredicateList, ok); err != nil { + return err + } + } + + if v.RuleId != nil { + ok := object.Key("RuleId") + ok.String(*v.RuleId) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsWafRuleGroupDetails(v *types.AwsWafRuleGroupDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MetricName != nil { + ok := object.Key("MetricName") + ok.String(*v.MetricName) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.RuleGroupId != nil { + ok := object.Key("RuleGroupId") + ok.String(*v.RuleGroupId) + } + + if v.Rules != nil { + ok := object.Key("Rules") + if err := awsRestjson1_serializeDocumentAwsWafRuleGroupRulesList(v.Rules, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsWafRuleGroupRulesActionDetails(v *types.AwsWafRuleGroupRulesActionDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Type != nil { + ok := object.Key("Type") + ok.String(*v.Type) + } + + return nil +} + +func awsRestjson1_serializeDocumentAwsWafRuleGroupRulesDetails(v *types.AwsWafRuleGroupRulesDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Action != nil { + ok := object.Key("Action") + if err := awsRestjson1_serializeDocumentAwsWafRuleGroupRulesActionDetails(v.Action, ok); err != nil { + return err + } + } + + if v.Priority != 0 { + ok := object.Key("Priority") + ok.Integer(v.Priority) } if v.RuleId != nil { @@ -16910,10 +18353,41 @@ func awsRestjson1_serializeDocumentAwsWafRegionalRateBasedRuleDetails(v *types.A ok.String(*v.RuleId) } + if v.Type != nil { + ok := object.Key("Type") + ok.String(*v.Type) + } + return nil } -func awsRestjson1_serializeDocumentAwsWafRegionalRateBasedRuleMatchPredicate(v *types.AwsWafRegionalRateBasedRuleMatchPredicate, value smithyjson.Value) error { +func awsRestjson1_serializeDocumentAwsWafRuleGroupRulesList(v []types.AwsWafRuleGroupRulesDetails, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAwsWafRuleGroupRulesDetails(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentAwsWafRulePredicateList(v []types.AwsWafRulePredicateListDetails, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentAwsWafRulePredicateListDetails(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentAwsWafRulePredicateListDetails(v *types.AwsWafRulePredicateListDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -16935,19 +18409,6 @@ func awsRestjson1_serializeDocumentAwsWafRegionalRateBasedRuleMatchPredicate(v * return nil } -func awsRestjson1_serializeDocumentAwsWafRegionalRateBasedRuleMatchPredicateList(v []types.AwsWafRegionalRateBasedRuleMatchPredicate, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsRestjson1_serializeDocumentAwsWafRegionalRateBasedRuleMatchPredicate(&v[i], av); err != nil { - return err - } - } - return nil -} - func awsRestjson1_serializeDocumentAwsWafWebAclDetails(v *types.AwsWafWebAclDetails, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -17270,6 +18731,11 @@ func awsRestjson1_serializeDocumentContainerDetails(v *types.ContainerDetails, v object := value.Object() defer object.Close() + if v.ContainerRuntime != nil { + ok := object.Key("ContainerRuntime") + ok.String(*v.ContainerRuntime) + } + if v.ImageId != nil { ok := object.Key("ImageId") ok.String(*v.ImageId) @@ -17290,6 +18756,18 @@ func awsRestjson1_serializeDocumentContainerDetails(v *types.ContainerDetails, v ok.String(*v.Name) } + if v.Privileged { + ok := object.Key("Privileged") + ok.Boolean(v.Privileged) + } + + if v.VolumeMounts != nil { + ok := object.Key("VolumeMounts") + if err := awsRestjson1_serializeDocumentVolumeMountList(v.VolumeMounts, ok); err != nil { + return err + } + } + return nil } @@ -17537,6 +19015,46 @@ func awsRestjson1_serializeDocumentFieldMap(v map[string]string, value smithyjso return nil } +func awsRestjson1_serializeDocumentFilePathList(v []types.FilePaths, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentFilePaths(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentFilePaths(v *types.FilePaths, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FileName != nil { + ok := object.Key("FileName") + ok.String(*v.FileName) + } + + if v.FilePath != nil { + ok := object.Key("FilePath") + ok.String(*v.FilePath) + } + + if v.Hash != nil { + ok := object.Key("Hash") + ok.String(*v.Hash) + } + + if v.ResourceId != nil { + ok := object.Key("ResourceId") + ok.String(*v.ResourceId) + } + + return nil +} + func awsRestjson1_serializeDocumentFindingProviderFields(v *types.FindingProviderFields, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -18853,6 +20371,13 @@ func awsRestjson1_serializeDocumentResourceDetails(v *types.ResourceDetails, val } } + if v.AwsCloudFormationStack != nil { + ok := object.Key("AwsCloudFormationStack") + if err := awsRestjson1_serializeDocumentAwsCloudFormationStackDetails(v.AwsCloudFormationStack, ok); err != nil { + return err + } + } + if v.AwsCloudFrontDistribution != nil { ok := object.Key("AwsCloudFrontDistribution") if err := awsRestjson1_serializeDocumentAwsCloudFrontDistributionDetails(v.AwsCloudFrontDistribution, ok); err != nil { @@ -18867,6 +20392,13 @@ func awsRestjson1_serializeDocumentResourceDetails(v *types.ResourceDetails, val } } + if v.AwsCloudWatchAlarm != nil { + ok := object.Key("AwsCloudWatchAlarm") + if err := awsRestjson1_serializeDocumentAwsCloudWatchAlarmDetails(v.AwsCloudWatchAlarm, ok); err != nil { + return err + } + } + if v.AwsCodeBuildProject != nil { ok := object.Key("AwsCodeBuildProject") if err := awsRestjson1_serializeDocumentAwsCodeBuildProjectDetails(v.AwsCodeBuildProject, ok); err != nil { @@ -18923,6 +20455,13 @@ func awsRestjson1_serializeDocumentResourceDetails(v *types.ResourceDetails, val } } + if v.AwsEc2TransitGateway != nil { + ok := object.Key("AwsEc2TransitGateway") + if err := awsRestjson1_serializeDocumentAwsEc2TransitGatewayDetails(v.AwsEc2TransitGateway, ok); err != nil { + return err + } + } + if v.AwsEc2Volume != nil { ok := object.Key("AwsEc2Volume") if err := awsRestjson1_serializeDocumentAwsEc2VolumeDetails(v.AwsEc2Volume, ok); err != nil { @@ -18944,6 +20483,13 @@ func awsRestjson1_serializeDocumentResourceDetails(v *types.ResourceDetails, val } } + if v.AwsEc2VpcPeeringConnection != nil { + ok := object.Key("AwsEc2VpcPeeringConnection") + if err := awsRestjson1_serializeDocumentAwsEc2VpcPeeringConnectionDetails(v.AwsEc2VpcPeeringConnection, ok); err != nil { + return err + } + } + if v.AwsEc2VpnConnection != nil { ok := object.Key("AwsEc2VpnConnection") if err := awsRestjson1_serializeDocumentAwsEc2VpnConnectionDetails(v.AwsEc2VpnConnection, ok); err != nil { @@ -18972,6 +20518,13 @@ func awsRestjson1_serializeDocumentResourceDetails(v *types.ResourceDetails, val } } + if v.AwsEcsContainer != nil { + ok := object.Key("AwsEcsContainer") + if err := awsRestjson1_serializeDocumentAwsEcsContainerDetails(v.AwsEcsContainer, ok); err != nil { + return err + } + } + if v.AwsEcsService != nil { ok := object.Key("AwsEcsService") if err := awsRestjson1_serializeDocumentAwsEcsServiceDetails(v.AwsEcsService, ok); err != nil { @@ -18979,6 +20532,13 @@ func awsRestjson1_serializeDocumentResourceDetails(v *types.ResourceDetails, val } } + if v.AwsEcsTask != nil { + ok := object.Key("AwsEcsTask") + if err := awsRestjson1_serializeDocumentAwsEcsTaskDetails(v.AwsEcsTask, ok); err != nil { + return err + } + } + if v.AwsEcsTaskDefinition != nil { ok := object.Key("AwsEcsTaskDefinition") if err := awsRestjson1_serializeDocumentAwsEcsTaskDefinitionDetails(v.AwsEcsTaskDefinition, ok); err != nil { @@ -18986,6 +20546,13 @@ func awsRestjson1_serializeDocumentResourceDetails(v *types.ResourceDetails, val } } + if v.AwsEfsAccessPoint != nil { + ok := object.Key("AwsEfsAccessPoint") + if err := awsRestjson1_serializeDocumentAwsEfsAccessPointDetails(v.AwsEfsAccessPoint, ok); err != nil { + return err + } + } + if v.AwsEksCluster != nil { ok := object.Key("AwsEksCluster") if err := awsRestjson1_serializeDocumentAwsEksClusterDetails(v.AwsEksCluster, ok); err != nil { @@ -19056,6 +20623,13 @@ func awsRestjson1_serializeDocumentResourceDetails(v *types.ResourceDetails, val } } + if v.AwsKinesisStream != nil { + ok := object.Key("AwsKinesisStream") + if err := awsRestjson1_serializeDocumentAwsKinesisStreamDetails(v.AwsKinesisStream, ok); err != nil { + return err + } + } + if v.AwsKmsKey != nil { ok := object.Key("AwsKmsKey") if err := awsRestjson1_serializeDocumentAwsKmsKeyDetails(v.AwsKmsKey, ok); err != nil { @@ -19217,6 +20791,41 @@ func awsRestjson1_serializeDocumentResourceDetails(v *types.ResourceDetails, val } } + if v.AwsWafRegionalRule != nil { + ok := object.Key("AwsWafRegionalRule") + if err := awsRestjson1_serializeDocumentAwsWafRegionalRuleDetails(v.AwsWafRegionalRule, ok); err != nil { + return err + } + } + + if v.AwsWafRegionalRuleGroup != nil { + ok := object.Key("AwsWafRegionalRuleGroup") + if err := awsRestjson1_serializeDocumentAwsWafRegionalRuleGroupDetails(v.AwsWafRegionalRuleGroup, ok); err != nil { + return err + } + } + + if v.AwsWafRegionalWebAcl != nil { + ok := object.Key("AwsWafRegionalWebAcl") + if err := awsRestjson1_serializeDocumentAwsWafRegionalWebAclDetails(v.AwsWafRegionalWebAcl, ok); err != nil { + return err + } + } + + if v.AwsWafRule != nil { + ok := object.Key("AwsWafRule") + if err := awsRestjson1_serializeDocumentAwsWafRuleDetails(v.AwsWafRule, ok); err != nil { + return err + } + } + + if v.AwsWafRuleGroup != nil { + ok := object.Key("AwsWafRuleGroup") + if err := awsRestjson1_serializeDocumentAwsWafRuleGroupDetails(v.AwsWafRuleGroup, ok); err != nil { + return err + } + } + if v.AwsWafWebAcl != nil { ok := object.Key("AwsWafWebAcl") if err := awsRestjson1_serializeDocumentAwsWafWebAclDetails(v.AwsWafWebAcl, ok); err != nil { @@ -20253,6 +21862,35 @@ func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson. return nil } +func awsRestjson1_serializeDocumentThreat(v *types.Threat, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FilePaths != nil { + ok := object.Key("FilePaths") + if err := awsRestjson1_serializeDocumentFilePathList(v.FilePaths, ok); err != nil { + return err + } + } + + if v.ItemCount != 0 { + ok := object.Key("ItemCount") + ok.Integer(v.ItemCount) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.Severity != nil { + ok := object.Key("Severity") + ok.String(*v.Severity) + } + + return nil +} + func awsRestjson1_serializeDocumentThreatIntelIndicator(v *types.ThreatIntelIndicator, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -20303,6 +21941,19 @@ func awsRestjson1_serializeDocumentThreatIntelIndicatorList(v []types.ThreatInte return nil } +func awsRestjson1_serializeDocumentThreatList(v []types.Threat, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentThreat(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentTypeList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -20314,6 +21965,108 @@ func awsRestjson1_serializeDocumentTypeList(v []string, value smithyjson.Value) return nil } +func awsRestjson1_serializeDocumentVolumeMount(v *types.VolumeMount, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MountPath != nil { + ok := object.Key("MountPath") + ok.String(*v.MountPath) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + return nil +} + +func awsRestjson1_serializeDocumentVolumeMountList(v []types.VolumeMount, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentVolumeMount(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentVpcInfoCidrBlockSetDetails(v *types.VpcInfoCidrBlockSetDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CidrBlock != nil { + ok := object.Key("CidrBlock") + ok.String(*v.CidrBlock) + } + + return nil +} + +func awsRestjson1_serializeDocumentVpcInfoCidrBlockSetList(v []types.VpcInfoCidrBlockSetDetails, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentVpcInfoCidrBlockSetDetails(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentVpcInfoIpv6CidrBlockSetDetails(v *types.VpcInfoIpv6CidrBlockSetDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Ipv6CidrBlock != nil { + ok := object.Key("Ipv6CidrBlock") + ok.String(*v.Ipv6CidrBlock) + } + + return nil +} + +func awsRestjson1_serializeDocumentVpcInfoIpv6CidrBlockSetList(v []types.VpcInfoIpv6CidrBlockSetDetails, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentVpcInfoIpv6CidrBlockSetDetails(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentVpcInfoPeeringOptionsDetails(v *types.VpcInfoPeeringOptionsDetails, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AllowDnsResolutionFromRemoteVpc { + ok := object.Key("AllowDnsResolutionFromRemoteVpc") + ok.Boolean(v.AllowDnsResolutionFromRemoteVpc) + } + + if v.AllowEgressFromLocalClassicLinkToRemoteVpc { + ok := object.Key("AllowEgressFromLocalClassicLinkToRemoteVpc") + ok.Boolean(v.AllowEgressFromLocalClassicLinkToRemoteVpc) + } + + if v.AllowEgressFromLocalVpcToRemoteClassicLink { + ok := object.Key("AllowEgressFromLocalVpcToRemoteClassicLink") + ok.Boolean(v.AllowEgressFromLocalVpcToRemoteClassicLink) + } + + return nil +} + func awsRestjson1_serializeDocumentVulnerability(v *types.Vulnerability, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/securityhub/types/types.go b/service/securityhub/types/types.go index 95a2d413c9e..83c9f326d29 100644 --- a/service/securityhub/types/types.go +++ b/service/securityhub/types/types.go @@ -1118,6 +1118,89 @@ type AwsCertificateManagerCertificateResourceRecord struct { noSmithyDocumentSerde } +// Nests a stack as a resource in a top-level template. Nested stacks are stacks +// created as resources for another stack. +type AwsCloudFormationStackDetails struct { + + // The capabilities allowed in the stack. + Capabilities []string + + // The time at which the stack was created. + CreationTime *string + + // A user-defined description associated with the stack. + Description *string + + // Boolean to enable or disable rollback on stack creation failures. + DisableRollback bool + + // Information about whether a stack's actual configuration differs, or has + // drifted, from its expected configuration, as defined in the stack template and + // any values specified as template parameters. + DriftInformation *AwsCloudFormationStackDriftInformationDetails + + // Whether termination protection is enabled for the stack. + EnableTerminationProtection bool + + // The time the nested stack was last updated. This field will only be returned if + // the stack has been updated at least once. + LastUpdatedTime *string + + // The Amazon Resource Names (ARNs) of the Amazon SNS topic to which stack-related + // events are published. + NotificationArns []string + + // A list of output structures. + Outputs []AwsCloudFormationStackOutputsDetails + + // The ARN of an IAM role that's associated with the stack. + RoleArn *string + + // Unique identifier of the stack. + StackId *string + + // The name associated with the stack. + StackName *string + + // Current status of the stack. + StackStatus *string + + // Success or failure message associated with the stack status. + StackStatusReason *string + + // The length of time, in minutes, that CloudFormation waits for the nested stack + // to reach the CREATE_COMPLETE state. + TimeoutInMinutes int32 + + noSmithyDocumentSerde +} + +// Provides information about the stack's conformity to its expected template +// configuration. +type AwsCloudFormationStackDriftInformationDetails struct { + + // Status of the stack's actual configuration compared to its expected template + // configuration. + StackDriftStatus *string + + noSmithyDocumentSerde +} + +// Provides information about the CloudFormation stack output. +type AwsCloudFormationStackOutputsDetails struct { + + // A user-defined description associated with the output. + Description *string + + // The key associated with the output. + OutputKey *string + + // The value associated with the output. + OutputValue *string + + noSmithyDocumentSerde +} + // Information about a cache behavior for the distribution. type AwsCloudFrontDistributionCacheBehavior struct { @@ -1138,7 +1221,7 @@ type AwsCloudFrontDistributionCacheBehavior struct { noSmithyDocumentSerde } -// Provides information about caching for the distribution. +// Provides information about caching for the CloudFront distribution. type AwsCloudFrontDistributionCacheBehaviors struct { // The cache behaviors for the distribution. @@ -1147,7 +1230,8 @@ type AwsCloudFrontDistributionCacheBehaviors struct { noSmithyDocumentSerde } -// Contains information about the default cache configuration for the distribution. +// Contains information about the default cache configuration for the CloudFront +// distribution. type AwsCloudFrontDistributionDefaultCacheBehavior struct { // The protocol that viewers can use to access the files in an origin. You can @@ -1167,7 +1251,7 @@ type AwsCloudFrontDistributionDefaultCacheBehavior struct { noSmithyDocumentSerde } -// A distribution configuration. +// A CloudFront distribution configuration. type AwsCloudFrontDistributionDetails struct { // Provides information about the cache configuration for the distribution. @@ -1218,7 +1302,7 @@ type AwsCloudFrontDistributionDetails struct { noSmithyDocumentSerde } -// A complex type that controls whether access logs are written for the +// A complex type that controls whether access logs are written for the CloudFront // distribution. type AwsCloudFrontDistributionLogging struct { @@ -1238,7 +1322,37 @@ type AwsCloudFrontDistributionLogging struct { noSmithyDocumentSerde } -// Information about an origin group for the distribution. +// A custom origin. A custom origin is any origin that is not an Amazon S3 bucket, +// with one exception. An Amazon S3 bucket that is configured with static website +// hosting (https://docs.aws.amazon.com/AmazonS3/latest/dev/WebsiteHosting.html) is +// a custom origin. +type AwsCloudFrontDistributionOriginCustomOriginConfig struct { + + // The HTTP port that CloudFront uses to connect to the origin. + HttpPort int32 + + // The HTTPS port that CloudFront uses to connect to the origin. + HttpsPort int32 + + // Specifies how long, in seconds, CloudFront persists its connection to the + // origin. + OriginKeepaliveTimeout int32 + + // Specifies the protocol (HTTP or HTTPS) that CloudFront uses to connect to the + // origin. + OriginProtocolPolicy *string + + // Specifies how long, in seconds, CloudFront waits for a response from the origin. + OriginReadTimeout int32 + + // Specifies the minimum SSL/TLS protocol that CloudFront uses when connecting to + // your origin over HTTPS. + OriginSslProtocols *AwsCloudFrontDistributionOriginSslProtocols + + noSmithyDocumentSerde +} + +// Information about an origin group for the CloudFront distribution. type AwsCloudFrontDistributionOriginGroup struct { // Provides the criteria for an origin group to fail over. @@ -1268,7 +1382,7 @@ type AwsCloudFrontDistributionOriginGroupFailoverStatusCodes struct { noSmithyDocumentSerde } -// Provides information about origin groups that are associated with the +// Provides information about origin groups that are associated with the CloudFront // distribution. type AwsCloudFrontDistributionOriginGroups struct { @@ -1278,11 +1392,17 @@ type AwsCloudFrontDistributionOriginGroups struct { noSmithyDocumentSerde } -// A complex type that describes the S3 bucket, HTTP server (for example, a web -// server), AWS Elemental MediaStore, or other server from which CloudFront gets -// your files. +// A complex type that describes the Amazon S3 bucket, HTTP server (for example, a +// web server), AWS Elemental MediaStore, or other server from which CloudFront +// gets your files. type AwsCloudFrontDistributionOriginItem struct { + // An origin that is not an Amazon S3 bucket, with one exception. If the Amazon S3 + // bucket is configured with static website hosting, use this attribute. If the + // Amazon S3 bucket is not configured with static website hosting, use the + // S3OriginConfig type instead. + CustomOriginConfig *AwsCloudFrontDistributionOriginCustomOriginConfig + // Amazon S3 origins: The DNS name of the S3 bucket from which you want CloudFront // to get objects for this origin. DomainName *string @@ -1302,7 +1422,7 @@ type AwsCloudFrontDistributionOriginItem struct { } // A complex type that contains information about origins and origin groups for -// this distribution. +// this CloudFront distribution. type AwsCloudFrontDistributionOrigins struct { // A complex type that contains origins or origin groups for this distribution. @@ -1311,8 +1431,8 @@ type AwsCloudFrontDistributionOrigins struct { noSmithyDocumentSerde } -// Information about an origin that is an S3 bucket that is not configured with -// static website hosting. +// Information about an origin that is an Amazon S3 bucket that is not configured +// with static website hosting. type AwsCloudFrontDistributionOriginS3OriginConfig struct { // The CloudFront origin access identity to associate with the origin. @@ -1321,8 +1441,22 @@ type AwsCloudFrontDistributionOriginS3OriginConfig struct { noSmithyDocumentSerde } -// Provides information about the TLS/SSL configuration that the distribution uses -// to communicate with viewers. +// A complex type that contains information about the SSL/TLS protocols that +// CloudFront can use when establishing an HTTPS connection with your origin. +type AwsCloudFrontDistributionOriginSslProtocols struct { + + // A list that contains allowed SSL/TLS protocols for this distribution. + Items []string + + // The number of SSL/TLS protocols that you want to allow CloudFront to use when + // establishing an HTTPS connection with this origin. + Quantity int32 + + noSmithyDocumentSerde +} + +// Provides information about the TLS/SSL configuration that the CloudFront +// distribution uses to communicate with viewers. type AwsCloudFrontDistributionViewerCertificate struct { // The ARN of the ACM certificate. Used if the certificate is stored in ACM. If you @@ -1414,6 +1548,110 @@ type AwsCloudTrailTrailDetails struct { noSmithyDocumentSerde } +// Specifies an alarm and associates it with the specified metric or metric math +// expression. +type AwsCloudWatchAlarmDetails struct { + + // Indicates whether actions should be executed during any changes to the alarm + // state. + ActionsEnabled bool + + // The list of actions, specified as Amazon Resource Names (ARNs) to execute when + // this alarm transitions into an ALARM state from any other state. + AlarmActions []string + + // The ARN of the alarm. + AlarmArn *string + + // The time stamp of the last update to the alarm configuration. + AlarmConfigurationUpdatedTimestamp *string + + // The description of the alarm. + AlarmDescription *string + + // The name of the alarm. If you don't specify a name, CloudFront generates a + // unique physical ID and uses that ID for the alarm name. + AlarmName *string + + // The arithmetic operation to use when comparing the specified statistic and + // threshold. The specified statistic value is used as the first operand. + ComparisonOperator *string + + // The number of datapoints that must be breaching to trigger the alarm. + DatapointsToAlarm int32 + + // The dimensions for the metric associated with the alarm. + Dimensions []AwsCloudWatchAlarmDimensionsDetails + + // Used only for alarms based on percentiles. If ignore, the alarm state does not + // change during periods with too few data points to be statistically significant. + // If evaluate or this parameter is not used, the alarm is always evaluated and + // possibly changes state no matter how many data points are available. + EvaluateLowSampleCountPercentile *string + + // The number of periods over which data is compared to the specified threshold. + EvaluationPeriods int32 + + // The percentile statistic for the metric associated with the alarm. + ExtendedStatistic *string + + // The actions to execute when this alarm transitions to the INSUFFICIENT_DATA + // state from any other state. Each action is specified as an ARN. + InsufficientDataActions []string + + // The name of the metric associated with the alarm. This is required for an alarm + // based on a metric. For an alarm based on a math expression, you use Metrics + // instead and you can't specify MetricName. + MetricName *string + + // The namespace of the metric associated with the alarm. This is required for an + // alarm based on a metric. For an alarm based on a math expression, you can't + // specify Namespace and you use Metrics instead. + Namespace *string + + // The actions to execute when this alarm transitions to the OK state from any + // other state. Each action is specified as an ARN. + OkActions []string + + // The period, in seconds, over which the statistic is applied. This is required + // for an alarm based on a metric. + Period int32 + + // The statistic for the metric associated with the alarm, other than percentile. + // For percentile statistics, use ExtendedStatistic. For an alarm based on a + // metric, you must specify either Statistic or ExtendedStatistic but not both. For + // an alarm based on a math expression, you can't specify Statistic. Instead, you + // use Metrics. + Statistic *string + + // The value to compare with the specified statistic. + Threshold float64 + + // n an alarm based on an anomaly detection model, this is the ID of the + // ANOMALY_DETECTION_BAND function used as the threshold for the alarm. + ThresholdMetricId *string + + // Sets how this alarm is to handle missing data points. + TreatMissingData *string + + // The unit of the metric associated with the alarm. + Unit *string + + noSmithyDocumentSerde +} + +// Details about the dimensions for the metric associated with the alarm. +type AwsCloudWatchAlarmDimensionsDetails struct { + + // The name of a dimension. + Name *string + + // The value of a dimension. + Value *string + + noSmithyDocumentSerde +} + // Information about the build artifacts for the CodeBuild project. type AwsCodeBuildProjectArtifactsDetails struct { @@ -2066,7 +2304,7 @@ type AwsEc2EipDetails struct { noSmithyDocumentSerde } -// The details of an EC2 instance. +// The details of an Amazon EC2 instance. type AwsEc2InstanceDetails struct { // The IAM profile ARN of the instance. @@ -2090,6 +2328,9 @@ type AwsEc2InstanceDetails struct { // spaces. For example, 2020-03-22T13:22:13.933Z. LaunchedAt *string + // Details about the metadata options for the Amazon EC2 instance. + MetadataOptions *AwsEc2InstanceMetadataOptions + // The identifiers of the network interfaces for the EC2 instance. The details for // each network interface are in a corresponding AwsEc2NetworkInterfacesDetails // object. @@ -2101,13 +2342,39 @@ type AwsEc2InstanceDetails struct { // The instance type of the instance. Type *string + // The virtualization type of the Amazon Machine Image (AMI) required to launch the + // instance. + VirtualizationType *string + // The identifier of the VPC that the instance was launched in. VpcId *string noSmithyDocumentSerde } -// Identifies a network interface for the EC2 instance. +// Metadata options that allow you to configure and secure the Amazon EC2 instance. +type AwsEc2InstanceMetadataOptions struct { + + // Enables or disables the HTTP metadata endpoint on the instance. + HttpEndpoint *string + + // Enables or disables the IPv6 endpoint for the instance metadata service. + HttpProtocolIpv6 *string + + // The desired HTTP PUT response hop limit for instance metadata requests. The + // larger the number, the further instance metadata requests can travel. + HttpPutResponseHopLimit int32 + + // The state of token usage for your instance metadata requests. + HttpTokens *string + + // Specifies whether to allow access to instance tags from the instance metadata. + InstanceMetadataTags *string + + noSmithyDocumentSerde +} + +// Identifies a network interface for the Amazon EC2 instance. type AwsEc2InstanceNetworkInterfacesDetails struct { // The identifier of the network interface. The details are in a corresponding @@ -2132,7 +2399,7 @@ type AwsEc2NetworkAclAssociation struct { noSmithyDocumentSerde } -// Contains details about an EC2 network access control list (ACL). +// Contains details about an Amazon EC2 network access control list (ACL). type AwsEc2NetworkAclDetails struct { // Associations between the network ACL and subnets. @@ -2286,7 +2553,7 @@ type AwsEc2NetworkInterfaceSecurityGroup struct { noSmithyDocumentSerde } -// Details about an EC2 security group. +// Details about an Amazon EC2 security group. type AwsEc2SecurityGroupDetails struct { // The ID of the security group. @@ -2454,6 +2721,51 @@ type AwsEc2SubnetDetails struct { noSmithyDocumentSerde } +// Information about an Amazon Web Services Amazon EC2 Transit Gateway that +// interconnects virtual private clouds (VPCs) and on-premises networks. +type AwsEc2TransitGatewayDetails struct { + + // A private Autonomous System Number (ASN) for the Amazon side of a BGP session. + AmazonSideAsn int32 + + // The ID of the default association route table. + AssociationDefaultRouteTableId *string + + // Turn on or turn off automatic acceptance of attachment requests. + AutoAcceptSharedAttachments *string + + // Turn on or turn off automatic association with the default association route + // table. + DefaultRouteTableAssociation *string + + // Turn on or turn off automatic propagation of routes to the default propagation + // route table. + DefaultRouteTablePropagation *string + + // The description of the transit gateway. + Description *string + + // Turn on or turn off DNS support. + DnsSupport *string + + // The ID of the transit gateway. + Id *string + + // Indicates whether multicast is supported on the transit gateway. + MulticastSupport *string + + // The ID of the default propagation route table. + PropagationDefaultRouteTableId *string + + // The transit gateway Classless Inter-Domain Routing (CIDR) blocks. + TransitGatewayCidrBlocks []string + + // Turn on or turn off Equal Cost Multipath Protocol (ECMP) support. + VpnEcmpSupport *string + + noSmithyDocumentSerde +} + // An attachment to an Amazon EC2 volume. type AwsEc2VolumeAttachment struct { @@ -2484,7 +2796,10 @@ type AwsEc2VolumeDetails struct { // spaces. For example, 2020-03-22T13:22:13.933Z. CreateTime *string - // Whether the volume is encrypted. + // The device name for the volume that is attached to the instance. + DeviceName *string + + // Specifies whether the volume is encrypted. Encrypted bool // The ARN of the KMS key that was used to protect the volume encryption key for @@ -2500,6 +2815,15 @@ type AwsEc2VolumeDetails struct { // The volume state. Status *string + // The ID of the volume. + VolumeId *string + + // Indicates whether the volume was scanned or skipped. + VolumeScanStatus *string + + // The volume type. + VolumeType *string + noSmithyDocumentSerde } @@ -2572,6 +2896,69 @@ type AwsEc2VpcEndpointServiceServiceTypeDetails struct { noSmithyDocumentSerde } +// Provides information about a VPC peering connection between two VPCs: a +// requester VPC that you own and an accepter VPC with which to create the +// connection. +type AwsEc2VpcPeeringConnectionDetails struct { + + // Information about the accepter VPC. + AccepterVpcInfo *AwsEc2VpcPeeringConnectionVpcInfoDetails + + // The time at which an unaccepted VPC peering connection will expire. + ExpirationTime *string + + // Information about the requester VPC. + RequesterVpcInfo *AwsEc2VpcPeeringConnectionVpcInfoDetails + + // The status of the VPC peering connection. + Status *AwsEc2VpcPeeringConnectionStatusDetails + + // The ID of the VPC peering connection. + VpcPeeringConnectionId *string + + noSmithyDocumentSerde +} + +// Details about the status of the VPC peering connection. +type AwsEc2VpcPeeringConnectionStatusDetails struct { + + // The status of the VPC peering connection. + Code *string + + // A message that provides more information about the status, if applicable. + Message *string + + noSmithyDocumentSerde +} + +// Describes a VPC in a VPC peering connection. +type AwsEc2VpcPeeringConnectionVpcInfoDetails struct { + + // The IPv4 CIDR block for the VPC. + CidrBlock *string + + // Information about the IPv4 CIDR blocks for the VPC. + CidrBlockSet []VpcInfoCidrBlockSetDetails + + // The IPv6 CIDR block for the VPC. + Ipv6CidrBlockSet []VpcInfoIpv6CidrBlockSetDetails + + // The ID of the Amazon Web Services account that owns the VPC. + OwnerId *string + + // Information about the VPC peering connection options for the accepter or + // requester VPC. + PeeringOptions *VpcInfoPeeringOptionsDetails + + // The Amazon Web Services Region in which the VPC is located. + Region *string + + // The ID of the VPC. + VpcId *string + + noSmithyDocumentSerde +} + // Details about an Amazon EC2 VPN connection. type AwsEc2VpnConnectionDetails struct { @@ -2882,12 +3269,24 @@ type AwsEcsClusterDefaultCapacityProviderStrategyDetails struct { noSmithyDocumentSerde } -// provides details about an ECS cluster. +// Provides details about an Amazon ECS cluster. type AwsEcsClusterDetails struct { + // The number of services that are running on the cluster in an ACTIVE state. You + // can view these services with the Amazon ECS ListServices + // (https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ListServices.html) + // API operation. + ActiveServicesCount int32 + // The short name of one or more capacity providers to associate with the cluster. CapacityProviders []string + // The Amazon Resource Name (ARN) that identifies the cluster. + ClusterArn *string + + // A name that you use to identify your cluster. + ClusterName *string + // The setting to use to create the cluster. Specifically used to configure whether // to enable CloudWatch Container Insights for the cluster. ClusterSettings []AwsEcsClusterClusterSettingsDetails @@ -2900,6 +3299,35 @@ type AwsEcsClusterDetails struct { // launch type or capacity provider strategy. DefaultCapacityProviderStrategy []AwsEcsClusterDefaultCapacityProviderStrategyDetails + // The number of container instances registered into the cluster. This includes + // container instances in both ACTIVE and DRAINING status. + RegisteredContainerInstancesCount int32 + + // The number of tasks in the cluster that are in the RUNNING state. + RunningTasksCount int32 + + // The status of the cluster. + Status *string + + noSmithyDocumentSerde +} + +// Provides information about an Amazon ECS container. +type AwsEcsContainerDetails struct { + + // The image used for the container. + Image *string + + // The mount points for data volumes in your container. + MountPoints []AwsMountPoint + + // The name of the container. + Name *string + + // When this parameter is true, the container is given elevated privileges on the + // host container instance (similar to the root user). + Privileged bool + noSmithyDocumentSerde } @@ -3662,7 +4090,7 @@ type AwsEcsTaskDefinitionContainerDefinitionsVolumesFromDetails struct { noSmithyDocumentSerde } -// details about a task definition. A task definition describes the container and +// Details about a task definition. A task definition describes the container and // volume definitions of an Amazon Elastic Container Service task. type AwsEcsTaskDefinitionDetails struct { @@ -3856,6 +4284,148 @@ type AwsEcsTaskDefinitionVolumesHostDetails struct { noSmithyDocumentSerde } +// Provides details about a task in a cluster. +type AwsEcsTaskDetails struct { + + // The Amazon Resource Name (ARN) of the cluster that hosts the task. + ClusterArn *string + + // The containers that are associated with the task. + Containers []AwsEcsContainerDetails + + // The Unix timestamp for the time when the task was created. More specifically, + // it's for the time when the task entered the PENDING state. + CreatedAt *string + + // The name of the task group that's associated with the task. + Group *string + + // The Unix timestamp for the time when the task started. More specifically, it's + // for the time when the task transitioned from the PENDING state to the RUNNING + // state. + StartedAt *string + + // The tag specified when a task is started. If an Amazon ECS service started the + // task, the startedBy parameter contains the deployment ID of that service. + StartedBy *string + + // The ARN of the task definition that creates the task. + TaskDefinitionArn *string + + // The version counter for the task. + Version *string + + // Details about the data volume that is used in a task definition. + Volumes []AwsEcsTaskVolumeDetails + + noSmithyDocumentSerde +} + +// Provides information about a data volume that's used in a task definition. +type AwsEcsTaskVolumeDetails struct { + + // This parameter is specified when you use bind mount host volumes. The contents + // of the host parameter determine whether your bind mount host volume persists on + // the host container instance and where it's stored. + Host *AwsEcsTaskVolumeHostDetails + + // The name of the volume. Up to 255 letters (uppercase and lowercase), numbers, + // underscores, and hyphens are allowed. This name is referenced in the + // sourceVolume parameter of container definition mountPoints. + Name *string + + noSmithyDocumentSerde +} + +// Provides details on a container instance bind mount host volume. +type AwsEcsTaskVolumeHostDetails struct { + + // When the host parameter is used, specify a sourcePath to declare the path on the + // host container instance that's presented to the container. + SourcePath *string + + noSmithyDocumentSerde +} + +// Provides information about an Amazon EFS access point. +type AwsEfsAccessPointDetails struct { + + // The ID of the Amazon EFS access point. + AccessPointId *string + + // The Amazon Resource Name (ARN) of the Amazon EFS access point. + Arn *string + + // The opaque string specified in the request to ensure idempotent creation. + ClientToken *string + + // The ID of the Amazon EFS file system that the access point applies to. + FileSystemId *string + + // The full POSIX identity, including the user ID, group ID, and secondary group + // IDs on the access point, that is used for all file operations by NFS clients + // using the access point. + PosixUser *AwsEfsAccessPointPosixUserDetails + + // The directory on the Amazon EFS file system that the access point exposes as the + // root directory to NFS clients using the access point. + RootDirectory *AwsEfsAccessPointRootDirectoryDetails + + noSmithyDocumentSerde +} + +// Provides details for all file system operations using this Amazon EFS access +// point. +type AwsEfsAccessPointPosixUserDetails struct { + + // The POSIX group ID used for all file system operations using this access point. + Gid *string + + // Secondary POSIX group IDs used for all file system operations using this access + // point. + SecondaryGids []string + + // The POSIX user ID used for all file system operations using this access point. + Uid *string + + noSmithyDocumentSerde +} + +// Provides information about the settings that Amazon EFS uses to create the root +// directory when a client connects to an access point. +type AwsEfsAccessPointRootDirectoryCreationInfoDetails struct { + + // Specifies the POSIX group ID to apply to the root directory. + OwnerGid *string + + // Specifies the POSIX user ID to apply to the root directory. + OwnerUid *string + + // Specifies the POSIX permissions to apply to the root directory, in the format of + // an octal number representing the file's mode bits. + Permissions *string + + noSmithyDocumentSerde +} + +// Provides information about the directory on the Amazon EFS file system that the +// access point exposes as the root directory to NFS clients using the access +// point. +type AwsEfsAccessPointRootDirectoryDetails struct { + + // Specifies the POSIX IDs and permissions to apply to the access point's root + // directory. + CreationInfo *AwsEfsAccessPointRootDirectoryCreationInfoDetails + + // Specifies the path on the Amazon EFS file system to expose as the root directory + // to NFS clients using the access point to access the EFS file system. A path can + // have up to four subdirectories. If the specified path does not exist, you are + // required to provide CreationInfo. + Path *string + + noSmithyDocumentSerde +} + // Provides details about an Amazon EKS cluster. type AwsEksClusterDetails struct { @@ -4961,6 +5531,44 @@ type AwsIamUserPolicy struct { noSmithyDocumentSerde } +// Provides information about an Amazon Kinesis data stream. +type AwsKinesisStreamDetails struct { + + // The Amazon Resource Name (ARN) of the Kinesis data stream. + Arn *string + + // The name of the Kinesis stream. If you don't specify a name, CloudFront + // generates a unique physical ID and uses that ID for the stream name. + Name *string + + // The number of hours for the data records that are stored in shards to remain + // accessible. + RetentionPeriodHours int32 + + // The number of shards that the stream uses. + ShardCount int32 + + // When specified, enables or updates server-side encryption using an KMS key for a + // specified stream. Removing this property from your stack template and updating + // your stack disables encryption. + StreamEncryption *AwsKinesisStreamStreamEncryptionDetails + + noSmithyDocumentSerde +} + +// Provides information about stream encryption. +type AwsKinesisStreamStreamEncryptionDetails struct { + + // The encryption type to use. + EncryptionType *string + + // The globally unique identifier for the customer-managed KMS key to use for + // encryption. + KeyId *string + + noSmithyDocumentSerde +} + // Contains metadata about an KMS key. type AwsKmsKeyDetails struct { @@ -4974,7 +5582,7 @@ type AwsKmsKeyDetails struct { // spaces. For example, 2020-03-22T13:22:13.933Z. CreationDate float64 - // A description of the key. + // A description of the KMS key. Description *string // The globally unique identifier for the KMS key. @@ -5175,6 +5783,19 @@ type AwsLambdaLayerVersionDetails struct { noSmithyDocumentSerde } +// Details for a volume mount point that's used in a container definition. +type AwsMountPoint struct { + + // The path on the container to mount the host volume at. + ContainerPath *string + + // The name of the volume to mount. Must be a volume name referenced in the name + // parameter of task definition volume. + SourceVolume *string + + noSmithyDocumentSerde +} + // Details about an Network Firewall firewall. type AwsNetworkFirewallFirewallDetails struct { @@ -5276,6 +5897,21 @@ type AwsNetworkFirewallRuleGroupDetails struct { noSmithyDocumentSerde } +// Provides information about domain access control options. +type AwsOpenSearchServiceDomainAdvancedSecurityOptionsDetails struct { + + // Enables fine-grained access control. + Enabled bool + + // Enables the internal user database. + InternalUserDatabaseEnabled bool + + // Specifies information about the master user of the domain. + MasterUserOptions *AwsOpenSearchServiceDomainMasterUserOptionsDetails + + noSmithyDocumentSerde +} + // Details about the configuration of an OpenSearch cluster. type AwsOpenSearchServiceDomainClusterConfigDetails struct { @@ -5337,6 +5973,9 @@ type AwsOpenSearchServiceDomainDetails struct { // Service domain. AccessPolicies *string + // Specifies options for fine-grained access control. + AdvancedSecurityOptions *AwsOpenSearchServiceDomainAdvancedSecurityOptionsDetails + // The ARN of the OpenSearch Service domain. Arn *string @@ -5442,6 +6081,21 @@ type AwsOpenSearchServiceDomainLogPublishingOptionsDetails struct { noSmithyDocumentSerde } +// Specifies information about the master user of the domain. +type AwsOpenSearchServiceDomainMasterUserOptionsDetails struct { + + // The Amazon Resource Name (ARN) for the master user. + MasterUserArn *string + + // The username for the master user. + MasterUserName *string + + // The password for the master user. + MasterUserPassword *string + + noSmithyDocumentSerde +} + // Provides details about the configuration for node-to-node encryption. type AwsOpenSearchServiceDomainNodeToNodeEncryptionOptionsDetails struct { @@ -7562,6 +8216,10 @@ type AwsSecurityFinding struct { // Threat intelligence details related to a finding. ThreatIntelIndicators []ThreatIntelIndicator + // Details about the threat detected in a security finding and the file paths that + // were affected by the threat. + Threats []Threat + // One or more finding types in the format of namespace/category/classifier that // classify a finding. Valid namespace values are: Software and Configuration // Checks | TTPs | Effects | Unusual Behaviors | Sensitive Data Identifications @@ -7993,9 +8651,30 @@ type AwsSecurityFindingIdentifier struct { noSmithyDocumentSerde } -// A wrapper type for the topic's ARN. +// Provides information about an Amazon SNS topic to which notifications can be +// published. type AwsSnsTopicDetails struct { + // Indicates failed message delivery status for an Amazon SNS topic that is + // subscribed to a platform application endpoint. + ApplicationSuccessFeedbackRoleArn *string + + // Indicates failed message delivery status for an Amazon SNS topic that is + // subscribed to an Amazon Kinesis Data Firehose endpoint. + FirehoseFailureFeedbackRoleArn *string + + // Indicates successful message delivery status for an Amazon SNS topic that is + // subscribed to an Amazon Kinesis Data Firehose endpoint. + FirehoseSuccessFeedbackRoleArn *string + + // Indicates failed message delivery status for an Amazon SNS topic that is + // subscribed to an HTTP endpoint. + HttpFailureFeedbackRoleArn *string + + // Indicates successful message delivery status for an Amazon SNS topic that is + // subscribed to an HTTP endpoint. + HttpSuccessFeedbackRoleArn *string + // The ID of an Amazon Web Services managed key for Amazon SNS or a customer // managed key. KmsMasterKeyId *string @@ -8003,11 +8682,19 @@ type AwsSnsTopicDetails struct { // The subscription's owner. Owner *string + // Indicates failed message delivery status for an Amazon SNS topic that is + // subscribed to an Amazon SQS endpoint. + SqsFailureFeedbackRoleArn *string + + // Indicates successful message delivery status for an Amazon SNS topic that is + // subscribed to an Amazon SQS endpoint. + SqsSuccessFeedbackRoleArn *string + // Subscription is an embedded property that describes the subscription endpoints - // of an SNS topic. + // of an Amazon SNS topic. Subscription []AwsSnsTopicSubscription - // The name of the topic. + // The name of the Amazon SNS topic. TopicName *string noSmithyDocumentSerde @@ -8238,27 +8925,287 @@ type AwsWafRegionalRateBasedRuleMatchPredicate struct { noSmithyDocumentSerde } -// Details about an WAF WebACL. +// Provides information about an WAF Regional rule. This rule identifies the web +// requests that you want to allow, block, or count. +type AwsWafRegionalRuleDetails struct { + + // A name for the metrics for the rule. + MetricName *string + + // A descriptive name for the rule. + Name *string + + // Specifies the ByteMatchSet, IPSet, SqlInjectionMatchSet, XssMatchSet, + // RegexMatchSet, GeoMatchSet, and SizeConstraintSet objects that you want to add + // to a rule and, for each object, indicates whether you want to negate the + // settings. + PredicateList []AwsWafRegionalRulePredicateListDetails + + // The ID of the rule. + RuleId *string + + noSmithyDocumentSerde +} + +// Provides information about an WAF Regional rule group. The rule group is a +// collection of rules for inspecting and controlling web requests. +type AwsWafRegionalRuleGroupDetails struct { + + // A name for the metrics for this rule group. + MetricName *string + + // The descriptive name of the rule group. + Name *string + + // The ID of the rule group. + RuleGroupId *string + + // Provides information about the rule statements used to identify the web requests + // that you want to allow, block, or count. + Rules []AwsWafRegionalRuleGroupRulesDetails + + noSmithyDocumentSerde +} + +// Describes the action that AWS WAF should take on a web request when it matches +// the criteria defined in the rule. +type AwsWafRegionalRuleGroupRulesActionDetails struct { + + // Specifies the ByteMatchSet, IPSet, SqlInjectionMatchSet, XssMatchSet, + // RegexMatchSet, GeoMatchSet, and SizeConstraintSet objects that you want to add + // to a rule and, for each object, indicates whether you want to negate the + // settings. + Type *string + + noSmithyDocumentSerde +} + +// Provides information about the rules attached to a rule group +type AwsWafRegionalRuleGroupRulesDetails struct { + + // The action that WAF should take on a web request when it matches the criteria + // defined in the rule. + Action *AwsWafRegionalRuleGroupRulesActionDetails + + // If you define more than one rule in a web ACL, WAF evaluates each request + // against the rules in order based on the value of Priority. + Priority int32 + + // The ID for a rule. + RuleId *string + + // The type of rule in the rule group. + Type *string + + noSmithyDocumentSerde +} + +// Provides details about the ByteMatchSet, IPSet, SqlInjectionMatchSet, +// XssMatchSet, RegexMatchSet, GeoMatchSet, and SizeConstraintSet objects that you +// want to add to a rule and, for each object, indicates whether you want to negate +// the settings. +type AwsWafRegionalRulePredicateListDetails struct { + + // A unique identifier for a predicate in a rule, such as ByteMatchSetId or + // IPSetId. + DataId *string + + // Specifies if you want WAF to allow, block, or count requests based on the + // settings in the ByteMatchSet, IPSet, SqlInjectionMatchSet, XssMatchSet, + // RegexMatchSet, GeoMatchSet, or SizeConstraintSet. + Negated bool + + // The type of predicate in a rule, such as ByteMatch or IPSet. + Type *string + + noSmithyDocumentSerde +} + +// Provides information about the web access control list (web ACL). The web ACL +// contains the rules that identify the requests that you want to allow, block, or +// count. +type AwsWafRegionalWebAclDetails struct { + + // The action to perform if none of the rules contained in the web ACL match. + DefaultAction *string + + // A name for the metrics for this web ACL. + MetricName *string + + // A descriptive name for the web ACL. + Name *string + + // An array that contains the action for each rule in a web ACL, the priority of + // the rule, and the ID of the rule. + RulesList []AwsWafRegionalWebAclRulesListDetails + + // The ID of the web ACL. + WebAclId *string + + noSmithyDocumentSerde +} + +// The action that WAF takes when a web request matches all conditions in the rule, +// such as allow, block, or count the request. +type AwsWafRegionalWebAclRulesListActionDetails struct { + + // For actions that are associated with a rule, the action that WAF takes when a + // web request matches all conditions in a rule. + Type *string + + noSmithyDocumentSerde +} + +// A combination of ByteMatchSet, IPSet, and/or SqlInjectionMatchSet objects that +// identify the web requests that you want to allow, block, or count. +type AwsWafRegionalWebAclRulesListDetails struct { + + // The action that AWS WAF takes when a web request matches all conditions in the + // rule, such as allow, block, or count the request. + Action *AwsWafRegionalWebAclRulesListActionDetails + + // Overrides the rule evaluation result in the rule group. + OverrideAction *AwsWafRegionalWebAclRulesListOverrideActionDetails + + // The order in which WAF evaluates the rules in a web ACL. + Priority int32 + + // The ID of an WAF Regional rule to associate with a web ACL. + RuleId *string + + // For actions that are associated with a rule, the action that WAF takes when a + // web request matches all conditions in a rule. + Type *string + + noSmithyDocumentSerde +} + +// Provides details about the action to use in the place of the action that results +// from the rule group evaluation. +type AwsWafRegionalWebAclRulesListOverrideActionDetails struct { + + // Overrides the rule evaluation result in the rule group. + Type *string + + noSmithyDocumentSerde +} + +// Provides information about a WAF rule. This rule specifies the web requests that +// you want to allow, block, or count. +type AwsWafRuleDetails struct { + + // The name of the metrics for this rule. + MetricName *string + + // A descriptive name for the rule. + Name *string + + // Specifies the ByteMatchSet, IPSet, SqlInjectionMatchSet, XssMatchSet, + // RegexMatchSet, GeoMatchSet, and SizeConstraintSet objects that you want to add + // to a rule and, for each object, indicates whether you want to negate the + // settings. + PredicateList []AwsWafRulePredicateListDetails + + // The ID of the WAF rule. + RuleId *string + + noSmithyDocumentSerde +} + +// Provides information about an WAF rule group. A rule group is a collection of +// rules for inspecting and controlling web requests. +type AwsWafRuleGroupDetails struct { + + // The name of the metrics for this rule group. + MetricName *string + + // The name of the rule group. + Name *string + + // The ID of the rule group. + RuleGroupId *string + + // Provides information about the rules attached to the rule group. These rules + // identify the web requests that you want to allow, block, or count. + Rules []AwsWafRuleGroupRulesDetails + + noSmithyDocumentSerde +} + +// Provides information about what action WAF should take on a web request when it +// matches the criteria defined in the rule. +type AwsWafRuleGroupRulesActionDetails struct { + + // The action that WAF should take on a web request when it matches the rule's + // statement. + Type *string + + noSmithyDocumentSerde +} + +// Provides information about the rules attached to the rule group. These rules +// identify the web requests that you want to allow, block, or count. +type AwsWafRuleGroupRulesDetails struct { + + // Provides information about what action WAF should take on a web request when it + // matches the criteria defined in the rule. + Action *AwsWafRuleGroupRulesActionDetails + + // If you define more than one rule in a web ACL, WAF evaluates each request + // against the rules in order based on the value of Priority. + Priority int32 + + // The rule ID for a rule. + RuleId *string + + // The type of rule. + Type *string + + noSmithyDocumentSerde +} + +// Provides details about the ByteMatchSet, IPSet, SqlInjectionMatchSet, +// XssMatchSet, RegexMatchSet, GeoMatchSet, and SizeConstraintSet objects that you +// want to add to a rule and, for each object, indicates whether you want to negate +// the settings. +type AwsWafRulePredicateListDetails struct { + + // A unique identifier for a predicate in a rule, such as ByteMatchSetId or + // IPSetId. + DataId *string + + // Specifies if you want WAF to allow, block, or count requests based on the + // settings in the ByteMatchSet, IPSet, SqlInjectionMatchSet, XssMatchSet, + // RegexMatchSet, GeoMatchSet, or SizeConstraintSet. + Negated bool + + // The type of predicate in a rule, such as ByteMatch or IPSet. + Type *string + + noSmithyDocumentSerde +} + +// Provides information about an WAF web access control list (web ACL). type AwsWafWebAclDetails struct { - // The action to perform if none of the rules contained in the WebACL match. + // The action to perform if none of the rules contained in the web ACL match. DefaultAction *string - // A friendly name or description of the WebACL. You can't change the name of a - // WebACL after you create it. + // A friendly name or description of the web ACL. You can't change the name of a + // web ACL after you create it. Name *string - // An array that contains the action for each rule in a WebACL, the priority of the - // rule, and the ID of the rule. + // An array that contains the action for each rule in a web ACL, the priority of + // the rule, and the ID of the rule. Rules []AwsWafWebAclRule - // A unique identifier for a WebACL. + // A unique identifier for a web ACL. WebAclId *string noSmithyDocumentSerde } -// Details for a rule in an WAF WebACL. +// Details for a rule in an WAF web ACL. type AwsWafWebAclRule struct { // Specifies the action that CloudFront or WAF takes when a web request matches the @@ -8276,13 +9223,13 @@ type AwsWafWebAclRule struct { // overrides any block action specified by individual rules contained within the // group. Instead of blocking matching requests, those requests are counted. // ActivatedRule|OverrideAction applies only when updating or adding a RuleGroup to - // a WebACL. In this case you do not use ActivatedRule|Action. For all other update - // requests, ActivatedRule|Action is used instead of ActivatedRule|OverrideAction. + // a web ACL. In this case you do not use ActivatedRuleAction. For all other update + // requests, ActivatedRuleAction is used instead of ActivatedRuleOverrideAction. OverrideAction *WafOverrideAction - // Specifies the order in which the rules in a WebACL are evaluated. Rules with a + // Specifies the order in which the rules in a web ACL are evaluated. Rules with a // lower value for Priority are evaluated before rules with a higher value. The - // value must be a unique integer. If you add multiple rules to a WebACL, the + // value must be a unique integer. If you add multiple rules to a web ACL, the // values do not need to be consecutive. Priority int32 @@ -8473,10 +9420,13 @@ type Compliance struct { // Container details related to a finding. type ContainerDetails struct { - // The identifier of the image related to a finding. + // The runtime of the container. + ContainerRuntime *string + + // The identifier of the container image related to a finding. ImageId *string - // The name of the image related to a finding. + // The name of the container image related to a finding. ImageName *string // Indicates when the container started. Uses the date-time format specified in RFC @@ -8488,6 +9438,13 @@ type ContainerDetails struct { // The name of the container related to a finding. Name *string + // When this parameter is true, the container is given elevated privileges on the + // host container instance (similar to the root user). + Privileged bool + + // Provides information about the mounting of a volume in a container. + VolumeMounts []VolumeMount + noSmithyDocumentSerde } @@ -8610,6 +9567,24 @@ type DnsRequestAction struct { noSmithyDocumentSerde } +// Provides information about the file paths that were affected by the threat. +type FilePaths struct { + + // The name of the infected or suspicious file corresponding to the hash. + FileName *string + + // Path to the infected or suspicious file on the resource it was detected on. + FilePath *string + + // The hash value for the infected or suspicious file. + Hash *string + + // The Amazon Resource Name (ARN) of the resource on which the threat was detected. + ResourceId *string + + noSmithyDocumentSerde +} + // A finding aggregator. A finding aggregator contains the configuration for // finding aggregation. type FindingAggregator struct { @@ -9583,12 +10558,21 @@ type ResourceDetails struct { // Provides details about an Certificate Manager certificate. AwsCertificateManagerCertificate *AwsCertificateManagerCertificateDetails + // Details about an CloudFormation stack. A stack is a collection of Amazon Web + // Services resources that you can manage as a single unit. + AwsCloudFormationStack *AwsCloudFormationStackDetails + // Details about a CloudFront distribution. AwsCloudFrontDistribution *AwsCloudFrontDistributionDetails // Provides details about a CloudTrail trail. AwsCloudTrailTrail *AwsCloudTrailTrailDetails + // Details about an Amazon CloudWatch alarm. An alarm allows you to monitor and + // receive alerts about your Amazon Web Services resources and applications across + // multiple Regions. + AwsCloudWatchAlarm *AwsCloudWatchAlarmDetails + // Details for an CodeBuild project. AwsCodeBuildProject *AwsCodeBuildProjectDetails @@ -9613,16 +10597,25 @@ type ResourceDetails struct { // Details about a subnet in Amazon EC2. AwsEc2Subnet *AwsEc2SubnetDetails - // Details for an EC2 volume. + // Details about an Amazon EC2 transit gateway that interconnects your virtual + // private clouds (VPC) and on-premises networks. + AwsEc2TransitGateway *AwsEc2TransitGatewayDetails + + // Details for an Amazon EC2 volume. AwsEc2Volume *AwsEc2VolumeDetails - // Details for an EC2 VPC. + // Details for an Amazon EC2 VPC. AwsEc2Vpc *AwsEc2VpcDetails // Details about the service configuration for a VPC endpoint service. AwsEc2VpcEndpointService *AwsEc2VpcEndpointServiceDetails - // Details about an EC2 VPN connection. + // Details about an Amazon EC2 VPC peering connection. A VPC peering connection is + // a networking connection between two VPCs that enables you to route traffic + // between them privately. + AwsEc2VpcPeeringConnection *AwsEc2VpcPeeringConnectionDetails + + // Details about an Amazon EC2 VPN connection. AwsEc2VpnConnection *AwsEc2VpnConnectionDetails // Information about an Amazon ECR image. @@ -9631,16 +10624,28 @@ type ResourceDetails struct { // Information about an Amazon Elastic Container Registry repository. AwsEcrRepository *AwsEcrRepositoryDetails - // Details about an ECS cluster. + // Details about an Amazon ECS cluster. AwsEcsCluster *AwsEcsClusterDetails + // Provides information about a Docker container that's part of a task. + AwsEcsContainer *AwsEcsContainerDetails + // Details about a service within an ECS cluster. AwsEcsService *AwsEcsServiceDetails + // Details about a task in a cluster. + AwsEcsTask *AwsEcsTaskDetails + // Details about a task definition. A task definition describes the container and // volume definitions of an Amazon Elastic Container Service task. AwsEcsTaskDefinition *AwsEcsTaskDefinitionDetails + // Details about an Amazon EFS access point. An access point is an + // application-specific view into an EFS file system that applies an operating + // system user and group, and a file system path, to any file system request made + // through the access point. + AwsEfsAccessPoint *AwsEfsAccessPointDetails + // Details about an Amazon EKS cluster. AwsEksCluster *AwsEksClusterDetails @@ -9671,6 +10676,9 @@ type ResourceDetails struct { // Details about an IAM user. AwsIamUser *AwsIamUserDetails + // Details about an Amazon Kinesis data stream. + AwsKinesisStream *AwsKinesisStreamDetails + // Details about an KMS key. AwsKmsKey *AwsKmsKeyDetails @@ -9741,7 +10749,22 @@ type ResourceDetails struct { // Details about a rate-based rule for Regional resources. AwsWafRegionalRateBasedRule *AwsWafRegionalRateBasedRuleDetails - // Details for an WAF WebACL. + // Details about an WAF rule for Regional resources. + AwsWafRegionalRule *AwsWafRegionalRuleDetails + + // Details about an WAF rule group for Regional resources. + AwsWafRegionalRuleGroup *AwsWafRegionalRuleGroupDetails + + // Details about an WAF web access control list (web ACL) for Regional resources. + AwsWafRegionalWebAcl *AwsWafRegionalWebAclDetails + + // Details about an WAF rule for global resources. + AwsWafRule *AwsWafRuleDetails + + // Details about an WAF rule group for global resources. + AwsWafRuleGroup *AwsWafRuleGroupDetails + + // Details for an WAF web ACL. AwsWafWebAcl *AwsWafWebAclDetails // Information about the encryption configuration for X-Ray. @@ -10485,6 +11508,25 @@ type StringFilter struct { noSmithyDocumentSerde } +// Provides information about the threat detected in a security finding and the +// file paths that were affected by the threat. +type Threat struct { + + // Provides information about the file paths that were affected by the threat. + FilePaths []FilePaths + + // This total number of items in which the threat has been detected. + ItemCount int32 + + // The name of the threat. + Name *string + + // The severity of the threat. + Severity *string + + noSmithyDocumentSerde +} + // Details about the threat intelligence related to a finding. type ThreatIntelIndicator struct { @@ -10513,6 +11555,55 @@ type ThreatIntelIndicator struct { noSmithyDocumentSerde } +// Describes the mounting of a volume in a container. +type VolumeMount struct { + + // The path in the container at which the volume should be mounted. + MountPath *string + + // The name of the volume. + Name *string + + noSmithyDocumentSerde +} + +// Provides details about the IPv4 CIDR blocks for the VPC. +type VpcInfoCidrBlockSetDetails struct { + + // The IPv4 CIDR block for the VPC. + CidrBlock *string + + noSmithyDocumentSerde +} + +// Provides details about the IPv6 CIDR blocks for the VPC. +type VpcInfoIpv6CidrBlockSetDetails struct { + + // The IPv6 CIDR block for the VPC. + Ipv6CidrBlock *string + + noSmithyDocumentSerde +} + +// Provides information about the VPC peering connection options for the accepter +// or requester VPC. +type VpcInfoPeeringOptionsDetails struct { + + // Indicates whether a local VPC can resolve public DNS hostnames to private IP + // addresses when queried from instances in a peer VPC. + AllowDnsResolutionFromRemoteVpc bool + + // Indicates whether a local ClassicLink connection can communicate with the peer + // VPC over the VPC peering connection. + AllowEgressFromLocalClassicLinkToRemoteVpc bool + + // Indicates whether a local VPC can communicate with a ClassicLink connection in + // the peer VPC over the VPC peering connection. + AllowEgressFromLocalVpcToRemoteClassicLink bool + + noSmithyDocumentSerde +} + // A vulnerability associated with a finding. type Vulnerability struct { @@ -10583,7 +11674,7 @@ type WafAction struct { // * COUNT - WAF increments a counter of the requests // that match all of the conditions in the rule. WAF then continues to inspect the // web request based on the remaining rules in the web ACL. You can't specify COUNT - // for the default action for a WebACL. + // for the default action for a web ACL. Type *string noSmithyDocumentSerde diff --git a/service/sso/internal/endpoints/endpoints.go b/service/sso/internal/endpoints/endpoints.go index 0cbce75fb19..2e81aa0bb58 100644 --- a/service/sso/internal/endpoints/endpoints.go +++ b/service/sso/internal/endpoints/endpoints.go @@ -207,6 +207,14 @@ var defaultPartitions = endpoints.Partitions{ Region: "eu-north-1", }, }, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{ + Hostname: "portal.sso.eu-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-south-1", + }, + }, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{ diff --git a/service/wafv2/internal/endpoints/endpoints.go b/service/wafv2/internal/endpoints/endpoints.go index fbf18ee756e..dd0cf294f7d 100644 --- a/service/wafv2/internal/endpoints/endpoints.go +++ b/service/wafv2/internal/endpoints/endpoints.go @@ -134,6 +134,580 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.Aws, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "af-south-1", + }: endpoints.Endpoint{ + Hostname: "wafv2.af-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "af-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "af-south-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.af-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "af-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-east-1", + }: endpoints.Endpoint{ + Hostname: "wafv2.ap-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.ap-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{ + Hostname: "wafv2.ap-northeast-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.ap-northeast-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{ + Hostname: "wafv2.ap-northeast-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-2", + }, + }, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.ap-northeast-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-2", + }, + }, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{ + Hostname: "wafv2.ap-northeast-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-3", + }, + }, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.ap-northeast-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-3", + }, + }, + endpoints.EndpointKey{ + Region: "ap-south-1", + }: endpoints.Endpoint{ + Hostname: "wafv2.ap-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-south-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.ap-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{ + Hostname: "wafv2.ap-southeast-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.ap-southeast-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-1", + }, + }, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{ + Hostname: "wafv2.ap-southeast-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-2", + }, + }, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.ap-southeast-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-2", + }, + }, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{ + Hostname: "wafv2.ap-southeast-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-3", + }, + }, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.ap-southeast-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-3", + }, + }, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{ + Hostname: "wafv2.ca-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-central-1", + }, + }, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.ca-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-central-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{ + Hostname: "wafv2.eu-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-central-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.eu-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-north-1", + }: endpoints.Endpoint{ + Hostname: "wafv2.eu-north-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-north-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-north-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.eu-north-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-north-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{ + Hostname: "wafv2.eu-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-south-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.eu-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{ + Hostname: "wafv2.eu-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-west-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.eu-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-west-1", + }, + }, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{ + Hostname: "wafv2.eu-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-west-2", + }, + }, + endpoints.EndpointKey{ + Region: "eu-west-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.eu-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-west-2", + }, + }, + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{ + Hostname: "wafv2.eu-west-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-west-3", + }, + }, + endpoints.EndpointKey{ + Region: "eu-west-3", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.eu-west-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-west-3", + }, + }, + endpoints.EndpointKey{ + Region: "fips-af-south-1", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.af-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "af-south-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-ap-east-1", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.ap-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-ap-northeast-1", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.ap-northeast-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-ap-northeast-2", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.ap-northeast-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-2", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-ap-northeast-3", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.ap-northeast-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-northeast-3", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-ap-south-1", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.ap-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-south-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-ap-southeast-1", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.ap-southeast-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-ap-southeast-2", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.ap-southeast-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-2", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-ap-southeast-3", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.ap-southeast-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ap-southeast-3", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-ca-central-1", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.ca-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "ca-central-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-eu-central-1", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.eu-central-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-central-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-eu-north-1", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.eu-north-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-north-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-eu-south-1", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.eu-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-south-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-eu-west-1", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.eu-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-eu-west-2", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.eu-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-west-2", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-eu-west-3", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.eu-west-3.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "eu-west-3", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-me-south-1", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.me-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "me-south-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-sa-east-1", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.sa-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "sa-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-east-1", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-east-2", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.us-east-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-2", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-west-1", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.us-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-west-2", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.us-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "me-south-1", + }: endpoints.Endpoint{ + Hostname: "wafv2.me-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "me-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "me-south-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.me-south-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "me-south-1", + }, + }, + endpoints.EndpointKey{ + Region: "sa-east-1", + }: endpoints.Endpoint{ + Hostname: "wafv2.sa-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "sa-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "sa-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.sa-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "sa-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{ + Hostname: "wafv2.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-east-2", + }: endpoints.Endpoint{ + Hostname: "wafv2.us-east-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-2", + }, + }, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.us-east-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-2", + }, + }, + endpoints.EndpointKey{ + Region: "us-west-1", + }: endpoints.Endpoint{ + Hostname: "wafv2.us-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.us-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{ + Hostname: "wafv2.us-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + }, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.us-west-2.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-west-2", + }, + }, + }, }, { ID: "aws-cn", @@ -169,6 +743,60 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.AwsCn, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "cn-north-1", + }: endpoints.Endpoint{ + Hostname: "wafv2.cn-north-1.amazonaws.com.cn", + CredentialScope: endpoints.CredentialScope{ + Region: "cn-north-1", + }, + }, + endpoints.EndpointKey{ + Region: "cn-north-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.cn-north-1.amazonaws.com.cn", + CredentialScope: endpoints.CredentialScope{ + Region: "cn-north-1", + }, + }, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + }: endpoints.Endpoint{ + Hostname: "wafv2.cn-northwest-1.amazonaws.com.cn", + CredentialScope: endpoints.CredentialScope{ + Region: "cn-northwest-1", + }, + }, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.cn-northwest-1.amazonaws.com.cn", + CredentialScope: endpoints.CredentialScope{ + Region: "cn-northwest-1", + }, + }, + endpoints.EndpointKey{ + Region: "fips-cn-north-1", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.cn-north-1.amazonaws.com.cn", + CredentialScope: endpoints.CredentialScope{ + Region: "cn-north-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-cn-northwest-1", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.cn-northwest-1.amazonaws.com.cn", + CredentialScope: endpoints.CredentialScope{ + Region: "cn-northwest-1", + }, + Deprecated: aws.TrueTernary, + }, + }, }, { ID: "aws-iso", @@ -246,5 +874,59 @@ var defaultPartitions = endpoints.Partitions{ }, RegionRegex: partitionRegexp.AwsUsGov, IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "fips-us-gov-east-1", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "fips-us-gov-west-1", + }: endpoints.Endpoint{ + Hostname: "wafv2-fips.us-gov-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-west-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + }: endpoints.Endpoint{ + Hostname: "wafv2.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-gov-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.us-gov-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-east-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + }: endpoints.Endpoint{ + Hostname: "wafv2.us-gov-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-west-1", + }, + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "wafv2-fips.us-gov-west-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-gov-west-1", + }, + }, + }, }, }