From 6da6aab277744138ab50aeaf5016ce9ca0370983 Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Wed, 15 Feb 2023 19:59:11 +0000 Subject: [PATCH] Regenerated Clients --- .../0376934a30b54310a1c42f0f62df2e76.json | 8 + .../3c2f156b8d8a49d3bf40e573cb13e19e.json | 8 + .../7650d89aa5d0448d862c432c8aaa72a6.json | 8 + .../8a5120b35c0049c58d7ad097102f6a50.json | 8 + .../d14c5d419bf14ff5a94f6b456461d860.json | 8 + .../f4cba4239d9d43569b9d127ceb841fd0.json | 8 + .../f71832c247bf4731ae1f5a364505b5aa.json | 8 + service/cloudtrail/deserializers.go | 3 + service/efs/api_op_CreateAccessPoint.go | 2 +- service/efs/api_op_CreateFileSystem.go | 4 +- .../api_op_CreateReplicationConfiguration.go | 26 +- service/efs/api_op_UpdateFileSystem.go | 4 +- service/efs/types/types.go | 6 +- service/frauddetector/api_op_CreateList.go | 136 +++ service/frauddetector/api_op_DeleteList.go | 118 ++ .../frauddetector/api_op_GetListElements.go | 220 ++++ .../frauddetector/api_op_GetListsMetadata.go | 217 ++++ service/frauddetector/api_op_UpdateList.go | 142 +++ service/frauddetector/deserializers.go | 1041 ++++++++++++++++- service/frauddetector/generated.json | 5 + service/frauddetector/serializers.go | 412 +++++++ service/frauddetector/types/enums.go | 20 + service/frauddetector/types/types.go | 26 + service/frauddetector/validators.go | 161 +++ service/glue/deserializers.go | 90 ++ service/glue/serializers.go | 44 + service/glue/types/enums.go | 24 + service/glue/types/types.go | 37 + service/glue/validators.go | 32 + .../guardduty/internal/endpoints/endpoints.go | 3 + .../api_op_StartNetworkResourceUpdate.go | 147 +++ service/privatenetworks/deserializers.go | 227 ++++ service/privatenetworks/generated.json | 1 + service/privatenetworks/serializers.go | 85 ++ service/privatenetworks/types/enums.go | 36 +- service/privatenetworks/types/types.go | 25 + service/privatenetworks/validators.go | 47 + service/rds/api_op_CancelExportTask.go | 78 +- service/rds/api_op_CopyDBClusterSnapshot.go | 2 +- service/rds/api_op_CreateDBCluster.go | 11 +- .../api_op_CreateDBClusterParameterGroup.go | 2 +- service/rds/api_op_CreateDBClusterSnapshot.go | 2 +- .../rds/api_op_CreateDBInstanceReadReplica.go | 4 +- .../rds/api_op_DeleteBlueGreenDeployment.go | 3 + service/rds/api_op_DeleteDBCluster.go | 2 +- .../api_op_DeleteDBClusterParameterGroup.go | 2 +- service/rds/api_op_DeleteDBClusterSnapshot.go | 2 +- ...api_op_DescribeDBClusterParameterGroups.go | 2 +- .../rds/api_op_DescribeDBClusterParameters.go | 2 +- .../rds/api_op_DescribeDBClusterSnapshots.go | 2 +- service/rds/api_op_DescribeDBClusters.go | 2 +- service/rds/api_op_DescribeExportTasks.go | 40 +- service/rds/api_op_FailoverDBCluster.go | 2 +- service/rds/api_op_ModifyActivityStream.go | 8 +- service/rds/api_op_ModifyDBCluster.go | 2 +- .../api_op_ModifyDBClusterParameterGroup.go | 2 +- service/rds/api_op_RebootDBCluster.go | 2 +- service/rds/api_op_RemoveRoleFromDBCluster.go | 2 +- .../api_op_ResetDBClusterParameterGroup.go | 2 +- .../api_op_RestoreDBClusterFromSnapshot.go | 2 +- .../api_op_RestoreDBClusterToPointInTime.go | 2 +- .../api_op_RestoreDBInstanceFromDBSnapshot.go | 8 +- service/rds/api_op_RestoreDBInstanceFromS3.go | 4 +- .../api_op_RestoreDBInstanceToPointInTime.go | 4 +- service/rds/api_op_StartActivityStream.go | 4 +- service/rds/api_op_StartExportTask.go | 149 ++- service/rds/types/types.go | 71 +- service/wafv2/deserializers.go | 634 ++++++++++ service/wafv2/doc.go | 22 +- service/wafv2/serializers.go | 276 +++++ service/wafv2/types/enums.go | 2 + service/wafv2/types/types.go | 282 ++++- service/wafv2/validators.go | 169 +++ 73 files changed, 4918 insertions(+), 284 deletions(-) create mode 100644 .changelog/0376934a30b54310a1c42f0f62df2e76.json create mode 100644 .changelog/3c2f156b8d8a49d3bf40e573cb13e19e.json create mode 100644 .changelog/7650d89aa5d0448d862c432c8aaa72a6.json create mode 100644 .changelog/8a5120b35c0049c58d7ad097102f6a50.json create mode 100644 .changelog/d14c5d419bf14ff5a94f6b456461d860.json create mode 100644 .changelog/f4cba4239d9d43569b9d127ceb841fd0.json create mode 100644 .changelog/f71832c247bf4731ae1f5a364505b5aa.json create mode 100644 service/frauddetector/api_op_CreateList.go create mode 100644 service/frauddetector/api_op_DeleteList.go create mode 100644 service/frauddetector/api_op_GetListElements.go create mode 100644 service/frauddetector/api_op_GetListsMetadata.go create mode 100644 service/frauddetector/api_op_UpdateList.go create mode 100644 service/privatenetworks/api_op_StartNetworkResourceUpdate.go diff --git a/.changelog/0376934a30b54310a1c42f0f62df2e76.json b/.changelog/0376934a30b54310a1c42f0f62df2e76.json new file mode 100644 index 00000000000..981bab45487 --- /dev/null +++ b/.changelog/0376934a30b54310a1c42f0f62df2e76.json @@ -0,0 +1,8 @@ +{ + "id": "0376934a-30b5-4310-a1c4-2f0f62df2e76", + "type": "documentation", + "description": "Database Activity Stream support for RDS for SQL Server.", + "modules": [ + "service/rds" + ] +} \ No newline at end of file diff --git a/.changelog/3c2f156b8d8a49d3bf40e573cb13e19e.json b/.changelog/3c2f156b8d8a49d3bf40e573cb13e19e.json new file mode 100644 index 00000000000..4c1ad5e3d32 --- /dev/null +++ b/.changelog/3c2f156b8d8a49d3bf40e573cb13e19e.json @@ -0,0 +1,8 @@ +{ + "id": "3c2f156b-8d8a-49d3-bf40-e573cb13e19e", + "type": "feature", + "description": "This release introduces Lists feature which allows customers to reference a set of values in Fraud Detector's rules. With Lists, customers can dynamically manage these attributes in real time. Lists can be created/deleted and its contents can be modified using the Fraud Detector API.", + "modules": [ + "service/frauddetector" + ] +} \ No newline at end of file diff --git a/.changelog/7650d89aa5d0448d862c432c8aaa72a6.json b/.changelog/7650d89aa5d0448d862c432c8aaa72a6.json new file mode 100644 index 00000000000..db3752927ba --- /dev/null +++ b/.changelog/7650d89aa5d0448d862c432c8aaa72a6.json @@ -0,0 +1,8 @@ +{ + "id": "7650d89a-a5d0-448d-862c-432c8aaa72a6", + "type": "feature", + "description": "This release adds an InsufficientEncryptionPolicyException type to the StartImport endpoint", + "modules": [ + "service/cloudtrail" + ] +} \ No newline at end of file diff --git a/.changelog/8a5120b35c0049c58d7ad097102f6a50.json b/.changelog/8a5120b35c0049c58d7ad097102f6a50.json new file mode 100644 index 00000000000..7c42ab4b04c --- /dev/null +++ b/.changelog/8a5120b35c0049c58d7ad097102f6a50.json @@ -0,0 +1,8 @@ +{ + "id": "8a5120b3-5c00-49c5-8d7a-d097102f6a50", + "type": "documentation", + "description": "Documentation update for EFS to support IAM best practices.", + "modules": [ + "service/efs" + ] +} \ No newline at end of file diff --git a/.changelog/d14c5d419bf14ff5a94f6b456461d860.json b/.changelog/d14c5d419bf14ff5a94f6b456461d860.json new file mode 100644 index 00000000000..446866f29c0 --- /dev/null +++ b/.changelog/d14c5d419bf14ff5a94f6b456461d860.json @@ -0,0 +1,8 @@ +{ + "id": "d14c5d41-9bf1-4ff5-a94f-6b456461d860", + "type": "feature", + "description": "This release introduces a new StartNetworkResourceUpdate API, which enables return/replacement of hardware from a NetworkSite.", + "modules": [ + "service/privatenetworks" + ] +} \ No newline at end of file diff --git a/.changelog/f4cba4239d9d43569b9d127ceb841fd0.json b/.changelog/f4cba4239d9d43569b9d127ceb841fd0.json new file mode 100644 index 00000000000..2f2c98ea965 --- /dev/null +++ b/.changelog/f4cba4239d9d43569b9d127ceb841fd0.json @@ -0,0 +1,8 @@ +{ + "id": "f4cba423-9d9d-4356-9b9d-127ceb841fd0", + "type": "feature", + "description": "Fix DirectJDBCSource not showing up in CLI code gen", + "modules": [ + "service/glue" + ] +} \ No newline at end of file diff --git a/.changelog/f71832c247bf4731ae1f5a364505b5aa.json b/.changelog/f71832c247bf4731ae1f5a364505b5aa.json new file mode 100644 index 00000000000..80c517168e9 --- /dev/null +++ b/.changelog/f71832c247bf4731ae1f5a364505b5aa.json @@ -0,0 +1,8 @@ +{ + "id": "f71832c2-47bf-4731-ae1f-5a364505b5aa", + "type": "feature", + "description": "For protected CloudFront distributions, you can now use the AWS WAF Fraud Control account takeover prevention (ATP) managed rule group to block new login attempts from clients that have recently submitted too many failed login attempts.", + "modules": [ + "service/wafv2" + ] +} \ No newline at end of file diff --git a/service/cloudtrail/deserializers.go b/service/cloudtrail/deserializers.go index 6ef1fbd63d4..44f7481bbfd 100644 --- a/service/cloudtrail/deserializers.go +++ b/service/cloudtrail/deserializers.go @@ -4954,6 +4954,9 @@ func awsAwsjson11_deserializeOpErrorStartImport(response *smithyhttp.Response, m case strings.EqualFold("InactiveEventDataStoreException", errorCode): return awsAwsjson11_deserializeErrorInactiveEventDataStoreException(response, errorBody) + case strings.EqualFold("InsufficientEncryptionPolicyException", errorCode): + return awsAwsjson11_deserializeErrorInsufficientEncryptionPolicyException(response, errorBody) + case strings.EqualFold("InvalidEventDataStoreCategoryException", errorCode): return awsAwsjson11_deserializeErrorInvalidEventDataStoreCategoryException(response, errorBody) diff --git a/service/efs/api_op_CreateAccessPoint.go b/service/efs/api_op_CreateAccessPoint.go index 2b4e83d2ff8..69b54773e64 100644 --- a/service/efs/api_op_CreateAccessPoint.go +++ b/service/efs/api_op_CreateAccessPoint.go @@ -101,7 +101,7 @@ type CreateAccessPointOutput struct { // The name of the access point. This is the value of the Name tag. Name *string - // Identified the Amazon Web Services account that owns the access point resource. + // Identifies the Amazon Web Services account that owns the access point resource. OwnerId *string // The full POSIX identity, including the user ID, group ID, and secondary group diff --git a/service/efs/api_op_CreateFileSystem.go b/service/efs/api_op_CreateFileSystem.go index bb32bd8ad7c..713598fffeb 100644 --- a/service/efs/api_op_CreateFileSystem.go +++ b/service/efs/api_op_CreateFileSystem.go @@ -199,9 +199,7 @@ type CreateFileSystemOutput struct { // This member is required. NumberOfMountTargets int32 - // The Amazon Web Services account that created the file system. If the file system - // was created by an IAM user, the parent account to which the user belongs is the - // owner. + // The Amazon Web Services account that created the file system. // // This member is required. OwnerId *string diff --git a/service/efs/api_op_CreateReplicationConfiguration.go b/service/efs/api_op_CreateReplicationConfiguration.go index e88433346cb..cef3f37eb1b 100644 --- a/service/efs/api_op_CreateReplicationConfiguration.go +++ b/service/efs/api_op_CreateReplicationConfiguration.go @@ -56,23 +56,23 @@ import ( // used. The performance mode cannot be changed. // // * Throughput mode - The -// destination file system uses the Bursting Throughput mode by default. After the -// file system is created, you can modify the throughput mode. +// destination file system's throughput mode matches that of the source file +// system. After the file system is created, you can modify the throughput +// mode. // -// The following -// properties are turned off by default: +// The following properties are turned off by default: // -// * Lifecycle management - EFS lifecycle -// management and EFS Intelligent-Tiering are not enabled on the destination file -// system. After the destination file system is created, you can enable EFS -// lifecycle management and EFS Intelligent-Tiering. +// * Lifecycle +// management - EFS lifecycle management and EFS Intelligent-Tiering are not +// enabled on the destination file system. After the destination file system is +// created, you can enable EFS lifecycle management and EFS Intelligent-Tiering. // -// * Automatic backups - -// Automatic daily backups not enabled on the destination file system. After the -// file system is created, you can change this setting. +// * +// Automatic backups - Automatic daily backups not enabled on the destination file +// system. After the file system is created, you can change this setting. // -// For more information, see -// Amazon EFS replication +// For more +// information, see Amazon EFS replication // (https://docs.aws.amazon.com/efs/latest/ug/efs-replication.html) in the Amazon // EFS User Guide. func (c *Client) CreateReplicationConfiguration(ctx context.Context, params *CreateReplicationConfigurationInput, optFns ...func(*Options)) (*CreateReplicationConfigurationOutput, error) { diff --git a/service/efs/api_op_UpdateFileSystem.go b/service/efs/api_op_UpdateFileSystem.go index 1c4bc60af8b..0edd547aec0 100644 --- a/service/efs/api_op_UpdateFileSystem.go +++ b/service/efs/api_op_UpdateFileSystem.go @@ -81,9 +81,7 @@ type UpdateFileSystemOutput struct { // This member is required. NumberOfMountTargets int32 - // The Amazon Web Services account that created the file system. If the file system - // was created by an IAM user, the parent account to which the user belongs is the - // owner. + // The Amazon Web Services account that created the file system. // // This member is required. OwnerId *string diff --git a/service/efs/types/types.go b/service/efs/types/types.go index db40203ccc9..3551d2b0ab0 100644 --- a/service/efs/types/types.go +++ b/service/efs/types/types.go @@ -28,7 +28,7 @@ type AccessPointDescription struct { // The name of the access point. This is the value of the Name tag. Name *string - // Identified the Amazon Web Services account that owns the access point resource. + // Identifies the Amazon Web Services account that owns the access point resource. OwnerId *string // The full POSIX identity, including the user ID, group ID, and secondary group @@ -201,9 +201,7 @@ type FileSystemDescription struct { // This member is required. NumberOfMountTargets int32 - // The Amazon Web Services account that created the file system. If the file system - // was created by an IAM user, the parent account to which the user belongs is the - // owner. + // The Amazon Web Services account that created the file system. // // This member is required. OwnerId *string diff --git a/service/frauddetector/api_op_CreateList.go b/service/frauddetector/api_op_CreateList.go new file mode 100644 index 00000000000..fa1031fbdfc --- /dev/null +++ b/service/frauddetector/api_op_CreateList.go @@ -0,0 +1,136 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package frauddetector + +import ( + "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/frauddetector/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a list. List is a set of input data for a variable in your event +// dataset. You use the input data in a rule that's associated with your detector. +// For more information, see Lists +// (https://docs.aws.amazon.com/frauddetector/latest/ug/lists.html). +func (c *Client) CreateList(ctx context.Context, params *CreateListInput, optFns ...func(*Options)) (*CreateListOutput, error) { + if params == nil { + params = &CreateListInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateList", params, optFns, c.addOperationCreateListMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateListOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateListInput struct { + + // The name of the list. + // + // This member is required. + Name *string + + // The description of the list. + Description *string + + // The names of the elements, if providing. You can also create an empty list and + // add elements later using the UpdateList + // (https://docs.aws.amazon.com/frauddetector/latest/api/API_Updatelist.html) API. + Elements []string + + // A collection of the key and value pairs. + Tags []types.Tag + + // The variable type of the list. You can only assign the variable type with String + // data type. For more information, see Variable types + // (https://docs.aws.amazon.com/frauddetector/latest/ug/create-a-variable.html#variable-types). + VariableType *string + + noSmithyDocumentSerde +} + +type CreateListOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateListMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateList{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateList{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != 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 = addOpCreateListValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateList(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_opCreateList(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "frauddetector", + OperationName: "CreateList", + } +} diff --git a/service/frauddetector/api_op_DeleteList.go b/service/frauddetector/api_op_DeleteList.go new file mode 100644 index 00000000000..fe883650b0b --- /dev/null +++ b/service/frauddetector/api_op_DeleteList.go @@ -0,0 +1,118 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package frauddetector + +import ( + "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 list, provided it is not used in a rule. When you delete a list, +// Amazon Fraud Detector permanently deletes that list and the elements in the +// list. +func (c *Client) DeleteList(ctx context.Context, params *DeleteListInput, optFns ...func(*Options)) (*DeleteListOutput, error) { + if params == nil { + params = &DeleteListInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteList", params, optFns, c.addOperationDeleteListMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteListOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteListInput struct { + + // The name of the list to delete. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type DeleteListOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteListMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteList{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteList{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != 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 = addOpDeleteListValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteList(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_opDeleteList(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "frauddetector", + OperationName: "DeleteList", + } +} diff --git a/service/frauddetector/api_op_GetListElements.go b/service/frauddetector/api_op_GetListElements.go new file mode 100644 index 00000000000..fb775d74faf --- /dev/null +++ b/service/frauddetector/api_op_GetListElements.go @@ -0,0 +1,220 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package frauddetector + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets all the elements in the specified list. +func (c *Client) GetListElements(ctx context.Context, params *GetListElementsInput, optFns ...func(*Options)) (*GetListElementsOutput, error) { + if params == nil { + params = &GetListElementsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetListElements", params, optFns, c.addOperationGetListElementsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetListElementsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetListElementsInput struct { + + // The name of the list. + // + // This member is required. + Name *string + + // The maximum number of objects to return for the request. + MaxResults *int32 + + // The next token for the subsequent request. + NextToken *string + + noSmithyDocumentSerde +} + +type GetListElementsOutput struct { + + // The list elements. + Elements []string + + // The next page token. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetListElementsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetListElements{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetListElements{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != 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 = addOpGetListElementsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetListElements(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 +} + +// GetListElementsAPIClient is a client that implements the GetListElements +// operation. +type GetListElementsAPIClient interface { + GetListElements(context.Context, *GetListElementsInput, ...func(*Options)) (*GetListElementsOutput, error) +} + +var _ GetListElementsAPIClient = (*Client)(nil) + +// GetListElementsPaginatorOptions is the paginator options for GetListElements +type GetListElementsPaginatorOptions struct { + // The maximum number of objects to return for the request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// GetListElementsPaginator is a paginator for GetListElements +type GetListElementsPaginator struct { + options GetListElementsPaginatorOptions + client GetListElementsAPIClient + params *GetListElementsInput + nextToken *string + firstPage bool +} + +// NewGetListElementsPaginator returns a new GetListElementsPaginator +func NewGetListElementsPaginator(client GetListElementsAPIClient, params *GetListElementsInput, optFns ...func(*GetListElementsPaginatorOptions)) *GetListElementsPaginator { + if params == nil { + params = &GetListElementsInput{} + } + + options := GetListElementsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &GetListElementsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetListElementsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next GetListElements page. +func (p *GetListElementsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetListElementsOutput, 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.GetListElements(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_opGetListElements(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "frauddetector", + OperationName: "GetListElements", + } +} diff --git a/service/frauddetector/api_op_GetListsMetadata.go b/service/frauddetector/api_op_GetListsMetadata.go new file mode 100644 index 00000000000..c9c6e4b2e89 --- /dev/null +++ b/service/frauddetector/api_op_GetListsMetadata.go @@ -0,0 +1,217 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package frauddetector + +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/frauddetector/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets the metadata of either all the lists under the account or the specified +// list. +func (c *Client) GetListsMetadata(ctx context.Context, params *GetListsMetadataInput, optFns ...func(*Options)) (*GetListsMetadataOutput, error) { + if params == nil { + params = &GetListsMetadataInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetListsMetadata", params, optFns, c.addOperationGetListsMetadataMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetListsMetadataOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetListsMetadataInput struct { + + // The maximum number of objects to return for the request. + MaxResults *int32 + + // The name of the list. + Name *string + + // The next token for the subsequent request. + NextToken *string + + noSmithyDocumentSerde +} + +type GetListsMetadataOutput struct { + + // The metadata of the specified list or all lists under the account. + Lists []types.AllowDenyList + + // The next page token. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetListsMetadataMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetListsMetadata{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetListsMetadata{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != 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_opGetListsMetadata(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 +} + +// GetListsMetadataAPIClient is a client that implements the GetListsMetadata +// operation. +type GetListsMetadataAPIClient interface { + GetListsMetadata(context.Context, *GetListsMetadataInput, ...func(*Options)) (*GetListsMetadataOutput, error) +} + +var _ GetListsMetadataAPIClient = (*Client)(nil) + +// GetListsMetadataPaginatorOptions is the paginator options for GetListsMetadata +type GetListsMetadataPaginatorOptions struct { + // The maximum number of objects to return for the request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// GetListsMetadataPaginator is a paginator for GetListsMetadata +type GetListsMetadataPaginator struct { + options GetListsMetadataPaginatorOptions + client GetListsMetadataAPIClient + params *GetListsMetadataInput + nextToken *string + firstPage bool +} + +// NewGetListsMetadataPaginator returns a new GetListsMetadataPaginator +func NewGetListsMetadataPaginator(client GetListsMetadataAPIClient, params *GetListsMetadataInput, optFns ...func(*GetListsMetadataPaginatorOptions)) *GetListsMetadataPaginator { + if params == nil { + params = &GetListsMetadataInput{} + } + + options := GetListsMetadataPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &GetListsMetadataPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *GetListsMetadataPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next GetListsMetadata page. +func (p *GetListsMetadataPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*GetListsMetadataOutput, 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.GetListsMetadata(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_opGetListsMetadata(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "frauddetector", + OperationName: "GetListsMetadata", + } +} diff --git a/service/frauddetector/api_op_UpdateList.go b/service/frauddetector/api_op_UpdateList.go new file mode 100644 index 00000000000..20fc66a698d --- /dev/null +++ b/service/frauddetector/api_op_UpdateList.go @@ -0,0 +1,142 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package frauddetector + +import ( + "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/frauddetector/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a list. +func (c *Client) UpdateList(ctx context.Context, params *UpdateListInput, optFns ...func(*Options)) (*UpdateListOutput, error) { + if params == nil { + params = &UpdateListInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateList", params, optFns, c.addOperationUpdateListMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateListOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateListInput struct { + + // The name of the list to update. + // + // This member is required. + Name *string + + // The new description. + Description *string + + // One or more list elements to add or replace. If you are providing the elements, + // make sure to specify the updateMode to use. If you are deleting all elements + // from the list, use REPLACE for the updateMode and provide an empty list (0 + // elements). + Elements []string + + // The update mode (type). + // + // * Use APPEND if you are adding elements to the list. + // + // * + // Use REPLACE if you replacing existing elements in the list. + // + // * Use REMOVE if you + // are removing elements from the list. + UpdateMode types.ListUpdateMode + + // The variable type you want to assign to the list. You cannot update a variable + // type of a list that already has a variable type assigned to it. You can assign a + // variable type to a list only if the list does not already have a variable type. + VariableType *string + + noSmithyDocumentSerde +} + +type UpdateListOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateListMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateList{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateList{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != 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 = addOpUpdateListValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateList(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_opUpdateList(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "frauddetector", + OperationName: "UpdateList", + } +} diff --git a/service/frauddetector/deserializers.go b/service/frauddetector/deserializers.go index 629ab186e96..f172369fa10 100644 --- a/service/frauddetector/deserializers.go +++ b/service/frauddetector/deserializers.go @@ -874,6 +874,126 @@ func awsAwsjson11_deserializeOpErrorCreateDetectorVersion(response *smithyhttp.R } } +type awsAwsjson11_deserializeOpCreateList struct { +} + +func (*awsAwsjson11_deserializeOpCreateList) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateList) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateList(response, &metadata) + } + output := &CreateListOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentCreateListOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorCreateList(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(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_deserializeOpCreateModel struct { } @@ -2581,6 +2701,129 @@ func awsAwsjson11_deserializeOpErrorDeleteLabel(response *smithyhttp.Response, m } } +type awsAwsjson11_deserializeOpDeleteList struct { +} + +func (*awsAwsjson11_deserializeOpDeleteList) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteList) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteList(response, &metadata) + } + output := &DeleteListOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentDeleteListOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorDeleteList(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(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_deserializeOpDeleteModel struct { } @@ -5044,14 +5287,14 @@ func awsAwsjson11_deserializeOpErrorGetLabels(response *smithyhttp.Response, met } } -type awsAwsjson11_deserializeOpGetModels struct { +type awsAwsjson11_deserializeOpGetListElements struct { } -func (*awsAwsjson11_deserializeOpGetModels) ID() string { +func (*awsAwsjson11_deserializeOpGetListElements) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetModels) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetListElements) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5065,9 +5308,9 @@ func (m *awsAwsjson11_deserializeOpGetModels) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetModels(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetListElements(response, &metadata) } - output := &GetModelsOutput{} + output := &GetListElementsOutput{} out.Result = output var buff [1024]byte @@ -5087,7 +5330,7 @@ func (m *awsAwsjson11_deserializeOpGetModels) HandleDeserialize(ctx context.Cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetModelsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetListElementsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5101,7 +5344,7 @@ func (m *awsAwsjson11_deserializeOpGetModels) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetModels(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetListElements(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5167,14 +5410,14 @@ func awsAwsjson11_deserializeOpErrorGetModels(response *smithyhttp.Response, met } } -type awsAwsjson11_deserializeOpGetModelVersion struct { +type awsAwsjson11_deserializeOpGetListsMetadata struct { } -func (*awsAwsjson11_deserializeOpGetModelVersion) ID() string { +func (*awsAwsjson11_deserializeOpGetListsMetadata) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetModelVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetListsMetadata) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5188,9 +5431,9 @@ func (m *awsAwsjson11_deserializeOpGetModelVersion) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetModelVersion(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetListsMetadata(response, &metadata) } - output := &GetModelVersionOutput{} + output := &GetListsMetadataOutput{} out.Result = output var buff [1024]byte @@ -5210,7 +5453,7 @@ func (m *awsAwsjson11_deserializeOpGetModelVersion) HandleDeserialize(ctx contex return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetModelVersionOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetListsMetadataOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5224,7 +5467,7 @@ func (m *awsAwsjson11_deserializeOpGetModelVersion) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetModelVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetListsMetadata(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5290,14 +5533,14 @@ func awsAwsjson11_deserializeOpErrorGetModelVersion(response *smithyhttp.Respons } } -type awsAwsjson11_deserializeOpGetOutcomes struct { +type awsAwsjson11_deserializeOpGetModels struct { } -func (*awsAwsjson11_deserializeOpGetOutcomes) ID() string { +func (*awsAwsjson11_deserializeOpGetModels) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetOutcomes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetModels) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5311,9 +5554,9 @@ func (m *awsAwsjson11_deserializeOpGetOutcomes) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetOutcomes(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetModels(response, &metadata) } - output := &GetOutcomesOutput{} + output := &GetModelsOutput{} out.Result = output var buff [1024]byte @@ -5333,7 +5576,7 @@ func (m *awsAwsjson11_deserializeOpGetOutcomes) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetOutcomesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetModelsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5347,7 +5590,253 @@ func (m *awsAwsjson11_deserializeOpGetOutcomes) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetOutcomes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetModels(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("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_deserializeOpGetModelVersion struct { +} + +func (*awsAwsjson11_deserializeOpGetModelVersion) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetModelVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetModelVersion(response, &metadata) + } + output := &GetModelVersionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetModelVersionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorGetModelVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("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_deserializeOpGetOutcomes struct { +} + +func (*awsAwsjson11_deserializeOpGetOutcomes) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetOutcomes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetOutcomes(response, &metadata) + } + output := &GetOutcomesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentGetOutcomesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorGetOutcomes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7630,6 +8119,132 @@ func awsAwsjson11_deserializeOpErrorUpdateEventLabel(response *smithyhttp.Respon } } +type awsAwsjson11_deserializeOpUpdateList struct { +} + +func (*awsAwsjson11_deserializeOpUpdateList) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateList) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateList(response, &metadata) + } + output := &UpdateListOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.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_deserializeOpDocumentUpdateListOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + 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_deserializeOpErrorUpdateList(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("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("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_deserializeOpUpdateModel struct { } @@ -8793,22 +9408,143 @@ func awsAwsjson11_deserializeDocumentAggregatedVariablesImpactExplanation(v **ty default: return fmt.Errorf("unknown JSON number value: %s", jtv) - } - sv.LogOddsImpact = ptr.Float32(float32(f64)) + } + sv.LogOddsImpact = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected float to be a JSON Number, got %T instead", value) + + } + } + + case "relativeImpact": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected string to be of type string, got %T instead", value) + } + sv.RelativeImpact = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAggregatedVariablesImportanceMetrics(v **types.AggregatedVariablesImportanceMetrics, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AggregatedVariablesImportanceMetrics + if *v == nil { + sv = &types.AggregatedVariablesImportanceMetrics{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "logOddsMetrics": + if err := awsAwsjson11_deserializeDocumentListOfAggregatedLogOddsMetrics(&sv.LogOddsMetrics, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAllowDenyList(v **types.AllowDenyList, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AllowDenyList + if *v == nil { + sv = &types.AllowDenyList{} + } 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 fraudDetectorArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected time to be of type string, got %T instead", value) + } + sv.CreatedTime = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected description to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } - default: - return fmt.Errorf("expected float to be a JSON Number, got %T instead", value) + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected noDashIdentifier to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + case "updatedTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected time to be of type string, got %T instead", value) } + sv.UpdatedTime = ptr.String(jtv) } - case "relativeImpact": + case "variableType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected string to be of type string, got %T instead", value) + return fmt.Errorf("expected variableType to be of type string, got %T instead", value) } - sv.RelativeImpact = ptr.String(jtv) + sv.VariableType = ptr.String(jtv) } default: @@ -8820,7 +9556,7 @@ func awsAwsjson11_deserializeDocumentAggregatedVariablesImpactExplanation(v **ty return nil } -func awsAwsjson11_deserializeDocumentAggregatedVariablesImportanceMetrics(v **types.AggregatedVariablesImportanceMetrics, value interface{}) error { +func awsAwsjson11_deserializeDocumentAllowDenyLists(v *[]types.AllowDenyList, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8828,31 +9564,29 @@ func awsAwsjson11_deserializeDocumentAggregatedVariablesImportanceMetrics(v **ty 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.AggregatedVariablesImportanceMetrics + var cv []types.AllowDenyList if *v == nil { - sv = &types.AggregatedVariablesImportanceMetrics{} + cv = []types.AllowDenyList{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "logOddsMetrics": - if err := awsAwsjson11_deserializeDocumentListOfAggregatedLogOddsMetrics(&sv.LogOddsMetrics, value); err != nil { - return err - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.AllowDenyList + destAddr := &col + if err := awsAwsjson11_deserializeDocumentAllowDenyList(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } @@ -10094,6 +10828,42 @@ func awsAwsjson11_deserializeDocumentDetectorVersionSummaryList(v *[]types.Detec return nil } +func awsAwsjson11_deserializeDocumentElementsList(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 Elements to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentEntity(v **types.Entity, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15582,6 +16352,37 @@ func awsAwsjson11_deserializeOpDocumentCreateDetectorVersionOutput(v **CreateDet return nil } +func awsAwsjson11_deserializeOpDocumentCreateListOutput(v **CreateListOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateListOutput + if *v == nil { + sv = &CreateListOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentCreateModelOutput(v **CreateModelOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16075,6 +16876,37 @@ func awsAwsjson11_deserializeOpDocumentDeleteLabelOutput(v **DeleteLabelOutput, return nil } +func awsAwsjson11_deserializeOpDocumentDeleteListOutput(v **DeleteListOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteListOutput + if *v == nil { + sv = &DeleteListOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDeleteModelOutput(v **DeleteModelOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -17084,6 +17916,96 @@ func awsAwsjson11_deserializeOpDocumentGetLabelsOutput(v **GetLabelsOutput, valu return nil } +func awsAwsjson11_deserializeOpDocumentGetListElementsOutput(v **GetListElementsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetListElementsOutput + if *v == nil { + sv = &GetListElementsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "elements": + if err := awsAwsjson11_deserializeDocumentElementsList(&sv.Elements, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected nextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetListsMetadataOutput(v **GetListsMetadataOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetListsMetadataOutput + if *v == nil { + sv = &GetListsMetadataOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "lists": + if err := awsAwsjson11_deserializeDocumentAllowDenyLists(&sv.Lists, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected nextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentGetModelsOutput(v **GetModelsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -17888,6 +18810,37 @@ func awsAwsjson11_deserializeOpDocumentUpdateEventLabelOutput(v **UpdateEventLab return nil } +func awsAwsjson11_deserializeOpDocumentUpdateListOutput(v **UpdateListOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateListOutput + if *v == nil { + sv = &UpdateListOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentUpdateModelOutput(v **UpdateModelOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/frauddetector/generated.json b/service/frauddetector/generated.json index 7950645cab0..4857cecab78 100644 --- a/service/frauddetector/generated.json +++ b/service/frauddetector/generated.json @@ -15,6 +15,7 @@ "api_op_CreateBatchImportJob.go", "api_op_CreateBatchPredictionJob.go", "api_op_CreateDetectorVersion.go", + "api_op_CreateList.go", "api_op_CreateModel.go", "api_op_CreateModelVersion.go", "api_op_CreateRule.go", @@ -29,6 +30,7 @@ "api_op_DeleteEventsByEventType.go", "api_op_DeleteExternalModel.go", "api_op_DeleteLabel.go", + "api_op_DeleteList.go", "api_op_DeleteModel.go", "api_op_DeleteModelVersion.go", "api_op_DeleteOutcome.go", @@ -49,6 +51,8 @@ "api_op_GetExternalModels.go", "api_op_GetKMSEncryptionKey.go", "api_op_GetLabels.go", + "api_op_GetListElements.go", + "api_op_GetListsMetadata.go", "api_op_GetModelVersion.go", "api_op_GetModels.go", "api_op_GetOutcomes.go", @@ -70,6 +74,7 @@ "api_op_UpdateDetectorVersionMetadata.go", "api_op_UpdateDetectorVersionStatus.go", "api_op_UpdateEventLabel.go", + "api_op_UpdateList.go", "api_op_UpdateModel.go", "api_op_UpdateModelVersion.go", "api_op_UpdateModelVersionStatus.go", diff --git a/service/frauddetector/serializers.go b/service/frauddetector/serializers.go index 67c9c17a762..138e8399a9f 100644 --- a/service/frauddetector/serializers.go +++ b/service/frauddetector/serializers.go @@ -401,6 +401,61 @@ func (m *awsAwsjson11_serializeOpCreateDetectorVersion) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpCreateList struct { +} + +func (*awsAwsjson11_serializeOpCreateList) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateList) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateListInput) + _ = 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("AWSHawksNestServiceFacade.CreateList") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateListInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpCreateModel struct { } @@ -1171,6 +1226,61 @@ func (m *awsAwsjson11_serializeOpDeleteLabel) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDeleteList struct { +} + +func (*awsAwsjson11_serializeOpDeleteList) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteList) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteListInput) + _ = 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("AWSHawksNestServiceFacade.DeleteList") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteListInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpDeleteModel struct { } @@ -2266,6 +2376,116 @@ func (m *awsAwsjson11_serializeOpGetLabels) HandleSerialize(ctx context.Context, return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpGetListElements struct { +} + +func (*awsAwsjson11_serializeOpGetListElements) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetListElements) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetListElementsInput) + _ = 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("AWSHawksNestServiceFacade.GetListElements") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetListElementsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpGetListsMetadata struct { +} + +func (*awsAwsjson11_serializeOpGetListsMetadata) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetListsMetadata) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetListsMetadataInput) + _ = 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("AWSHawksNestServiceFacade.GetListsMetadata") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetListsMetadataInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpGetModels struct { } @@ -3421,6 +3641,61 @@ func (m *awsAwsjson11_serializeOpUpdateEventLabel) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpUpdateList struct { +} + +func (*awsAwsjson11_serializeOpUpdateList) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateList) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateListInput) + _ = 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("AWSHawksNestServiceFacade.UpdateList") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateListInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{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_serializeOpUpdateModel struct { } @@ -3761,6 +4036,17 @@ func awsAwsjson11_serializeDocumentCsvIndexToVariableMap(v map[string]string, va return nil } +func awsAwsjson11_serializeDocumentElementsList(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_serializeDocumentEntity(v *types.Entity, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4431,6 +4717,42 @@ func awsAwsjson11_serializeOpDocumentCreateDetectorVersionInput(v *CreateDetecto return nil } +func awsAwsjson11_serializeOpDocumentCreateListInput(v *CreateListInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Elements != nil { + ok := object.Key("elements") + if err := awsAwsjson11_serializeDocumentElementsList(v.Elements, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsAwsjson11_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + if v.VariableType != nil { + ok := object.Key("variableType") + ok.String(*v.VariableType) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentCreateModelInput(v *CreateModelInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4740,6 +5062,18 @@ func awsAwsjson11_serializeOpDocumentDeleteLabelInput(v *DeleteLabelInput, value return nil } +func awsAwsjson11_serializeOpDocumentDeleteListInput(v *DeleteListInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteModelInput(v *DeleteModelInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5156,6 +5490,50 @@ func awsAwsjson11_serializeOpDocumentGetLabelsInput(v *GetLabelsInput, value smi return nil } +func awsAwsjson11_serializeOpDocumentGetListElementsInput(v *GetListElementsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetListsMetadataInput(v *GetListsMetadataInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentGetModelsInput(v *GetModelsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5769,6 +6147,40 @@ func awsAwsjson11_serializeOpDocumentUpdateEventLabelInput(v *UpdateEventLabelIn return nil } +func awsAwsjson11_serializeOpDocumentUpdateListInput(v *UpdateListInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Elements != nil { + ok := object.Key("elements") + if err := awsAwsjson11_serializeDocumentElementsList(v.Elements, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if len(v.UpdateMode) > 0 { + ok := object.Key("updateMode") + ok.String(string(v.UpdateMode)) + } + + if v.VariableType != nil { + ok := object.Key("variableType") + ok.String(*v.VariableType) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentUpdateModelInput(v *UpdateModelInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/frauddetector/types/enums.go b/service/frauddetector/types/enums.go index 8175e791f48..02515576c3a 100644 --- a/service/frauddetector/types/enums.go +++ b/service/frauddetector/types/enums.go @@ -124,6 +124,26 @@ func (Language) Values() []Language { } } +type ListUpdateMode string + +// Enum values for ListUpdateMode +const ( + ListUpdateModeReplace ListUpdateMode = "REPLACE" + ListUpdateModeAppend ListUpdateMode = "APPEND" + ListUpdateModeRemove ListUpdateMode = "REMOVE" +) + +// Values returns all known values for ListUpdateMode. Note that this can be +// expanded in the future, and 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 (ListUpdateMode) Values() []ListUpdateMode { + return []ListUpdateMode{ + "REPLACE", + "APPEND", + "REMOVE", + } +} + type ModelEndpointStatus string // Enum values for ModelEndpointStatus diff --git a/service/frauddetector/types/types.go b/service/frauddetector/types/types.go index 6f67dfa1dc9..ace3f58f796 100644 --- a/service/frauddetector/types/types.go +++ b/service/frauddetector/types/types.go @@ -71,6 +71,32 @@ type AggregatedVariablesImportanceMetrics struct { noSmithyDocumentSerde } +// The metadata of a list. +type AllowDenyList struct { + + // The name of the list. + // + // This member is required. + Name *string + + // The ARN of the list. + Arn *string + + // The time the list was created. + CreatedTime *string + + // The description of the list. + Description *string + + // The time the list was last updated. + UpdatedTime *string + + // The variable type of the list. + VariableType *string + + noSmithyDocumentSerde +} + // The Account Takeover Insights (ATI) model performance metrics data points. type ATIMetricDataPoint struct { diff --git a/service/frauddetector/validators.go b/service/frauddetector/validators.go index e37e1834091..55c3b513d2f 100644 --- a/service/frauddetector/validators.go +++ b/service/frauddetector/validators.go @@ -150,6 +150,26 @@ func (m *validateOpCreateDetectorVersion) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpCreateList struct { +} + +func (*validateOpCreateList) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateList) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateListInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateListInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateModel struct { } @@ -430,6 +450,26 @@ func (m *validateOpDeleteLabel) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpDeleteList struct { +} + +func (*validateOpDeleteList) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteList) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteListInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteListInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteModel struct { } @@ -650,6 +690,26 @@ func (m *validateOpGetEventPredictionMetadata) HandleInitialize(ctx context.Cont return next.HandleInitialize(ctx, in) } +type validateOpGetListElements struct { +} + +func (*validateOpGetListElements) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetListElements) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetListElementsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetListElementsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetModelVersion struct { } @@ -1010,6 +1070,26 @@ func (m *validateOpUpdateEventLabel) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpUpdateList struct { +} + +func (*validateOpUpdateList) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateList) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateListInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateListInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateModel struct { } @@ -1158,6 +1238,10 @@ func addOpCreateDetectorVersionValidationMiddleware(stack *middleware.Stack) err return stack.Initialize.Add(&validateOpCreateDetectorVersion{}, middleware.After) } +func addOpCreateListValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateList{}, middleware.After) +} + func addOpCreateModelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateModel{}, middleware.After) } @@ -1214,6 +1298,10 @@ func addOpDeleteLabelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteLabel{}, middleware.After) } +func addOpDeleteListValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteList{}, middleware.After) +} + func addOpDeleteModelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteModel{}, middleware.After) } @@ -1258,6 +1346,10 @@ func addOpGetEventPredictionMetadataValidationMiddleware(stack *middleware.Stack return stack.Initialize.Add(&validateOpGetEventPredictionMetadata{}, middleware.After) } +func addOpGetListElementsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetListElements{}, middleware.After) +} + func addOpGetModelVersionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetModelVersion{}, middleware.After) } @@ -1330,6 +1422,10 @@ func addOpUpdateEventLabelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateEventLabel{}, middleware.After) } +func addOpUpdateListValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateList{}, middleware.After) +} + func addOpUpdateModelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateModel{}, middleware.After) } @@ -1782,6 +1878,26 @@ func validateOpCreateDetectorVersionInput(v *CreateDetectorVersionInput) error { } } +func validateOpCreateListInput(v *CreateListInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateListInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + 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 validateOpCreateModelInput(v *CreateModelInput) error { if v == nil { return nil @@ -2068,6 +2184,21 @@ func validateOpDeleteLabelInput(v *DeleteLabelInput) error { } } +func validateOpDeleteListInput(v *DeleteListInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteListInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteModelInput(v *DeleteModelInput) error { if v == nil { return nil @@ -2283,6 +2414,21 @@ func validateOpGetEventPredictionMetadataInput(v *GetEventPredictionMetadataInpu } } +func validateOpGetListElementsInput(v *GetListElementsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetListElementsInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetModelVersionInput(v *GetModelVersionInput) error { if v == nil { return nil @@ -2688,6 +2834,21 @@ func validateOpUpdateEventLabelInput(v *UpdateEventLabelInput) error { } } +func validateOpUpdateListInput(v *UpdateListInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateListInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateModelInput(v *UpdateModelInput) error { if v == nil { return nil diff --git a/service/glue/deserializers.go b/service/glue/deserializers.go index c25d83c9d51..fb44da573d5 100644 --- a/service/glue/deserializers.go +++ b/service/glue/deserializers.go @@ -27958,6 +27958,11 @@ func awsAwsjson11_deserializeDocumentCodeGenConfigurationNode(v **types.CodeGenC return err } + case "DirectJDBCSource": + if err := awsAwsjson11_deserializeDocumentDirectJDBCSource(&sv.DirectJDBCSource, value); err != nil { + return err + } + case "DirectKafkaSource": if err := awsAwsjson11_deserializeDocumentDirectKafkaSource(&sv.DirectKafkaSource, value); err != nil { return err @@ -33256,6 +33261,91 @@ func awsAwsjson11_deserializeDocumentDevEndpointNames(v *[]string, value interfa return nil } +func awsAwsjson11_deserializeDocumentDirectJDBCSource(v **types.DirectJDBCSource, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DirectJDBCSource + if *v == nil { + sv = &types.DirectJDBCSource{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ConnectionName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EnclosedInStringProperty to be of type string, got %T instead", value) + } + sv.ConnectionName = ptr.String(jtv) + } + + case "ConnectionType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JDBCConnectionType to be of type string, got %T instead", value) + } + sv.ConnectionType = types.JDBCConnectionType(jtv) + } + + case "Database": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EnclosedInStringProperty to be of type string, got %T instead", value) + } + sv.Database = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NodeName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "RedshiftTmpDir": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EnclosedInStringProperty to be of type string, got %T instead", value) + } + sv.RedshiftTmpDir = ptr.String(jtv) + } + + case "Table": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EnclosedInStringProperty to be of type string, got %T instead", value) + } + sv.Table = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentDirectKafkaSource(v **types.DirectKafkaSource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/glue/serializers.go b/service/glue/serializers.go index 64d4d274a31..c542b84f9eb 100644 --- a/service/glue/serializers.go +++ b/service/glue/serializers.go @@ -11923,6 +11923,13 @@ func awsAwsjson11_serializeDocumentCodeGenConfigurationNode(v *types.CodeGenConf } } + if v.DirectJDBCSource != nil { + ok := object.Key("DirectJDBCSource") + if err := awsAwsjson11_serializeDocumentDirectJDBCSource(v.DirectJDBCSource, ok); err != nil { + return err + } + } + if v.DirectKafkaSource != nil { ok := object.Key("DirectKafkaSource") if err := awsAwsjson11_serializeDocumentDirectKafkaSource(v.DirectKafkaSource, ok); err != nil { @@ -13409,6 +13416,43 @@ func awsAwsjson11_serializeDocumentDevEndpointNames(v []string, value smithyjson return nil } +func awsAwsjson11_serializeDocumentDirectJDBCSource(v *types.DirectJDBCSource, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ConnectionName != nil { + ok := object.Key("ConnectionName") + ok.String(*v.ConnectionName) + } + + if len(v.ConnectionType) > 0 { + ok := object.Key("ConnectionType") + ok.String(string(v.ConnectionType)) + } + + if v.Database != nil { + ok := object.Key("Database") + ok.String(*v.Database) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.RedshiftTmpDir != nil { + ok := object.Key("RedshiftTmpDir") + ok.String(*v.RedshiftTmpDir) + } + + if v.Table != nil { + ok := object.Key("Table") + ok.String(*v.Table) + } + + return nil +} + func awsAwsjson11_serializeDocumentDirectKafkaSource(v *types.DirectKafkaSource, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/glue/types/enums.go b/service/glue/types/enums.go index b00855c6f44..6704ec63bc9 100644 --- a/service/glue/types/enums.go +++ b/service/glue/types/enums.go @@ -780,6 +780,30 @@ func (HudiTargetCompressionType) Values() []HudiTargetCompressionType { } } +type JDBCConnectionType string + +// Enum values for JDBCConnectionType +const ( + JDBCConnectionTypeSqlserver JDBCConnectionType = "sqlserver" + JDBCConnectionTypeMysql JDBCConnectionType = "mysql" + JDBCConnectionTypeOracle JDBCConnectionType = "oracle" + JDBCConnectionTypePostgresql JDBCConnectionType = "postgresql" + JDBCConnectionTypeRedshift JDBCConnectionType = "redshift" +) + +// Values returns all known values for JDBCConnectionType. Note that this can be +// expanded in the future, and 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 (JDBCConnectionType) Values() []JDBCConnectionType { + return []JDBCConnectionType{ + "sqlserver", + "mysql", + "oracle", + "postgresql", + "redshift", + } +} + type JDBCDataType string // Enum values for JDBCDataType diff --git a/service/glue/types/types.go b/service/glue/types/types.go index a6006ae1124..e213cbbfab2 100644 --- a/service/glue/types/types.go +++ b/service/glue/types/types.go @@ -701,6 +701,9 @@ type CodeGenConfigurationNode struct { // transformation. The output is a collection of DynamicFrames. CustomCode *CustomCode + // Specifies the direct JDBC source connection. + DirectJDBCSource *DirectJDBCSource + // Specifies an Apache Kafka data store. DirectKafkaSource *DirectKafkaSource @@ -2445,6 +2448,40 @@ type DevEndpointCustomLibraries struct { noSmithyDocumentSerde } +// Specifies the direct JDBC source connection. +type DirectJDBCSource struct { + + // The connection name of the JDBC source. + // + // This member is required. + ConnectionName *string + + // The connection type of the JDBC source. + // + // This member is required. + ConnectionType JDBCConnectionType + + // The database of the JDBC source connection. + // + // This member is required. + Database *string + + // The name of the JDBC source connection. + // + // This member is required. + Name *string + + // The table of the JDBC source connection. + // + // This member is required. + Table *string + + // The temp directory of the JDBC Redshift source. + RedshiftTmpDir *string + + noSmithyDocumentSerde +} + // Specifies an Apache Kafka data store. type DirectKafkaSource struct { diff --git a/service/glue/validators.go b/service/glue/validators.go index 47b1a62f21b..969315f8b6c 100644 --- a/service/glue/validators.go +++ b/service/glue/validators.go @@ -4800,6 +4800,11 @@ func validateCodeGenConfigurationNode(v *types.CodeGenConfigurationNode) error { invalidParams.AddNested("S3HudiDirectTarget", err.(smithy.InvalidParamsError)) } } + if v.DirectJDBCSource != nil { + if err := validateDirectJDBCSource(v.DirectJDBCSource); err != nil { + invalidParams.AddNested("DirectJDBCSource", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -5411,6 +5416,33 @@ func validateDecimalNumber(v *types.DecimalNumber) error { } } +func validateDirectJDBCSource(v *types.DirectJDBCSource) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DirectJDBCSource"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Database == nil { + invalidParams.Add(smithy.NewErrParamRequired("Database")) + } + if v.Table == nil { + invalidParams.Add(smithy.NewErrParamRequired("Table")) + } + if v.ConnectionName == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectionName")) + } + if len(v.ConnectionType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ConnectionType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateDirectKafkaSource(v *types.DirectKafkaSource) error { if v == nil { return nil diff --git a/service/guardduty/internal/endpoints/endpoints.go b/service/guardduty/internal/endpoints/endpoints.go index 11e08f46217..145748708e9 100644 --- a/service/guardduty/internal/endpoints/endpoints.go +++ b/service/guardduty/internal/endpoints/endpoints.go @@ -153,6 +153,9 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, diff --git a/service/privatenetworks/api_op_StartNetworkResourceUpdate.go b/service/privatenetworks/api_op_StartNetworkResourceUpdate.go new file mode 100644 index 00000000000..6594895030b --- /dev/null +++ b/service/privatenetworks/api_op_StartNetworkResourceUpdate.go @@ -0,0 +1,147 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package privatenetworks + +import ( + "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/privatenetworks/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Starts an update of the specified network resource. After you submit a request +// to replace or return a network resource, the status of the network resource is +// CREATING_SHIPPING_LABEL. The shipping label is available when the status of the +// network resource is PENDING_RETURN. After the network resource is successfully +// returned, its status is DELETED. For more information, see Return a radio unit +// (https://docs.aws.amazon.com/private-networks/latest/userguide/radio-units.html#return-radio-unit). +func (c *Client) StartNetworkResourceUpdate(ctx context.Context, params *StartNetworkResourceUpdateInput, optFns ...func(*Options)) (*StartNetworkResourceUpdateOutput, error) { + if params == nil { + params = &StartNetworkResourceUpdateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartNetworkResourceUpdate", params, optFns, c.addOperationStartNetworkResourceUpdateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartNetworkResourceUpdateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartNetworkResourceUpdateInput struct { + + // The Amazon Resource Name (ARN) of the network resource. + // + // This member is required. + NetworkResourceArn *string + + // The update type. + // + // * REPLACE - Submits a request to replace a defective radio + // unit. We provide a shipping label that you can use for the return process and we + // ship a replacement radio unit to you. + // + // * RETURN - Submits a request to replace a + // radio unit that you no longer need. We provide a shipping label that you can use + // for the return process. + // + // This member is required. + UpdateType types.UpdateType + + // The reason for the return. Providing a reason for a return is optional. + ReturnReason *string + + // The shipping address. If you don't provide a shipping address when replacing or + // returning a network resource, we use the address from the original order for the + // network resource. + ShippingAddress *types.Address + + noSmithyDocumentSerde +} + +type StartNetworkResourceUpdateOutput struct { + + // The network resource. + NetworkResource *types.NetworkResource + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartNetworkResourceUpdateMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartNetworkResourceUpdate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartNetworkResourceUpdate{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != 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 = addOpStartNetworkResourceUpdateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartNetworkResourceUpdate(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_opStartNetworkResourceUpdate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "private-networks", + OperationName: "StartNetworkResourceUpdate", + } +} diff --git a/service/privatenetworks/deserializers.go b/service/privatenetworks/deserializers.go index 1c65324e404..d6df4f2f380 100644 --- a/service/privatenetworks/deserializers.go +++ b/service/privatenetworks/deserializers.go @@ -1205,6 +1205,9 @@ func awsRestjson1_deserializeOpErrorDeleteNetwork(response *smithyhttp.Response, } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -1358,6 +1361,9 @@ func awsRestjson1_deserializeOpErrorDeleteNetworkSite(response *smithyhttp.Respo } switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) @@ -3323,6 +3329,159 @@ func awsRestjson1_deserializeOpDocumentPingOutput(v **PingOutput, value interfac return nil } +type awsRestjson1_deserializeOpStartNetworkResourceUpdate struct { +} + +func (*awsRestjson1_deserializeOpStartNetworkResourceUpdate) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartNetworkResourceUpdate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorStartNetworkResourceUpdate(response, &metadata) + } + output := &StartNetworkResourceUpdateOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentStartNetworkResourceUpdateOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorStartNetworkResourceUpdate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentStartNetworkResourceUpdateOutput(v **StartNetworkResourceUpdateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartNetworkResourceUpdateOutput + if *v == nil { + sv = &StartNetworkResourceUpdateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "networkResource": + if err := awsRestjson1_deserializeDocumentNetworkResource(&sv.NetworkResource, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpTagResource struct { } @@ -4783,6 +4942,11 @@ func awsRestjson1_deserializeDocumentNetworkResource(v **types.NetworkResource, return err } + case "returnInformation": + if err := awsRestjson1_deserializeDocumentReturnInformation(&sv.ReturnInformation, value); err != nil { + return err + } + case "serialNumber": if value != nil { jtv, ok := value.(string) @@ -5490,6 +5654,69 @@ func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.Resourc return nil } +func awsRestjson1_deserializeDocumentReturnInformation(v **types.ReturnInformation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ReturnInformation + if *v == nil { + sv = &types.ReturnInformation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "replacementOrderArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.ReplacementOrderArn = ptr.String(jtv) + } + + case "returnReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ReturnReason = ptr.String(jtv) + } + + case "shippingAddress": + if err := awsRestjson1_deserializeDocumentAddress(&sv.ShippingAddress, value); err != nil { + return err + } + + case "shippingLabel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ShippingLabel = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentSitePlan(v **types.SitePlan, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/privatenetworks/generated.json b/service/privatenetworks/generated.json index c0592af0b1d..499a6eeecb4 100644 --- a/service/privatenetworks/generated.json +++ b/service/privatenetworks/generated.json @@ -29,6 +29,7 @@ "api_op_ListOrders.go", "api_op_ListTagsForResource.go", "api_op_Ping.go", + "api_op_StartNetworkResourceUpdate.go", "api_op_TagResource.go", "api_op_UntagResource.go", "api_op_UpdateNetworkSite.go", diff --git a/service/privatenetworks/serializers.go b/service/privatenetworks/serializers.go index 22afd147a21..7b6df2ad22b 100644 --- a/service/privatenetworks/serializers.go +++ b/service/privatenetworks/serializers.go @@ -1533,6 +1533,91 @@ func awsRestjson1_serializeOpHttpBindingsPingInput(v *PingInput, encoder *httpbi return nil } +type awsRestjson1_serializeOpStartNetworkResourceUpdate struct { +} + +func (*awsRestjson1_serializeOpStartNetworkResourceUpdate) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartNetworkResourceUpdate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartNetworkResourceUpdateInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/v1/network-resources/update") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentStartNetworkResourceUpdateInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsStartNetworkResourceUpdateInput(v *StartNetworkResourceUpdateInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartNetworkResourceUpdateInput(v *StartNetworkResourceUpdateInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NetworkResourceArn != nil { + ok := object.Key("networkResourceArn") + ok.String(*v.NetworkResourceArn) + } + + if v.ReturnReason != nil { + ok := object.Key("returnReason") + ok.String(*v.ReturnReason) + } + + if v.ShippingAddress != nil { + ok := object.Key("shippingAddress") + if err := awsRestjson1_serializeDocumentAddress(v.ShippingAddress, ok); err != nil { + return err + } + } + + if len(v.UpdateType) > 0 { + ok := object.Key("updateType") + ok.String(string(v.UpdateType)) + } + + return nil +} + type awsRestjson1_serializeOpTagResource struct { } diff --git a/service/privatenetworks/types/enums.go b/service/privatenetworks/types/enums.go index 9c45b6b1dc6..eeb5de49820 100644 --- a/service/privatenetworks/types/enums.go +++ b/service/privatenetworks/types/enums.go @@ -172,14 +172,15 @@ type NetworkResourceStatus string // Enum values for NetworkResourceStatus const ( - NetworkResourceStatusPending NetworkResourceStatus = "PENDING" - NetworkResourceStatusShipped NetworkResourceStatus = "SHIPPED" - NetworkResourceStatusProvisioning NetworkResourceStatus = "PROVISIONING" - NetworkResourceStatusProvisioned NetworkResourceStatus = "PROVISIONED" - NetworkResourceStatusAvailable NetworkResourceStatus = "AVAILABLE" - NetworkResourceStatusDeleting NetworkResourceStatus = "DELETING" - NetworkResourceStatusPendingReturn NetworkResourceStatus = "PENDING_RETURN" - NetworkResourceStatusDeleted NetworkResourceStatus = "DELETED" + NetworkResourceStatusPending NetworkResourceStatus = "PENDING" + NetworkResourceStatusShipped NetworkResourceStatus = "SHIPPED" + NetworkResourceStatusProvisioning NetworkResourceStatus = "PROVISIONING" + NetworkResourceStatusProvisioned NetworkResourceStatus = "PROVISIONED" + NetworkResourceStatusAvailable NetworkResourceStatus = "AVAILABLE" + NetworkResourceStatusDeleting NetworkResourceStatus = "DELETING" + NetworkResourceStatusPendingReturn NetworkResourceStatus = "PENDING_RETURN" + NetworkResourceStatusDeleted NetworkResourceStatus = "DELETED" + NetworkResourceStatusCreatingShippingLabel NetworkResourceStatus = "CREATING_SHIPPING_LABEL" ) // Values returns all known values for NetworkResourceStatus. Note that this can be @@ -195,6 +196,7 @@ func (NetworkResourceStatus) Values() []NetworkResourceStatus { "DELETING", "PENDING_RETURN", "DELETED", + "CREATING_SHIPPING_LABEL", } } @@ -296,6 +298,24 @@ func (OrderFilterKeys) Values() []OrderFilterKeys { } } +type UpdateType string + +// Enum values for UpdateType +const ( + UpdateTypeReplace UpdateType = "REPLACE" + UpdateTypeReturn UpdateType = "RETURN" +) + +// Values returns all known values for UpdateType. Note that this can be expanded +// in the future, and 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 (UpdateType) Values() []UpdateType { + return []UpdateType{ + "REPLACE", + "RETURN", + } +} + type ValidationExceptionReason string // Enum values for ValidationExceptionReason diff --git a/service/privatenetworks/types/types.go b/service/privatenetworks/types/types.go index d77138c76f9..5c578c329ae 100644 --- a/service/privatenetworks/types/types.go +++ b/service/privatenetworks/types/types.go @@ -171,6 +171,9 @@ type NetworkResource struct { // The position of the network resource. Position *Position + // Information about a request to return the network resource. + ReturnInformation *ReturnInformation + // The serial number of the network resource. SerialNumber *string @@ -303,6 +306,28 @@ type Position struct { noSmithyDocumentSerde } +// Information about a request to return a network resource. +type ReturnInformation struct { + + // The Amazon Resource Name (ARN) of the replacement order. + ReplacementOrderArn *string + + // The reason for the return. If the return request did not include a reason for + // the return, this value is null. + ReturnReason *string + + // The shipping address. + ShippingAddress *Address + + // The URL of the shipping label. The shipping label is available for download only + // if the status of the network resource is PENDING_RETURN. For more information, + // see Return a radio unit + // (https://docs.aws.amazon.com/private-networks/latest/userguide/radio-units.html#return-radio-unit). + ShippingLabel *string + + noSmithyDocumentSerde +} + // Information about a site plan. type SitePlan struct { diff --git a/service/privatenetworks/validators.go b/service/privatenetworks/validators.go index 8a496563d9f..35e110b6769 100644 --- a/service/privatenetworks/validators.go +++ b/service/privatenetworks/validators.go @@ -390,6 +390,26 @@ func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpStartNetworkResourceUpdate struct { +} + +func (*validateOpStartNetworkResourceUpdate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartNetworkResourceUpdate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartNetworkResourceUpdateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartNetworkResourceUpdateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpTagResource struct { } @@ -546,6 +566,10 @@ func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } +func addOpStartNetworkResourceUpdateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartNetworkResourceUpdate{}, middleware.After) +} + func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } @@ -986,6 +1010,29 @@ func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { } } +func validateOpStartNetworkResourceUpdateInput(v *StartNetworkResourceUpdateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartNetworkResourceUpdateInput"} + if v.NetworkResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("NetworkResourceArn")) + } + if len(v.UpdateType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("UpdateType")) + } + if v.ShippingAddress != nil { + if err := validateAddress(v.ShippingAddress); err != nil { + invalidParams.AddNested("ShippingAddress", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil diff --git a/service/rds/api_op_CancelExportTask.go b/service/rds/api_op_CancelExportTask.go index b1c6cf6c0b2..2eb9bdf1c61 100644 --- a/service/rds/api_op_CancelExportTask.go +++ b/service/rds/api_op_CancelExportTask.go @@ -12,8 +12,9 @@ import ( "time" ) -// Cancels an export task in progress that is exporting a snapshot to Amazon S3. -// Any data that has already been written to the S3 bucket isn't removed. +// Cancels an export task in progress that is exporting a snapshot or cluster to +// Amazon S3. Any data that has already been written to the S3 bucket isn't +// removed. func (c *Client) CancelExportTask(ctx context.Context, params *CancelExportTaskInput, optFns ...func(*Options)) (*CancelExportTaskOutput, error) { if params == nil { params = &CancelExportTaskInput{} @@ -31,7 +32,7 @@ func (c *Client) CancelExportTask(ctx context.Context, params *CancelExportTaskI type CancelExportTaskInput struct { - // The identifier of the snapshot export task to cancel. + // The identifier of the snapshot or cluster export task to cancel. // // This member is required. ExportTaskIdentifier *string @@ -39,77 +40,90 @@ type CancelExportTaskInput struct { noSmithyDocumentSerde } -// Contains the details of a snapshot export to Amazon S3. This data type is used -// as a response element in the DescribeExportTasks action. +// Contains the details of a snapshot or cluster export to Amazon S3. This data +// type is used as a response element in the DescribeExportTasks action. type CancelExportTaskOutput struct { - // The data exported from the snapshot. Valid values are the following: + // The data exported from the snapshot or cluster. Valid values are the + // following: // - // * database - // - Export all the data from a specified database. + // * database - Export all the data from a specified database. // - // * database.table table-name - - // Export a table of the snapshot. This format is valid only for RDS for MySQL, RDS - // for MariaDB, and Aurora MySQL. + // * + // database.table table-name - Export a table of the snapshot or cluster. This + // format is valid only for RDS for MySQL, RDS for MariaDB, and Aurora MySQL. // - // * database.schema schema-name - Export a - // database schema of the snapshot. This format is valid only for RDS for - // PostgreSQL and Aurora PostgreSQL. + // * + // database.schema schema-name - Export a database schema of the snapshot or + // cluster. This format is valid only for RDS for PostgreSQL and Aurora + // PostgreSQL. // - // * database.schema.table table-name - Export a - // table of the database schema. This format is valid only for RDS for PostgreSQL - // and Aurora PostgreSQL. + // * database.schema.table table-name - Export a table of the database + // schema. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL. ExportOnly []string - // A unique identifier for the snapshot export task. This ID isn't an identifier - // for the Amazon S3 bucket where the snapshot is exported to. + // A unique identifier for the snapshot or cluster export task. This ID isn't an + // identifier for the Amazon S3 bucket where the data is exported. ExportTaskIdentifier *string // The reason the export failed, if it failed. FailureCause *string // The name of the IAM role that is used to write to Amazon S3 when exporting a - // snapshot. + // snapshot or cluster. IamRoleArn *string // The key identifier of the Amazon Web Services KMS key that is used to encrypt - // the snapshot when it's exported to Amazon S3. The KMS key identifier is its key - // ARN, key ID, alias ARN, or alias name. The IAM role used for the snapshot export - // must have encryption and decryption permissions to use this KMS key. + // the data when it's exported to Amazon S3. The KMS key identifier is its key ARN, + // key ID, alias ARN, or alias name. The IAM role used for the export must have + // encryption and decryption permissions to use this KMS key. KmsKeyId *string - // The progress of the snapshot export task as a percentage. + // The progress of the snapshot or cluster export task as a percentage. PercentProgress int32 - // The Amazon S3 bucket that the snapshot is exported to. + // The Amazon S3 bucket that the snapshot or cluster is exported to. S3Bucket *string - // The Amazon S3 bucket prefix that is the file name and path of the exported - // snapshot. + // The Amazon S3 bucket prefix that is the file name and path of the exported data. S3Prefix *string // The time that the snapshot was created. SnapshotTime *time.Time - // The Amazon Resource Name (ARN) of the snapshot exported to Amazon S3. + // The Amazon Resource Name (ARN) of the snapshot or cluster exported to Amazon S3. SourceArn *string // The type of source for the export. SourceType types.ExportSourceType - // The progress status of the export task. + // The progress status of the export task. The status can be one of the + // following: + // + // * CANCELED + // + // * CANCELING + // + // * COMPLETE + // + // * FAILED + // + // * IN_PROGRESS + // + // * + // STARTING Status *string - // The time that the snapshot export task completed. + // The time that the snapshot or cluster export task ended. TaskEndTime *time.Time - // The time that the snapshot export task started. + // The time that the snapshot or cluster export task started. TaskStartTime *time.Time // The total amount of data exported, in gigabytes. TotalExtractedDataInGB int32 - // A warning about the snapshot export task. + // A warning about the snapshot or cluster export task. WarningMessage *string // Metadata pertaining to the operation's result. diff --git a/service/rds/api_op_CopyDBClusterSnapshot.go b/service/rds/api_op_CopyDBClusterSnapshot.go index 5752b8a46c1..bce3ce588e2 100644 --- a/service/rds/api_op_CopyDBClusterSnapshot.go +++ b/service/rds/api_op_CopyDBClusterSnapshot.go @@ -47,7 +47,7 @@ import ( // clusters, see What is Amazon Aurora? // (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html) // in the Amazon Aurora User Guide. For more information on Multi-AZ DB clusters, -// see Multi-AZ deployments with two readable standby DB instances +// see Multi-AZ DB cluster deployments // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) // in the Amazon RDS User Guide. func (c *Client) CopyDBClusterSnapshot(ctx context.Context, params *CopyDBClusterSnapshotInput, optFns ...func(*Options)) (*CopyDBClusterSnapshotOutput, error) { diff --git a/service/rds/api_op_CreateDBCluster.go b/service/rds/api_op_CreateDBCluster.go index 3e1a47ba537..b5ee888211a 100644 --- a/service/rds/api_op_CreateDBCluster.go +++ b/service/rds/api_op_CreateDBCluster.go @@ -16,10 +16,12 @@ import ( // Creates a new Amazon Aurora DB cluster or Multi-AZ DB cluster. You can use the // ReplicationSourceIdentifier parameter to create an Amazon Aurora DB cluster as a // read replica of another DB cluster or Amazon RDS MySQL or PostgreSQL DB -// instance. For more information on Amazon Aurora, see What is Amazon Aurora? +// instance. For more information about Amazon Aurora, see What is Amazon Aurora? // (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html) -// in the Amazon Aurora User Guide. For more information on Multi-AZ DB clusters, -// see Multi-AZ deployments with two readable standby DB instances +// in the Amazon Aurora User Guide. You can also use the +// ReplicationSourceIdentifier parameter to create a Multi-AZ DB cluster read +// replica with an RDS for PostgreSQL DB instance as the source. For more +// information about Multi-AZ DB clusters, see Multi-AZ DB cluster deployments // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) // in the Amazon RDS User Guide. func (c *Client) CreateDBCluster(ctx context.Context, params *CreateDBClusterInput, optFns ...func(*Options)) (*CreateDBClusterOutput, error) { @@ -564,7 +566,8 @@ type CreateDBClusterInput struct { PubliclyAccessible *bool // The Amazon Resource Name (ARN) of the source DB instance or DB cluster if this - // DB cluster is created as a read replica. Valid for: Aurora DB clusters only + // DB cluster is created as a read replica. Valid for: Aurora DB clusters and RDS + // for PostgreSQL Multi-AZ DB clusters ReplicationSourceIdentifier *string // For DB clusters in serverless DB engine mode, the scaling properties of the DB diff --git a/service/rds/api_op_CreateDBClusterParameterGroup.go b/service/rds/api_op_CreateDBClusterParameterGroup.go index 10ec90c0142..07d53fb2cd9 100644 --- a/service/rds/api_op_CreateDBClusterParameterGroup.go +++ b/service/rds/api_op_CreateDBClusterParameterGroup.go @@ -37,7 +37,7 @@ import ( // What is Amazon Aurora? // (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html) // in the Amazon Aurora User Guide. For more information on Multi-AZ DB clusters, -// see Multi-AZ deployments with two readable standby DB instances +// see Multi-AZ DB cluster deployments // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) // in the Amazon RDS User Guide. func (c *Client) CreateDBClusterParameterGroup(ctx context.Context, params *CreateDBClusterParameterGroupInput, optFns ...func(*Options)) (*CreateDBClusterParameterGroupOutput, error) { diff --git a/service/rds/api_op_CreateDBClusterSnapshot.go b/service/rds/api_op_CreateDBClusterSnapshot.go index 5382d98adc1..040955545eb 100644 --- a/service/rds/api_op_CreateDBClusterSnapshot.go +++ b/service/rds/api_op_CreateDBClusterSnapshot.go @@ -15,7 +15,7 @@ import ( // What is Amazon Aurora? // (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html) // in the Amazon Aurora User Guide. For more information on Multi-AZ DB clusters, -// see Multi-AZ deployments with two readable standby DB instances +// see Multi-AZ DB cluster deployments // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) // in the Amazon RDS User Guide. func (c *Client) CreateDBClusterSnapshot(ctx context.Context, params *CreateDBClusterSnapshotInput, optFns ...func(*Options)) (*CreateDBClusterSnapshotOutput, error) { diff --git a/service/rds/api_op_CreateDBInstanceReadReplica.go b/service/rds/api_op_CreateDBInstanceReadReplica.go index 28bcbde0ead..2115754caaa 100644 --- a/service/rds/api_op_CreateDBInstanceReadReplica.go +++ b/service/rds/api_op_CreateDBInstanceReadReplica.go @@ -91,8 +91,8 @@ type CreateDBInstanceReadReplicaInput struct { // The amount of storage (in gibibytes) to allocate initially for the read replica. // Follow the allocation rules specified in CreateDBInstance. Be sure to allocate - // enough memory for your read replica so that the create operation can succeed. - // You can also allocate additional memory for future growth. + // enough storage for your read replica so that the create operation can succeed. + // You can also allocate additional storage for future growth. AllocatedStorage *int32 // A value that indicates whether minor engine upgrades are applied automatically diff --git a/service/rds/api_op_DeleteBlueGreenDeployment.go b/service/rds/api_op_DeleteBlueGreenDeployment.go index c32ddd9d746..e40d4e818d0 100644 --- a/service/rds/api_op_DeleteBlueGreenDeployment.go +++ b/service/rds/api_op_DeleteBlueGreenDeployment.go @@ -45,6 +45,9 @@ type DeleteBlueGreenDeploymentInput struct { BlueGreenDeploymentIdentifier *string // A value that indicates whether to delete the resources in the green environment. + // You can't specify this option if the blue/green deployment status + // (https://docs.aws.amazon.com/AmazonRDS/latest/APIReference/API_BlueGreenDeployment.html) + // is SWITCHOVER_COMPLETED. DeleteTarget *bool noSmithyDocumentSerde diff --git a/service/rds/api_op_DeleteDBCluster.go b/service/rds/api_op_DeleteDBCluster.go index 1003309e889..50c65a1be1a 100644 --- a/service/rds/api_op_DeleteDBCluster.go +++ b/service/rds/api_op_DeleteDBCluster.go @@ -17,7 +17,7 @@ import ( // not deleted. For more information on Amazon Aurora, see What is Amazon Aurora? // (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html) // in the Amazon Aurora User Guide. For more information on Multi-AZ DB clusters, -// see Multi-AZ deployments with two readable standby DB instances +// see Multi-AZ DB cluster deployments // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) // in the Amazon RDS User Guide. func (c *Client) DeleteDBCluster(ctx context.Context, params *DeleteDBClusterInput, optFns ...func(*Options)) (*DeleteDBClusterOutput, error) { diff --git a/service/rds/api_op_DeleteDBClusterParameterGroup.go b/service/rds/api_op_DeleteDBClusterParameterGroup.go index 536fdda7535..36aa0556780 100644 --- a/service/rds/api_op_DeleteDBClusterParameterGroup.go +++ b/service/rds/api_op_DeleteDBClusterParameterGroup.go @@ -15,7 +15,7 @@ import ( // Amazon Aurora, see What is Amazon Aurora? // (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html) // in the Amazon Aurora User Guide. For more information on Multi-AZ DB clusters, -// see Multi-AZ deployments with two readable standby DB instances +// see Multi-AZ DB cluster deployments // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) // in the Amazon RDS User Guide. func (c *Client) DeleteDBClusterParameterGroup(ctx context.Context, params *DeleteDBClusterParameterGroupInput, optFns ...func(*Options)) (*DeleteDBClusterParameterGroupOutput, error) { diff --git a/service/rds/api_op_DeleteDBClusterSnapshot.go b/service/rds/api_op_DeleteDBClusterSnapshot.go index af2cc9ca2ba..162035ec292 100644 --- a/service/rds/api_op_DeleteDBClusterSnapshot.go +++ b/service/rds/api_op_DeleteDBClusterSnapshot.go @@ -17,7 +17,7 @@ import ( // Aurora? // (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html) // in the Amazon Aurora User Guide. For more information on Multi-AZ DB clusters, -// see Multi-AZ deployments with two readable standby DB instances +// see Multi-AZ DB cluster deployments // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) // in the Amazon RDS User Guide. func (c *Client) DeleteDBClusterSnapshot(ctx context.Context, params *DeleteDBClusterSnapshotInput, optFns ...func(*Options)) (*DeleteDBClusterSnapshotOutput, error) { diff --git a/service/rds/api_op_DescribeDBClusterParameterGroups.go b/service/rds/api_op_DescribeDBClusterParameterGroups.go index 4ba485a8823..29af610bc02 100644 --- a/service/rds/api_op_DescribeDBClusterParameterGroups.go +++ b/service/rds/api_op_DescribeDBClusterParameterGroups.go @@ -18,7 +18,7 @@ import ( // information on Amazon Aurora, see What is Amazon Aurora? // (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html) // in the Amazon Aurora User Guide. For more information on Multi-AZ DB clusters, -// see Multi-AZ deployments with two readable standby DB instances +// see Multi-AZ DB cluster deployments // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) // in the Amazon RDS User Guide. func (c *Client) DescribeDBClusterParameterGroups(ctx context.Context, params *DescribeDBClusterParameterGroupsInput, optFns ...func(*Options)) (*DescribeDBClusterParameterGroupsOutput, error) { diff --git a/service/rds/api_op_DescribeDBClusterParameters.go b/service/rds/api_op_DescribeDBClusterParameters.go index d2b85e883c0..ade95ba5150 100644 --- a/service/rds/api_op_DescribeDBClusterParameters.go +++ b/service/rds/api_op_DescribeDBClusterParameters.go @@ -16,7 +16,7 @@ import ( // For more information on Amazon Aurora, see What is Amazon Aurora? // (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html) // in the Amazon Aurora User Guide. For more information on Multi-AZ DB clusters, -// see Multi-AZ deployments with two readable standby DB instances +// see Multi-AZ DB cluster deployments // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) // in the Amazon RDS User Guide. func (c *Client) DescribeDBClusterParameters(ctx context.Context, params *DescribeDBClusterParametersInput, optFns ...func(*Options)) (*DescribeDBClusterParametersOutput, error) { diff --git a/service/rds/api_op_DescribeDBClusterSnapshots.go b/service/rds/api_op_DescribeDBClusterSnapshots.go index 53cc2b06bef..ec0b0237c17 100644 --- a/service/rds/api_op_DescribeDBClusterSnapshots.go +++ b/service/rds/api_op_DescribeDBClusterSnapshots.go @@ -23,7 +23,7 @@ import ( // Amazon Aurora? // (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html) // in the Amazon Aurora User Guide. For more information on Multi-AZ DB clusters, -// see Multi-AZ deployments with two readable standby DB instances +// see Multi-AZ DB cluster deployments // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) // in the Amazon RDS User Guide. func (c *Client) DescribeDBClusterSnapshots(ctx context.Context, params *DescribeDBClusterSnapshotsInput, optFns ...func(*Options)) (*DescribeDBClusterSnapshotsOutput, error) { diff --git a/service/rds/api_op_DescribeDBClusters.go b/service/rds/api_op_DescribeDBClusters.go index 0162932dc33..a3d78c4dd4b 100644 --- a/service/rds/api_op_DescribeDBClusters.go +++ b/service/rds/api_op_DescribeDBClusters.go @@ -23,7 +23,7 @@ import ( // see What is Amazon Aurora? // (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html) // in the Amazon Aurora User Guide. For more information on Multi-AZ DB clusters, -// see Multi-AZ deployments with two readable standby DB instances +// see Multi-AZ DB cluster deployments // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) // in the Amazon RDS User Guide. This operation can also return information for // Amazon Neptune DB instances and Amazon DocumentDB instances. diff --git a/service/rds/api_op_DescribeExportTasks.go b/service/rds/api_op_DescribeExportTasks.go index 4abf297cfc1..7e37e456c2f 100644 --- a/service/rds/api_op_DescribeExportTasks.go +++ b/service/rds/api_op_DescribeExportTasks.go @@ -12,8 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns information about a snapshot export to Amazon S3. This API operation -// supports pagination. +// Returns information about a snapshot or cluster export to Amazon S3. This API +// operation supports pagination. func (c *Client) DescribeExportTasks(ctx context.Context, params *DescribeExportTasksInput, optFns ...func(*Options)) (*DescribeExportTasksOutput, error) { if params == nil { params = &DescribeExportTasksInput{} @@ -31,25 +31,25 @@ func (c *Client) DescribeExportTasks(ctx context.Context, params *DescribeExport type DescribeExportTasksInput struct { - // The identifier of the snapshot export task to be described. + // The identifier of the snapshot or cluster export task to be described. ExportTaskIdentifier *string - // Filters specify one or more snapshot exports to describe. The filters are - // specified as name-value pairs that define what to include in the output. Filter - // names and values are case-sensitive. Supported filters include the following: + // Filters specify one or more snapshot or cluster exports to describe. The filters + // are specified as name-value pairs that define what to include in the output. + // Filter names and values are case-sensitive. Supported filters include the + // following: // - // * - // export-task-identifier - An identifier for the snapshot export task. + // * export-task-identifier - An identifier for the snapshot or cluster + // export task. + // + // * s3-bucket - The Amazon S3 bucket the data is exported to. // // * - // s3-bucket - The Amazon S3 bucket the snapshot is exported to. + // source-arn - The Amazon Resource Name (ARN) of the snapshot or cluster exported + // to Amazon S3. // - // * source-arn - - // The Amazon Resource Name (ARN) of the snapshot exported to Amazon S3 - // - // * status - - // The status of the export task. Must be lowercase. Valid statuses are the - // following: + // * status - The status of the export task. Must be lowercase. + // Valid statuses are the following: // // * canceled // @@ -57,12 +57,12 @@ type DescribeExportTasksInput struct { // // * complete // - // * failed + // * + // failed // // * in_progress // - // * - // starting + // * starting Filters []types.Filter // An optional pagination token provided by a previous DescribeExportTasks request. @@ -77,7 +77,7 @@ type DescribeExportTasksInput struct { // 100. MaxRecords *int32 - // The Amazon Resource Name (ARN) of the snapshot exported to Amazon S3. + // The Amazon Resource Name (ARN) of the snapshot or cluster exported to Amazon S3. SourceArn *string // The type of source for the export. @@ -88,7 +88,7 @@ type DescribeExportTasksInput struct { type DescribeExportTasksOutput struct { - // Information about an export of a snapshot to Amazon S3. + // Information about an export of a snapshot or cluster to Amazon S3. ExportTasks []types.ExportTask // A pagination token that can be used in a later DescribeExportTasks request. A diff --git a/service/rds/api_op_FailoverDBCluster.go b/service/rds/api_op_FailoverDBCluster.go index 04f408ac806..8bdb1dbd3c3 100644 --- a/service/rds/api_op_FailoverDBCluster.go +++ b/service/rds/api_op_FailoverDBCluster.go @@ -26,7 +26,7 @@ import ( // more information on Amazon Aurora DB clusters, see What is Amazon Aurora? // (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html) // in the Amazon Aurora User Guide. For more information on Multi-AZ DB clusters, -// see Multi-AZ deployments with two readable standby DB instances +// see Multi-AZ DB cluster deployments // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) // in the Amazon RDS User Guide. func (c *Client) FailoverDBCluster(ctx context.Context, params *FailoverDBClusterInput, optFns ...func(*Options)) (*FailoverDBClusterOutput, error) { diff --git a/service/rds/api_op_ModifyActivityStream.go b/service/rds/api_op_ModifyActivityStream.go index f01acef34a2..5fbe5ec6a67 100644 --- a/service/rds/api_op_ModifyActivityStream.go +++ b/service/rds/api_op_ModifyActivityStream.go @@ -18,8 +18,8 @@ import ( // activity stream isn't required. For more information, see Modifying a database // activity stream // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/DBActivityStreams.Modifying.html) -// in the Amazon RDS User Guide. This operation is supported for RDS for Oracle -// only. +// in the Amazon RDS User Guide. This operation is supported for RDS for Oracle and +// Microsoft SQL Server. func (c *Client) ModifyActivityStream(ctx context.Context, params *ModifyActivityStreamInput, optFns ...func(*Options)) (*ModifyActivityStreamOutput, error) { if params == nil { params = &ModifyActivityStreamInput{} @@ -42,8 +42,8 @@ type ModifyActivityStreamInput struct { // stream is unlocked or stopped. AuditPolicyState types.AuditPolicyState - // The Amazon Resource Name (ARN) of the RDS for Oracle DB instance, for example, - // arn:aws:rds:us-east-1:12345667890:instance:my-orcl-db. + // The Amazon Resource Name (ARN) of the RDS for Oracle or Microsoft SQL Server DB + // instance. For example, arn:aws:rds:us-east-1:12345667890:instance:my-orcl-db. ResourceArn *string noSmithyDocumentSerde diff --git a/service/rds/api_op_ModifyDBCluster.go b/service/rds/api_op_ModifyDBCluster.go index 37c6fbc91f5..e963b5f8531 100644 --- a/service/rds/api_op_ModifyDBCluster.go +++ b/service/rds/api_op_ModifyDBCluster.go @@ -17,7 +17,7 @@ import ( // What is Amazon Aurora? // (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html) // in the Amazon Aurora User Guide. For more information on Multi-AZ DB clusters, -// see Multi-AZ deployments with two readable standby DB instances +// see Multi-AZ DB cluster deployments // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) // in the Amazon RDS User Guide. func (c *Client) ModifyDBCluster(ctx context.Context, params *ModifyDBClusterInput, optFns ...func(*Options)) (*ModifyDBClusterOutput, error) { diff --git a/service/rds/api_op_ModifyDBClusterParameterGroup.go b/service/rds/api_op_ModifyDBClusterParameterGroup.go index 7696620d13f..0e3ecd2810a 100644 --- a/service/rds/api_op_ModifyDBClusterParameterGroup.go +++ b/service/rds/api_op_ModifyDBClusterParameterGroup.go @@ -32,7 +32,7 @@ import ( // clusters, see What is Amazon Aurora? // (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html) // in the Amazon Aurora User Guide. For more information on Multi-AZ DB clusters, -// see Multi-AZ deployments with two readable standby DB instances +// see Multi-AZ DB cluster deployments // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) // in the Amazon RDS User Guide. func (c *Client) ModifyDBClusterParameterGroup(ctx context.Context, params *ModifyDBClusterParameterGroupInput, optFns ...func(*Options)) (*ModifyDBClusterParameterGroupOutput, error) { diff --git a/service/rds/api_op_RebootDBCluster.go b/service/rds/api_op_RebootDBCluster.go index 4dbbc1650a0..833d7bac40e 100644 --- a/service/rds/api_op_RebootDBCluster.go +++ b/service/rds/api_op_RebootDBCluster.go @@ -18,7 +18,7 @@ import ( // service. Rebooting a DB cluster results in a momentary outage, during which the // DB cluster status is set to rebooting. Use this operation only for a non-Aurora // Multi-AZ DB cluster. For more information on Multi-AZ DB clusters, see Multi-AZ -// deployments with two readable standby DB instances +// DB cluster deployments // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) // in the Amazon RDS User Guide. func (c *Client) RebootDBCluster(ctx context.Context, params *RebootDBClusterInput, optFns ...func(*Options)) (*RebootDBClusterOutput, error) { diff --git a/service/rds/api_op_RemoveRoleFromDBCluster.go b/service/rds/api_op_RemoveRoleFromDBCluster.go index 729042135ae..7b0a2809048 100644 --- a/service/rds/api_op_RemoveRoleFromDBCluster.go +++ b/service/rds/api_op_RemoveRoleFromDBCluster.go @@ -15,7 +15,7 @@ import ( // DB clusters, see What is Amazon Aurora? // (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html) // in the Amazon Aurora User Guide. For more information on Multi-AZ DB clusters, -// see Multi-AZ deployments with two readable standby DB instances +// see Multi-AZ DB cluster deployments // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) // in the Amazon RDS User Guide. func (c *Client) RemoveRoleFromDBCluster(ctx context.Context, params *RemoveRoleFromDBClusterInput, optFns ...func(*Options)) (*RemoveRoleFromDBClusterOutput, error) { diff --git a/service/rds/api_op_ResetDBClusterParameterGroup.go b/service/rds/api_op_ResetDBClusterParameterGroup.go index 44cfa258338..d77d1549b33 100644 --- a/service/rds/api_op_ResetDBClusterParameterGroup.go +++ b/service/rds/api_op_ResetDBClusterParameterGroup.go @@ -23,7 +23,7 @@ import ( // Aurora? // (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html) // in the Amazon Aurora User Guide. For more information on Multi-AZ DB clusters, -// see Multi-AZ deployments with two readable standby DB instances +// see Multi-AZ DB cluster deployments // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) // in the Amazon RDS User Guide. func (c *Client) ResetDBClusterParameterGroup(ctx context.Context, params *ResetDBClusterParameterGroupInput, optFns ...func(*Options)) (*ResetDBClusterParameterGroupOutput, error) { diff --git a/service/rds/api_op_RestoreDBClusterFromSnapshot.go b/service/rds/api_op_RestoreDBClusterFromSnapshot.go index 1a91fa9d288..39e723648d3 100644 --- a/service/rds/api_op_RestoreDBClusterFromSnapshot.go +++ b/service/rds/api_op_RestoreDBClusterFromSnapshot.go @@ -23,7 +23,7 @@ import ( // Amazon Aurora? // (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html) // in the Amazon Aurora User Guide. For more information on Multi-AZ DB clusters, -// see Multi-AZ deployments with two readable standby DB instances +// see Multi-AZ DB cluster deployments // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) // in the Amazon RDS User Guide. func (c *Client) RestoreDBClusterFromSnapshot(ctx context.Context, params *RestoreDBClusterFromSnapshotInput, optFns ...func(*Options)) (*RestoreDBClusterFromSnapshotOutput, error) { diff --git a/service/rds/api_op_RestoreDBClusterToPointInTime.go b/service/rds/api_op_RestoreDBClusterToPointInTime.go index 09049899154..d67fd95de13 100644 --- a/service/rds/api_op_RestoreDBClusterToPointInTime.go +++ b/service/rds/api_op_RestoreDBClusterToPointInTime.go @@ -26,7 +26,7 @@ import ( // Amazon Aurora? // (https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/CHAP_AuroraOverview.html) // in the Amazon Aurora User Guide. For more information on Multi-AZ DB clusters, -// see Multi-AZ deployments with two readable standby DB instances +// see Multi-AZ DB cluster deployments // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) // in the Amazon RDS User Guide. func (c *Client) RestoreDBClusterToPointInTime(ctx context.Context, params *RestoreDBClusterToPointInTimeInput, optFns ...func(*Options)) (*RestoreDBClusterToPointInTimeOutput, error) { diff --git a/service/rds/api_op_RestoreDBInstanceFromDBSnapshot.go b/service/rds/api_op_RestoreDBInstanceFromDBSnapshot.go index 993cb09afd3..72ba581c9f0 100644 --- a/service/rds/api_op_RestoreDBInstanceFromDBSnapshot.go +++ b/service/rds/api_op_RestoreDBInstanceFromDBSnapshot.go @@ -63,8 +63,8 @@ type RestoreDBInstanceFromDBSnapshotInput struct { // The amount of storage (in gibibytes) to allocate initially for the DB instance. // Follow the allocation rules specified in CreateDBInstance. Be sure to allocate - // enough memory for your new DB instance so that the restore operation can - // succeed. You can also allocate additional memory for future growth. + // enough storage for your new DB instance so that the restore operation can + // succeed. You can also allocate additional storage for future growth. AllocatedStorage *int32 // A value that indicates whether minor version upgrades are applied automatically @@ -117,8 +117,8 @@ type RestoreDBInstanceFromDBSnapshotInput struct { CustomIamInstanceProfile *string // The identifier for the RDS for MySQL Multi-AZ DB cluster snapshot to restore - // from. For more information on Multi-AZ DB clusters, see Multi-AZ deployments - // with two readable standby DB instances + // from. For more information on Multi-AZ DB clusters, see Multi-AZ DB cluster + // deployments // (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/multi-az-db-clusters-concepts.html) // in the Amazon RDS User Guide. Constraints: // diff --git a/service/rds/api_op_RestoreDBInstanceFromS3.go b/service/rds/api_op_RestoreDBInstanceFromS3.go index 588eca492b3..81fcc087885 100644 --- a/service/rds/api_op_RestoreDBInstanceFromS3.go +++ b/service/rds/api_op_RestoreDBInstanceFromS3.go @@ -92,8 +92,8 @@ type RestoreDBInstanceFromS3Input struct { // The amount of storage (in gibibytes) to allocate initially for the DB instance. // Follow the allocation rules specified in CreateDBInstance. Be sure to allocate - // enough memory for your new DB instance so that the restore operation can - // succeed. You can also allocate additional memory for future growth. + // enough storage for your new DB instance so that the restore operation can + // succeed. You can also allocate additional storage for future growth. AllocatedStorage *int32 // A value that indicates whether minor engine upgrades are applied automatically diff --git a/service/rds/api_op_RestoreDBInstanceToPointInTime.go b/service/rds/api_op_RestoreDBInstanceToPointInTime.go index 9f3d3cdde1c..6377bb53441 100644 --- a/service/rds/api_op_RestoreDBInstanceToPointInTime.go +++ b/service/rds/api_op_RestoreDBInstanceToPointInTime.go @@ -55,8 +55,8 @@ type RestoreDBInstanceToPointInTimeInput struct { // The amount of storage (in gibibytes) to allocate initially for the DB instance. // Follow the allocation rules specified in CreateDBInstance. Be sure to allocate - // enough memory for your new DB instance so that the restore operation can - // succeed. You can also allocate additional memory for future growth. + // enough storage for your new DB instance so that the restore operation can + // succeed. You can also allocate additional storage for future growth. AllocatedStorage *int32 // A value that indicates whether minor version upgrades are applied automatically diff --git a/service/rds/api_op_StartActivityStream.go b/service/rds/api_op_StartActivityStream.go index 54b0508b063..7330bc14704 100644 --- a/service/rds/api_op_StartActivityStream.go +++ b/service/rds/api_op_StartActivityStream.go @@ -60,8 +60,8 @@ type StartActivityStreamInput struct { ApplyImmediately *bool // Specifies whether the database activity stream includes engine-native audit - // fields. This option only applies to an Oracle DB instance. By default, no - // engine-native audit fields are included. + // fields. This option applies to an Oracle or Microsoft SQL Server DB instance. By + // default, no engine-native audit fields are included. EngineNativeAuditFieldsIncluded *bool noSmithyDocumentSerde diff --git a/service/rds/api_op_StartExportTask.go b/service/rds/api_op_StartExportTask.go index 024d117f62e..dee2d303a0d 100644 --- a/service/rds/api_op_StartExportTask.go +++ b/service/rds/api_op_StartExportTask.go @@ -12,8 +12,18 @@ import ( "time" ) -// Starts an export of a snapshot to Amazon S3. The provided IAM role must have -// access to the S3 bucket. This command doesn't apply to RDS Custom. +// Starts an export of DB snapshot or DB cluster data to Amazon S3. The provided +// IAM role must have access to the S3 bucket. You can't export snapshot data from +// RDS Custom DB instances. You can't export cluster data from Multi-AZ DB +// clusters. For more information on exporting DB snapshot data, see Exporting DB +// snapshot data to Amazon S3 +// (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ExportSnapshot.html) +// in the Amazon RDS User Guide or Exporting DB cluster snapshot data to Amazon S3 +// (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/aurora-export-snapshot.html) +// in the Amazon Aurora User Guide. For more information on exporting DB cluster +// data, see Exporting DB cluster data to Amazon S3 +// (https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/export-cluster-data.html) +// in the Amazon Aurora User Guide. func (c *Client) StartExportTask(ctx context.Context, params *StartExportTaskInput, optFns ...func(*Options)) (*StartExportTaskOutput, error) { if params == nil { params = &StartExportTaskInput{} @@ -31,155 +41,168 @@ func (c *Client) StartExportTask(ctx context.Context, params *StartExportTaskInp type StartExportTaskInput struct { - // A unique identifier for the snapshot export task. This ID isn't an identifier - // for the Amazon S3 bucket where the snapshot is to be exported to. + // A unique identifier for the export task. This ID isn't an identifier for the + // Amazon S3 bucket where the data is to be exported. // // This member is required. ExportTaskIdentifier *string // The name of the IAM role to use for writing to the Amazon S3 bucket when - // exporting a snapshot. + // exporting a snapshot or cluster. // // This member is required. IamRoleArn *string - // The ID of the Amazon Web Services KMS key to use to encrypt the snapshot - // exported to Amazon S3. The Amazon Web Services KMS key identifier is the key - // ARN, key ID, alias ARN, or alias name for the KMS key. The caller of this - // operation must be authorized to run the following operations. These can be set - // in the Amazon Web Services KMS key policy: + // The ID of the Amazon Web Services KMS key to use to encrypt the data exported to + // Amazon S3. The Amazon Web Services KMS key identifier is the key ARN, key ID, + // alias ARN, or alias name for the KMS key. The caller of this operation must be + // authorized to run the following operations. These can be set in the Amazon Web + // Services KMS key policy: // // * kms:Encrypt // // * kms:Decrypt // - // * - // kms:GenerateDataKey - // - // * kms:GenerateDataKeyWithoutPlaintext + // * kms:GenerateDataKey // // * - // kms:ReEncryptFrom + // kms:GenerateDataKeyWithoutPlaintext + // + // * kms:ReEncryptFrom // // * kms:ReEncryptTo // - // * kms:CreateGrant + // * + // kms:CreateGrant // // * kms:DescribeKey // - // * - // kms:RetireGrant + // * kms:RetireGrant // // This member is required. KmsKeyId *string - // The name of the Amazon S3 bucket to export the snapshot to. + // The name of the Amazon S3 bucket to export the snapshot or cluster data to. // // This member is required. S3BucketName *string - // The Amazon Resource Name (ARN) of the snapshot to export to Amazon S3. + // The Amazon Resource Name (ARN) of the snapshot or cluster to export to Amazon + // S3. // // This member is required. SourceArn *string - // The data to be exported from the snapshot. If this parameter is not provided, - // all the snapshot data is exported. Valid values are the following: + // The data to be exported from the snapshot or cluster. If this parameter is not + // provided, all of the data is exported. Valid values are the following: // - // * database - - // Export all the data from a specified database. + // * + // database - Export all the data from a specified database. // - // * database.table table-name - - // Export a table of the snapshot. This format is valid only for RDS for MySQL, RDS - // for MariaDB, and Aurora MySQL. + // * database.table + // table-name - Export a table of the snapshot or cluster. This format is valid + // only for RDS for MySQL, RDS for MariaDB, and Aurora MySQL. // - // * database.schema schema-name - Export a - // database schema of the snapshot. This format is valid only for RDS for - // PostgreSQL and Aurora PostgreSQL. + // * database.schema + // schema-name - Export a database schema of the snapshot or cluster. This format + // is valid only for RDS for PostgreSQL and Aurora PostgreSQL. // - // * database.schema.table table-name - Export a - // table of the database schema. This format is valid only for RDS for PostgreSQL - // and Aurora PostgreSQL. + // * + // database.schema.table table-name - Export a table of the database schema. This + // format is valid only for RDS for PostgreSQL and Aurora PostgreSQL. ExportOnly []string // The Amazon S3 bucket prefix to use as the file name and path of the exported - // snapshot. + // data. S3Prefix *string noSmithyDocumentSerde } -// Contains the details of a snapshot export to Amazon S3. This data type is used -// as a response element in the DescribeExportTasks action. +// Contains the details of a snapshot or cluster export to Amazon S3. This data +// type is used as a response element in the DescribeExportTasks action. type StartExportTaskOutput struct { - // The data exported from the snapshot. Valid values are the following: + // The data exported from the snapshot or cluster. Valid values are the + // following: // - // * database - // - Export all the data from a specified database. + // * database - Export all the data from a specified database. // - // * database.table table-name - - // Export a table of the snapshot. This format is valid only for RDS for MySQL, RDS - // for MariaDB, and Aurora MySQL. + // * + // database.table table-name - Export a table of the snapshot or cluster. This + // format is valid only for RDS for MySQL, RDS for MariaDB, and Aurora MySQL. // - // * database.schema schema-name - Export a - // database schema of the snapshot. This format is valid only for RDS for - // PostgreSQL and Aurora PostgreSQL. + // * + // database.schema schema-name - Export a database schema of the snapshot or + // cluster. This format is valid only for RDS for PostgreSQL and Aurora + // PostgreSQL. // - // * database.schema.table table-name - Export a - // table of the database schema. This format is valid only for RDS for PostgreSQL - // and Aurora PostgreSQL. + // * database.schema.table table-name - Export a table of the database + // schema. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL. ExportOnly []string - // A unique identifier for the snapshot export task. This ID isn't an identifier - // for the Amazon S3 bucket where the snapshot is exported to. + // A unique identifier for the snapshot or cluster export task. This ID isn't an + // identifier for the Amazon S3 bucket where the data is exported. ExportTaskIdentifier *string // The reason the export failed, if it failed. FailureCause *string // The name of the IAM role that is used to write to Amazon S3 when exporting a - // snapshot. + // snapshot or cluster. IamRoleArn *string // The key identifier of the Amazon Web Services KMS key that is used to encrypt - // the snapshot when it's exported to Amazon S3. The KMS key identifier is its key - // ARN, key ID, alias ARN, or alias name. The IAM role used for the snapshot export - // must have encryption and decryption permissions to use this KMS key. + // the data when it's exported to Amazon S3. The KMS key identifier is its key ARN, + // key ID, alias ARN, or alias name. The IAM role used for the export must have + // encryption and decryption permissions to use this KMS key. KmsKeyId *string - // The progress of the snapshot export task as a percentage. + // The progress of the snapshot or cluster export task as a percentage. PercentProgress int32 - // The Amazon S3 bucket that the snapshot is exported to. + // The Amazon S3 bucket that the snapshot or cluster is exported to. S3Bucket *string - // The Amazon S3 bucket prefix that is the file name and path of the exported - // snapshot. + // The Amazon S3 bucket prefix that is the file name and path of the exported data. S3Prefix *string // The time that the snapshot was created. SnapshotTime *time.Time - // The Amazon Resource Name (ARN) of the snapshot exported to Amazon S3. + // The Amazon Resource Name (ARN) of the snapshot or cluster exported to Amazon S3. SourceArn *string // The type of source for the export. SourceType types.ExportSourceType - // The progress status of the export task. + // The progress status of the export task. The status can be one of the + // following: + // + // * CANCELED + // + // * CANCELING + // + // * COMPLETE + // + // * FAILED + // + // * IN_PROGRESS + // + // * + // STARTING Status *string - // The time that the snapshot export task completed. + // The time that the snapshot or cluster export task ended. TaskEndTime *time.Time - // The time that the snapshot export task started. + // The time that the snapshot or cluster export task started. TaskStartTime *time.Time // The total amount of data exported, in gigabytes. TotalExtractedDataInGB int32 - // A warning about the snapshot export task. + // A warning about the snapshot or cluster export task. WarningMessage *string // Metadata pertaining to the operation's result. diff --git a/service/rds/types/types.go b/service/rds/types/types.go index 828882bdf10..7710a2a7d3b 100644 --- a/service/rds/types/types.go +++ b/service/rds/types/types.go @@ -2612,77 +2612,90 @@ type EventSubscription struct { noSmithyDocumentSerde } -// Contains the details of a snapshot export to Amazon S3. This data type is used -// as a response element in the DescribeExportTasks action. +// Contains the details of a snapshot or cluster export to Amazon S3. This data +// type is used as a response element in the DescribeExportTasks action. type ExportTask struct { - // The data exported from the snapshot. Valid values are the following: + // The data exported from the snapshot or cluster. Valid values are the + // following: // - // * database - // - Export all the data from a specified database. + // * database - Export all the data from a specified database. // - // * database.table table-name - - // Export a table of the snapshot. This format is valid only for RDS for MySQL, RDS - // for MariaDB, and Aurora MySQL. + // * + // database.table table-name - Export a table of the snapshot or cluster. This + // format is valid only for RDS for MySQL, RDS for MariaDB, and Aurora MySQL. // - // * database.schema schema-name - Export a - // database schema of the snapshot. This format is valid only for RDS for - // PostgreSQL and Aurora PostgreSQL. + // * + // database.schema schema-name - Export a database schema of the snapshot or + // cluster. This format is valid only for RDS for PostgreSQL and Aurora + // PostgreSQL. // - // * database.schema.table table-name - Export a - // table of the database schema. This format is valid only for RDS for PostgreSQL - // and Aurora PostgreSQL. + // * database.schema.table table-name - Export a table of the database + // schema. This format is valid only for RDS for PostgreSQL and Aurora PostgreSQL. ExportOnly []string - // A unique identifier for the snapshot export task. This ID isn't an identifier - // for the Amazon S3 bucket where the snapshot is exported to. + // A unique identifier for the snapshot or cluster export task. This ID isn't an + // identifier for the Amazon S3 bucket where the data is exported. ExportTaskIdentifier *string // The reason the export failed, if it failed. FailureCause *string // The name of the IAM role that is used to write to Amazon S3 when exporting a - // snapshot. + // snapshot or cluster. IamRoleArn *string // The key identifier of the Amazon Web Services KMS key that is used to encrypt - // the snapshot when it's exported to Amazon S3. The KMS key identifier is its key - // ARN, key ID, alias ARN, or alias name. The IAM role used for the snapshot export - // must have encryption and decryption permissions to use this KMS key. + // the data when it's exported to Amazon S3. The KMS key identifier is its key ARN, + // key ID, alias ARN, or alias name. The IAM role used for the export must have + // encryption and decryption permissions to use this KMS key. KmsKeyId *string - // The progress of the snapshot export task as a percentage. + // The progress of the snapshot or cluster export task as a percentage. PercentProgress int32 - // The Amazon S3 bucket that the snapshot is exported to. + // The Amazon S3 bucket that the snapshot or cluster is exported to. S3Bucket *string - // The Amazon S3 bucket prefix that is the file name and path of the exported - // snapshot. + // The Amazon S3 bucket prefix that is the file name and path of the exported data. S3Prefix *string // The time that the snapshot was created. SnapshotTime *time.Time - // The Amazon Resource Name (ARN) of the snapshot exported to Amazon S3. + // The Amazon Resource Name (ARN) of the snapshot or cluster exported to Amazon S3. SourceArn *string // The type of source for the export. SourceType ExportSourceType - // The progress status of the export task. + // The progress status of the export task. The status can be one of the + // following: + // + // * CANCELED + // + // * CANCELING + // + // * COMPLETE + // + // * FAILED + // + // * IN_PROGRESS + // + // * + // STARTING Status *string - // The time that the snapshot export task completed. + // The time that the snapshot or cluster export task ended. TaskEndTime *time.Time - // The time that the snapshot export task started. + // The time that the snapshot or cluster export task started. TaskStartTime *time.Time // The total amount of data exported, in gigabytes. TotalExtractedDataInGB int32 - // A warning about the snapshot export task. + // A warning about the snapshot or cluster export task. WarningMessage *string noSmithyDocumentSerde diff --git a/service/wafv2/deserializers.go b/service/wafv2/deserializers.go index 7b51cd52ff2..bbc1923adf4 100644 --- a/service/wafv2/deserializers.go +++ b/service/wafv2/deserializers.go @@ -6806,6 +6806,56 @@ func awsAwsjson11_deserializeDocumentAndStatement(v **types.AndStatement, value return nil } +func awsAwsjson11_deserializeDocumentAWSManagedRulesATPRuleSet(v **types.AWSManagedRulesATPRuleSet, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AWSManagedRulesATPRuleSet + if *v == nil { + sv = &types.AWSManagedRulesATPRuleSet{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LoginPath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.LoginPath = ptr.String(jtv) + } + + case "RequestInspection": + if err := awsAwsjson11_deserializeDocumentRequestInspection(&sv.RequestInspection, value); err != nil { + return err + } + + case "ResponseInspection": + if err := awsAwsjson11_deserializeDocumentResponseInspection(&sv.ResponseInspection, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentAWSManagedRulesBotControlRuleSet(v **types.AWSManagedRulesBotControlRuleSet, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9574,6 +9624,11 @@ func awsAwsjson11_deserializeDocumentManagedRuleGroupConfig(v **types.ManagedRul for key, value := range shape { switch key { + case "AWSManagedRulesATPRuleSet": + if err := awsAwsjson11_deserializeDocumentAWSManagedRulesATPRuleSet(&sv.AWSManagedRulesATPRuleSet, value); err != nil { + return err + } + case "AWSManagedRulesBotControlRuleSet": if err := awsAwsjson11_deserializeDocumentAWSManagedRulesBotControlRuleSet(&sv.AWSManagedRulesBotControlRuleSet, value); err != nil { return err @@ -11181,6 +11236,56 @@ func awsAwsjson11_deserializeDocumentReleaseSummary(v **types.ReleaseSummary, va return nil } +func awsAwsjson11_deserializeDocumentRequestInspection(v **types.RequestInspection, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.RequestInspection + if *v == nil { + sv = &types.RequestInspection{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PasswordField": + if err := awsAwsjson11_deserializeDocumentPasswordField(&sv.PasswordField, value); err != nil { + return err + } + + case "PayloadType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PayloadType to be of type string, got %T instead", value) + } + sv.PayloadType = types.PayloadType(jtv) + } + + case "UsernameField": + if err := awsAwsjson11_deserializeDocumentUsernameField(&sv.UsernameField, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentResourceArns(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11217,6 +11322,535 @@ func awsAwsjson11_deserializeDocumentResourceArns(v *[]string, value interface{} return nil } +func awsAwsjson11_deserializeDocumentResponseInspection(v **types.ResponseInspection, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResponseInspection + if *v == nil { + sv = &types.ResponseInspection{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "BodyContains": + if err := awsAwsjson11_deserializeDocumentResponseInspectionBodyContains(&sv.BodyContains, value); err != nil { + return err + } + + case "Header": + if err := awsAwsjson11_deserializeDocumentResponseInspectionHeader(&sv.Header, value); err != nil { + return err + } + + case "Json": + if err := awsAwsjson11_deserializeDocumentResponseInspectionJson(&sv.Json, value); err != nil { + return err + } + + case "StatusCode": + if err := awsAwsjson11_deserializeDocumentResponseInspectionStatusCode(&sv.StatusCode, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResponseInspectionBodyContains(v **types.ResponseInspectionBodyContains, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResponseInspectionBodyContains + if *v == nil { + sv = &types.ResponseInspectionBodyContains{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FailureStrings": + if err := awsAwsjson11_deserializeDocumentResponseInspectionBodyContainsFailureStrings(&sv.FailureStrings, value); err != nil { + return err + } + + case "SuccessStrings": + if err := awsAwsjson11_deserializeDocumentResponseInspectionBodyContainsSuccessStrings(&sv.SuccessStrings, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResponseInspectionBodyContainsFailureStrings(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 FailureValue to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentResponseInspectionBodyContainsSuccessStrings(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 SuccessValue to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentResponseInspectionHeader(v **types.ResponseInspectionHeader, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResponseInspectionHeader + if *v == nil { + sv = &types.ResponseInspectionHeader{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FailureValues": + if err := awsAwsjson11_deserializeDocumentResponseInspectionHeaderFailureValues(&sv.FailureValues, value); err != nil { + return err + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResponseInspectionHeaderName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "SuccessValues": + if err := awsAwsjson11_deserializeDocumentResponseInspectionHeaderSuccessValues(&sv.SuccessValues, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResponseInspectionHeaderFailureValues(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 FailureValue to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentResponseInspectionHeaderSuccessValues(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 SuccessValue to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentResponseInspectionJson(v **types.ResponseInspectionJson, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResponseInspectionJson + if *v == nil { + sv = &types.ResponseInspectionJson{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FailureValues": + if err := awsAwsjson11_deserializeDocumentResponseInspectionJsonFailureValues(&sv.FailureValues, value); err != nil { + return err + } + + case "Identifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldIdentifier to be of type string, got %T instead", value) + } + sv.Identifier = ptr.String(jtv) + } + + case "SuccessValues": + if err := awsAwsjson11_deserializeDocumentResponseInspectionJsonSuccessValues(&sv.SuccessValues, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResponseInspectionJsonFailureValues(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 FailureValue to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentResponseInspectionJsonSuccessValues(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 SuccessValue to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentResponseInspectionStatusCode(v **types.ResponseInspectionStatusCode, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResponseInspectionStatusCode + if *v == nil { + sv = &types.ResponseInspectionStatusCode{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "FailureCodes": + if err := awsAwsjson11_deserializeDocumentResponseInspectionStatusCodeFailureCodes(&sv.FailureCodes, value); err != nil { + return err + } + + case "SuccessCodes": + if err := awsAwsjson11_deserializeDocumentResponseInspectionStatusCodeSuccessCodes(&sv.SuccessCodes, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResponseInspectionStatusCodeFailureCodes(v *[]int32, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []int32 + if *v == nil { + cv = []int32{} + } else { + cv = *v + } + + for _, value := range shape { + var col int32 + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected FailureCode to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + col = int32(i64) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentResponseInspectionStatusCodeSuccessCodes(v *[]int32, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []int32 + if *v == nil { + cv = []int32{} + } else { + cv = *v + } + + for _, value := range shape { + var col int32 + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected SuccessCode to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + col = int32(i64) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentRule(v **types.Rule, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/wafv2/doc.go b/service/wafv2/doc.go index b9cf6567e30..545d9d6f270 100644 --- a/service/wafv2/doc.go +++ b/service/wafv2/doc.go @@ -15,18 +15,16 @@ // how to migrate your WAF resources to this version, see the WAF Developer Guide // (https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html). WAF is // a web application firewall that lets you monitor the HTTP and HTTPS requests -// that are forwarded to Amazon CloudFront, an Amazon API Gateway REST API, an -// Application Load Balancer, an AppSync GraphQL API, or an Amazon Cognito user -// pool. WAF also lets you control access to your content. Based on conditions that -// you specify, such as the IP addresses that requests originate from or the values -// of query strings, the Amazon API Gateway REST API, CloudFront distribution, the -// Application Load Balancer, the AppSync GraphQL API, or the Amazon Cognito user -// pool responds to requests either with the requested content or with an HTTP 403 -// status code (Forbidden). You also can configure CloudFront to return a custom -// error page when a request is blocked. This API guide is for developers who need -// detailed information about WAF API actions, data types, and errors. For detailed -// information about WAF features and an overview of how to use WAF, see the WAF -// Developer Guide +// that are forwarded to an Amazon CloudFront distribution, Amazon API Gateway REST +// API, Application Load Balancer, AppSync GraphQL API, or Amazon Cognito user +// pool. WAF also lets you control access to your content, to protect the Amazon +// Web Services resource that WAF is monitoring. Based on conditions that you +// specify, such as the IP addresses that requests originate from or the values of +// query strings, the protected resource responds to requests with either the +// requested content, an HTTP 403 status code (Forbidden), or with a custom +// response. This API guide is for developers who need detailed information about +// WAF API actions, data types, and errors. For detailed information about WAF +// features and guidance for configuring and using WAF, see the WAF Developer Guide // (https://docs.aws.amazon.com/waf/latest/developerguide/what-is-aws-waf.html). // You can make calls using the endpoints listed in WAF endpoints and quotas // (https://docs.aws.amazon.com/general/latest/gr/waf.html). diff --git a/service/wafv2/serializers.go b/service/wafv2/serializers.go index 8bbe460c001..c78fc66944e 100644 --- a/service/wafv2/serializers.go +++ b/service/wafv2/serializers.go @@ -2709,6 +2709,32 @@ func awsAwsjson11_serializeDocumentAndStatement(v *types.AndStatement, value smi return nil } +func awsAwsjson11_serializeDocumentAWSManagedRulesATPRuleSet(v *types.AWSManagedRulesATPRuleSet, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LoginPath != nil { + ok := object.Key("LoginPath") + ok.String(*v.LoginPath) + } + + if v.RequestInspection != nil { + ok := object.Key("RequestInspection") + if err := awsAwsjson11_serializeDocumentRequestInspection(v.RequestInspection, ok); err != nil { + return err + } + } + + if v.ResponseInspection != nil { + ok := object.Key("ResponseInspection") + if err := awsAwsjson11_serializeDocumentResponseInspection(v.ResponseInspection, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeDocumentAWSManagedRulesBotControlRuleSet(v *types.AWSManagedRulesBotControlRuleSet, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3567,6 +3593,13 @@ func awsAwsjson11_serializeDocumentManagedRuleGroupConfig(v *types.ManagedRuleGr object := value.Object() defer object.Close() + if v.AWSManagedRulesATPRuleSet != nil { + ok := object.Key("AWSManagedRulesATPRuleSet") + if err := awsAwsjson11_serializeDocumentAWSManagedRulesATPRuleSet(v.AWSManagedRulesATPRuleSet, ok); err != nil { + return err + } + } + if v.AWSManagedRulesBotControlRuleSet != nil { ok := object.Key("AWSManagedRulesBotControlRuleSet") if err := awsAwsjson11_serializeDocumentAWSManagedRulesBotControlRuleSet(v.AWSManagedRulesBotControlRuleSet, ok); err != nil { @@ -3867,6 +3900,249 @@ func awsAwsjson11_serializeDocumentRegularExpressionList(v []types.Regex, value return nil } +func awsAwsjson11_serializeDocumentRequestInspection(v *types.RequestInspection, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PasswordField != nil { + ok := object.Key("PasswordField") + if err := awsAwsjson11_serializeDocumentPasswordField(v.PasswordField, ok); err != nil { + return err + } + } + + if len(v.PayloadType) > 0 { + ok := object.Key("PayloadType") + ok.String(string(v.PayloadType)) + } + + if v.UsernameField != nil { + ok := object.Key("UsernameField") + if err := awsAwsjson11_serializeDocumentUsernameField(v.UsernameField, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentResponseInspection(v *types.ResponseInspection, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BodyContains != nil { + ok := object.Key("BodyContains") + if err := awsAwsjson11_serializeDocumentResponseInspectionBodyContains(v.BodyContains, ok); err != nil { + return err + } + } + + if v.Header != nil { + ok := object.Key("Header") + if err := awsAwsjson11_serializeDocumentResponseInspectionHeader(v.Header, ok); err != nil { + return err + } + } + + if v.Json != nil { + ok := object.Key("Json") + if err := awsAwsjson11_serializeDocumentResponseInspectionJson(v.Json, ok); err != nil { + return err + } + } + + if v.StatusCode != nil { + ok := object.Key("StatusCode") + if err := awsAwsjson11_serializeDocumentResponseInspectionStatusCode(v.StatusCode, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentResponseInspectionBodyContains(v *types.ResponseInspectionBodyContains, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FailureStrings != nil { + ok := object.Key("FailureStrings") + if err := awsAwsjson11_serializeDocumentResponseInspectionBodyContainsFailureStrings(v.FailureStrings, ok); err != nil { + return err + } + } + + if v.SuccessStrings != nil { + ok := object.Key("SuccessStrings") + if err := awsAwsjson11_serializeDocumentResponseInspectionBodyContainsSuccessStrings(v.SuccessStrings, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentResponseInspectionBodyContainsFailureStrings(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_serializeDocumentResponseInspectionBodyContainsSuccessStrings(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_serializeDocumentResponseInspectionHeader(v *types.ResponseInspectionHeader, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FailureValues != nil { + ok := object.Key("FailureValues") + if err := awsAwsjson11_serializeDocumentResponseInspectionHeaderFailureValues(v.FailureValues, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.SuccessValues != nil { + ok := object.Key("SuccessValues") + if err := awsAwsjson11_serializeDocumentResponseInspectionHeaderSuccessValues(v.SuccessValues, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentResponseInspectionHeaderFailureValues(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_serializeDocumentResponseInspectionHeaderSuccessValues(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_serializeDocumentResponseInspectionJson(v *types.ResponseInspectionJson, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FailureValues != nil { + ok := object.Key("FailureValues") + if err := awsAwsjson11_serializeDocumentResponseInspectionJsonFailureValues(v.FailureValues, ok); err != nil { + return err + } + } + + if v.Identifier != nil { + ok := object.Key("Identifier") + ok.String(*v.Identifier) + } + + if v.SuccessValues != nil { + ok := object.Key("SuccessValues") + if err := awsAwsjson11_serializeDocumentResponseInspectionJsonSuccessValues(v.SuccessValues, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentResponseInspectionJsonFailureValues(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_serializeDocumentResponseInspectionJsonSuccessValues(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_serializeDocumentResponseInspectionStatusCode(v *types.ResponseInspectionStatusCode, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.FailureCodes != nil { + ok := object.Key("FailureCodes") + if err := awsAwsjson11_serializeDocumentResponseInspectionStatusCodeFailureCodes(v.FailureCodes, ok); err != nil { + return err + } + } + + if v.SuccessCodes != nil { + ok := object.Key("SuccessCodes") + if err := awsAwsjson11_serializeDocumentResponseInspectionStatusCodeSuccessCodes(v.SuccessCodes, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentResponseInspectionStatusCodeFailureCodes(v []int32, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.Integer(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentResponseInspectionStatusCodeSuccessCodes(v []int32, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.Integer(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentRule(v *types.Rule, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/wafv2/types/enums.go b/service/wafv2/types/enums.go index 74b136a1218..32b2f6f7aa7 100644 --- a/service/wafv2/types/enums.go +++ b/service/wafv2/types/enums.go @@ -867,6 +867,7 @@ const ( ParameterExceptionFieldOversizeHandling ParameterExceptionField = "OVERSIZE_HANDLING" ParameterExceptionFieldChallengeConfig ParameterExceptionField = "CHALLENGE_CONFIG" ParameterExceptionFieldTokenDomain ParameterExceptionField = "TOKEN_DOMAIN" + ParameterExceptionFieldAtpRuleSetResponseInspection ParameterExceptionField = "ATP_RULE_SET_RESPONSE_INSPECTION" ) // Values returns all known values for ParameterExceptionField. Note that this can @@ -939,6 +940,7 @@ func (ParameterExceptionField) Values() []ParameterExceptionField { "OVERSIZE_HANDLING", "CHALLENGE_CONFIG", "TOKEN_DOMAIN", + "ATP_RULE_SET_RESPONSE_INSPECTION", } } diff --git a/service/wafv2/types/types.go b/service/wafv2/types/types.go index 8a177bf0bb3..3431d839b7e 100644 --- a/service/wafv2/types/types.go +++ b/service/wafv2/types/types.go @@ -66,7 +66,36 @@ type AndStatement struct { noSmithyDocumentSerde } -// Details for your use of the Bot Control managed rule group, used in +// Details for your use of the account takeover prevention managed rule group, +// AWSManagedRulesATPRuleSet. This configuration is used in ManagedRuleGroupConfig. +type AWSManagedRulesATPRuleSet struct { + + // The path of the login endpoint for your application. For example, for the URL + // https://example.com/web/login, you would provide the path /web/login. The rule + // group inspects only HTTP POST requests to your specified login endpoint. + // + // This member is required. + LoginPath *string + + // The criteria for inspecting login requests, used by the ATP rule group to + // validate credentials usage. + RequestInspection *RequestInspection + + // The criteria for inspecting responses to login requests, used by the ATP rule + // group to track login failure rates. The ATP rule group evaluates the responses + // that your protected resources send back to client login attempts, keeping count + // of successful and failed attempts from each IP address and client session. Using + // this information, the rule group labels and mitigates requests from client + // sessions and IP addresses that submit too many failed login attempts in a short + // amount of time. Response inspection is available only in web ACLs that protect + // Amazon CloudFront distributions. + ResponseInspection *ResponseInspection + + noSmithyDocumentSerde +} + +// Details for your use of the Bot Control managed rule group, +// AWSManagedRulesBotControlRuleSet. This configuration is used in // ManagedRuleGroupConfig. type AWSManagedRulesBotControlRuleSet struct { @@ -169,7 +198,7 @@ type ByteMatchStatement struct { // A string value that you want WAF to search for. WAF searches only in the part of // web requests that you designate for inspection in FieldToMatch. The maximum - // length of the value is 50 bytes. Valid values depend on the component that you + // length of the value is 200 bytes. Valid values depend on the component that you // specify for inspection in FieldToMatch: // // * Method: The HTTP method that you want @@ -182,7 +211,7 @@ type ByteMatchStatement struct { // If SearchString includes alphabetic // characters A-Z and a-z, note that the value is case sensitive. If you're using // the WAF API Specify a base64-encoded version of the value. The maximum length of - // the value before you base64-encode it is 50 bytes. For example, suppose the + // the value before you base64-encode it is 200 bytes. For example, suppose the // value of Type is HEADER and the value of Data is User-Agent. If you want to // search the User-Agent header for the value BadBot, you base64-encode BadBot // using MIME base64-encoding and include the resulting value, QmFkQm90, in the @@ -1410,12 +1439,29 @@ type LoggingFilter struct { } // Additional information that's used by a managed rule group. Many managed rule -// groups don't require this. Use the AWSManagedRulesBotControlRuleSet +// groups don't require this. Use the AWSManagedRulesATPRuleSet configuration +// object for the account takeover prevention managed rule group, to provide +// information such as the sign-in page of your application and the type of content +// to accept or reject from the client. Use the AWSManagedRulesBotControlRuleSet // configuration object to configure the protection level that you want the Bot // Control rule group to use. For example specifications, see the examples section // of CreateWebACL. type ManagedRuleGroupConfig struct { + // Additional configuration for using the account takeover prevention (ATP) managed + // rule group, AWSManagedRulesATPRuleSet. Use this to provide login request + // information to the rule group. For web ACLs that protect CloudFront + // distributions, use this to also provide the information about how your + // distribution responds to login requests. This configuration replaces the + // individual configuration fields in ManagedRuleGroupConfig and provides + // additional feature configuration. For information about using the ATP managed + // rule group, see WAF Fraud Control account takeover prevention (ATP) rule group + // (https://docs.aws.amazon.com/waf/latest/developerguide/aws-managed-rule-groups-atp.html) + // and WAF Fraud Control account takeover prevention (ATP) + // (https://docs.aws.amazon.com/waf/latest/developerguide/waf-atp.html) in the WAF + // Developer Guide. + AWSManagedRulesATPRuleSet *AWSManagedRulesATPRuleSet + // Additional configuration for using the Bot Control managed rule group. Use this // to specify the inspection level that you want to use. For information about // using the Bot Control managed rule group, see WAF Bot Control rule group @@ -1425,17 +1471,31 @@ type ManagedRuleGroupConfig struct { // the WAF Developer Guide. AWSManagedRulesBotControlRuleSet *AWSManagedRulesBotControlRuleSet - // The path of the login endpoint for your application. For example, for the URL - // https://example.com/web/login, you would provide the path /web/login. + // Instead of this setting, provide your configuration under + // AWSManagedRulesATPRuleSet. + // + // Deprecated: Deprecated. Use AWSManagedRulesATPRuleSet LoginPath LoginPath *string - // Details about your login page password field. + // Instead of this setting, provide your configuration under + // AWSManagedRulesATPRuleSetRequestInspection. + // + // Deprecated: Deprecated. Use AWSManagedRulesATPRuleSet RequestInspection + // PasswordField PasswordField *PasswordField - // The payload type for your login endpoint, either JSON or form encoded. + // Instead of this setting, provide your configuration under + // AWSManagedRulesATPRuleSetRequestInspection. + // + // Deprecated: Deprecated. Use AWSManagedRulesATPRuleSet RequestInspection + // PayloadType PayloadType PayloadType - // Details about your login page username field. + // Instead of this setting, provide your configuration under + // AWSManagedRulesATPRuleSetRequestInspection. + // + // Deprecated: Deprecated. Use AWSManagedRulesATPRuleSet RequestInspection + // UsernameField UsernameField *UsernameField noSmithyDocumentSerde @@ -1471,7 +1531,10 @@ type ManagedRuleGroupStatement struct { ExcludedRules []ExcludedRule // Additional information that's used by a managed rule group. Many managed rule - // groups don't require this. Use the AWSManagedRulesBotControlRuleSet + // groups don't require this. Use the AWSManagedRulesATPRuleSet configuration + // object for the account takeover prevention managed rule group, to provide + // information such as the sign-in page of your application and the type of content + // to accept or reject from the client. Use the AWSManagedRulesBotControlRuleSet // configuration object to configure the protection level that you want the Bot // Control rule group to use. ManagedRuleGroupConfigs []ManagedRuleGroupConfig @@ -1780,7 +1843,8 @@ type OverrideAction struct { noSmithyDocumentSerde } -// Details about your login page password field, used in a ManagedRuleGroupConfig. +// Details about your login page password field for request inspection, used in the +// AWSManagedRulesATPRuleSetRequestInspection configuration. type PasswordField struct { // The name of the password field. For example /form/password. @@ -1818,7 +1882,7 @@ type QueryString struct { // rate-based rule with a nested AND rule statement that contains the following // nested statements: // -// * An IP match statement with an IP set that specified the +// * An IP match statement with an IP set that specifies the // address 192.0.2.44. // // * A string match statement that searches in the User-Agent @@ -2022,6 +2086,195 @@ type ReleaseSummary struct { noSmithyDocumentSerde } +// The criteria for inspecting login requests, used by the ATP rule group to +// validate credentials usage. This is part of the AWSManagedRulesATPRuleSet +// configuration in ManagedRuleGroupConfig. In these settings, you specify how your +// application accepts login attempts by providing the request payload type and the +// names of the fields within the request body where the username and password are +// provided. +type RequestInspection struct { + + // Details about your login page password field. How you specify this depends on + // the payload type. + // + // * For JSON payloads, specify the field name in JSON pointer + // syntax. For information about the JSON Pointer syntax, see the Internet + // Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) + // Pointer (https://tools.ietf.org/html/rfc6901). For example, for the JSON payload + // { "login": { "username": "THE_USERNAME", "password": "THE_PASSWORD" } }, the + // username field specification is /login/username and the password field + // specification is /login/password. + // + // * For form encoded payload types, use the + // HTML form names. For example, for an HTML form with input elements named + // username1 and password1, the username field specification is username1 and the + // password field specification is password1. + // + // This member is required. + PasswordField *PasswordField + + // The payload type for your login endpoint, either JSON or form encoded. + // + // This member is required. + PayloadType PayloadType + + // Details about your login page username field. How you specify this depends on + // the payload type. + // + // * For JSON payloads, specify the field name in JSON pointer + // syntax. For information about the JSON Pointer syntax, see the Internet + // Engineering Task Force (IETF) documentation JavaScript Object Notation (JSON) + // Pointer (https://tools.ietf.org/html/rfc6901). For example, for the JSON payload + // { "login": { "username": "THE_USERNAME", "password": "THE_PASSWORD" } }, the + // username field specification is /login/username and the password field + // specification is /login/password. + // + // * For form encoded payload types, use the + // HTML form names. For example, for an HTML form with input elements named + // username1 and password1, the username field specification is username1 and the + // password field specification is password1. + // + // This member is required. + UsernameField *UsernameField + + noSmithyDocumentSerde +} + +// The criteria for inspecting responses to login requests, used by the ATP rule +// group to track login failure rates. The ATP rule group evaluates the responses +// that your protected resources send back to client login attempts, keeping count +// of successful and failed attempts from each IP address and client session. Using +// this information, the rule group labels and mitigates requests from client +// sessions and IP addresses that submit too many failed login attempts in a short +// amount of time. Response inspection is available only in web ACLs that protect +// Amazon CloudFront distributions. This is part of the AWSManagedRulesATPRuleSet +// configuration in ManagedRuleGroupConfig. Enable login response inspection by +// configuring exactly one component of the response to inspect. You can't +// configure more than one. If you don't configure any of the response inspection +// options, response inspection is disabled. +type ResponseInspection struct { + + // Configures inspection of the response body. + BodyContains *ResponseInspectionBodyContains + + // Configures inspection of the response header. + Header *ResponseInspectionHeader + + // Configures inspection of the response JSON. + Json *ResponseInspectionJson + + // Configures inspection of the response status code. + StatusCode *ResponseInspectionStatusCode + + noSmithyDocumentSerde +} + +// Configures inspection of the response body. This is part of the +// ResponseInspection configuration for AWSManagedRulesATPRuleSet. +type ResponseInspectionBodyContains struct { + + // Strings in the body of the response that indicate a failed login attempt. To be + // counted as a failed login, the string can be anywhere in the body and must be an + // exact match, including case. Each string must be unique among the success and + // failure strings. JSON example: "FailureStrings": [ "Login failed" ] + // + // This member is required. + FailureStrings []string + + // Strings in the body of the response that indicate a successful login attempt. To + // be counted as a successful login, the string can be anywhere in the body and + // must be an exact match, including case. Each string must be unique among the + // success and failure strings. JSON example: "SuccessStrings": [ "Login + // successful", "Welcome to our site!" ] + // + // This member is required. + SuccessStrings []string + + noSmithyDocumentSerde +} + +// Configures inspection of the response header. This is part of the +// ResponseInspection configuration for AWSManagedRulesATPRuleSet. +type ResponseInspectionHeader struct { + + // Values in the response header with the specified name that indicate a failed + // login attempt. To be counted as a failed login, the value must be an exact + // match, including case. Each value must be unique among the success and failure + // values. JSON example: "FailureValues": [ "LoginFailed", "Failed login" ] + // + // This member is required. + FailureValues []string + + // The name of the header to match against. The name must be an exact match, + // including case. JSON example: "Name": [ "LoginResult" ] + // + // This member is required. + Name *string + + // Values in the response header with the specified name that indicate a successful + // login attempt. To be counted as a successful login, the value must be an exact + // match, including case. Each value must be unique among the success and failure + // values. JSON example: "SuccessValues": [ "LoginPassed", "Successful login" ] + // + // This member is required. + SuccessValues []string + + noSmithyDocumentSerde +} + +// Configures inspection of the response JSON. This is part of the +// ResponseInspection configuration for AWSManagedRulesATPRuleSet. +type ResponseInspectionJson struct { + + // Values for the specified identifier in the response JSON that indicate a failed + // login attempt. To be counted as a failed login, the value must be an exact + // match, including case. Each value must be unique among the success and failure + // values. JSON example: "FailureValues": [ "False", "Failed" ] + // + // This member is required. + FailureValues []string + + // The identifier for the value to match against in the JSON. The identifier must + // be an exact match, including case. JSON example: "Identifier": [ + // "/login/success" ] + // + // This member is required. + Identifier *string + + // Values for the specified identifier in the response JSON that indicate a + // successful login attempt. To be counted as a successful login, the value must be + // an exact match, including case. Each value must be unique among the success and + // failure values. JSON example: "SuccessValues": [ "True", "Succeeded" ] + // + // This member is required. + SuccessValues []string + + noSmithyDocumentSerde +} + +// Configures inspection of the response status code. This is part of the +// ResponseInspection configuration for AWSManagedRulesATPRuleSet. +type ResponseInspectionStatusCode struct { + + // Status codes in the response that indicate a failed login attempt. To be counted + // as a failed login, the response status code must match one of these. Each code + // must be unique among the success and failure status codes. JSON example: + // "FailureCodes": [ 400, 404 ] + // + // This member is required. + FailureCodes []int32 + + // Status codes in the response that indicate a successful login attempt. To be + // counted as a successful login, the response status code must match one of these. + // Each code must be unique among the success and failure status codes. JSON + // example: "SuccessCodes": [ 200, 201 ] + // + // This member is required. + SuccessCodes []int32 + + noSmithyDocumentSerde +} + // A single rule, which you can use in a WebACL or RuleGroup to identify web // requests that you want to allow, block, or count. Each rule includes one // top-level Statement that WAF uses to identify matching web requests, and @@ -2592,7 +2845,7 @@ type Statement struct { // rate-based rule with a nested AND rule statement that contains the following // nested statements: // - // * An IP match statement with an IP set that specified the + // * An IP match statement with an IP set that specifies the // address 192.0.2.44. // // * A string match statement that searches in the User-Agent @@ -2863,7 +3116,8 @@ type UriPath struct { noSmithyDocumentSerde } -// Details about your login page username field, used in a ManagedRuleGroupConfig. +// Details about your login page username field for request inspection, used in the +// AWSManagedRulesATPRuleSetRequestInspection configuration. type UsernameField struct { // The name of the username field. For example /form/username. diff --git a/service/wafv2/validators.go b/service/wafv2/validators.go index 1356fd13a6b..f3634b30e00 100644 --- a/service/wafv2/validators.go +++ b/service/wafv2/validators.go @@ -1189,6 +1189,31 @@ func validateAndStatement(v *types.AndStatement) error { } } +func validateAWSManagedRulesATPRuleSet(v *types.AWSManagedRulesATPRuleSet) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AWSManagedRulesATPRuleSet"} + if v.LoginPath == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoginPath")) + } + if v.RequestInspection != nil { + if err := validateRequestInspection(v.RequestInspection); err != nil { + invalidParams.AddNested("RequestInspection", err.(smithy.InvalidParamsError)) + } + } + if v.ResponseInspection != nil { + if err := validateResponseInspection(v.ResponseInspection); err != nil { + invalidParams.AddNested("ResponseInspection", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateAWSManagedRulesBotControlRuleSet(v *types.AWSManagedRulesBotControlRuleSet) error { if v == nil { return nil @@ -1906,6 +1931,11 @@ func validateManagedRuleGroupConfig(v *types.ManagedRuleGroupConfig) error { invalidParams.AddNested("AWSManagedRulesBotControlRuleSet", err.(smithy.InvalidParamsError)) } } + if v.AWSManagedRulesATPRuleSet != nil { + if err := validateAWSManagedRulesATPRuleSet(v.AWSManagedRulesATPRuleSet); err != nil { + invalidParams.AddNested("AWSManagedRulesATPRuleSet", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2138,6 +2168,145 @@ func validateRegexPatternSetReferenceStatement(v *types.RegexPatternSetReference } } +func validateRequestInspection(v *types.RequestInspection) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RequestInspection"} + if len(v.PayloadType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("PayloadType")) + } + if v.UsernameField == nil { + invalidParams.Add(smithy.NewErrParamRequired("UsernameField")) + } else if v.UsernameField != nil { + if err := validateUsernameField(v.UsernameField); err != nil { + invalidParams.AddNested("UsernameField", err.(smithy.InvalidParamsError)) + } + } + if v.PasswordField == nil { + invalidParams.Add(smithy.NewErrParamRequired("PasswordField")) + } else if v.PasswordField != nil { + if err := validatePasswordField(v.PasswordField); err != nil { + invalidParams.AddNested("PasswordField", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateResponseInspection(v *types.ResponseInspection) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResponseInspection"} + if v.StatusCode != nil { + if err := validateResponseInspectionStatusCode(v.StatusCode); err != nil { + invalidParams.AddNested("StatusCode", err.(smithy.InvalidParamsError)) + } + } + if v.Header != nil { + if err := validateResponseInspectionHeader(v.Header); err != nil { + invalidParams.AddNested("Header", err.(smithy.InvalidParamsError)) + } + } + if v.BodyContains != nil { + if err := validateResponseInspectionBodyContains(v.BodyContains); err != nil { + invalidParams.AddNested("BodyContains", err.(smithy.InvalidParamsError)) + } + } + if v.Json != nil { + if err := validateResponseInspectionJson(v.Json); err != nil { + invalidParams.AddNested("Json", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateResponseInspectionBodyContains(v *types.ResponseInspectionBodyContains) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResponseInspectionBodyContains"} + if v.SuccessStrings == nil { + invalidParams.Add(smithy.NewErrParamRequired("SuccessStrings")) + } + if v.FailureStrings == nil { + invalidParams.Add(smithy.NewErrParamRequired("FailureStrings")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateResponseInspectionHeader(v *types.ResponseInspectionHeader) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResponseInspectionHeader"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.SuccessValues == nil { + invalidParams.Add(smithy.NewErrParamRequired("SuccessValues")) + } + if v.FailureValues == nil { + invalidParams.Add(smithy.NewErrParamRequired("FailureValues")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateResponseInspectionJson(v *types.ResponseInspectionJson) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResponseInspectionJson"} + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } + if v.SuccessValues == nil { + invalidParams.Add(smithy.NewErrParamRequired("SuccessValues")) + } + if v.FailureValues == nil { + invalidParams.Add(smithy.NewErrParamRequired("FailureValues")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateResponseInspectionStatusCode(v *types.ResponseInspectionStatusCode) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ResponseInspectionStatusCode"} + if v.SuccessCodes == nil { + invalidParams.Add(smithy.NewErrParamRequired("SuccessCodes")) + } + if v.FailureCodes == nil { + invalidParams.Add(smithy.NewErrParamRequired("FailureCodes")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateRule(v *types.Rule) error { if v == nil { return nil