diff --git a/.changelog/637d44ac73834b409351f2497d3eca97.json b/.changelog/637d44ac73834b409351f2497d3eca97.json new file mode 100644 index 00000000000..07c4dbef2d7 --- /dev/null +++ b/.changelog/637d44ac73834b409351f2497d3eca97.json @@ -0,0 +1,9 @@ +{ + "id": "637d44ac-7383-4b40-9351-f2497d3eca97", + "type": "feature", + "collapse": true, + "description": "Remove macie service", + "modules": [ + "." + ] +} \ No newline at end of file diff --git a/codegen/sdk-codegen/aws-models/macie.json b/codegen/sdk-codegen/aws-models/macie.json deleted file mode 100644 index 47ddbcfca1f..00000000000 --- a/codegen/sdk-codegen/aws-models/macie.json +++ /dev/null @@ -1,1481 +0,0 @@ -{ - "smithy": "2.0", - "metadata": { - "suppressions": [ - { - "id": "HttpMethodSemantics", - "namespace": "*" - }, - { - "id": "HttpResponseCodeSemantics", - "namespace": "*" - }, - { - "id": "PaginatedTrait", - "namespace": "*" - }, - { - "id": "HttpHeaderTrait", - "namespace": "*" - }, - { - "id": "HttpUriConflict", - "namespace": "*" - }, - { - "id": "Service", - "namespace": "*" - } - ] - }, - "shapes": { - "com.amazonaws.macie#AWSAccountId": { - "type": "string", - "traits": { - "smithy.api#pattern": "^[0-9]{12}$" - } - }, - "com.amazonaws.macie#AccessDeniedException": { - "type": "structure", - "members": { - "message": { - "target": "com.amazonaws.macie#ExceptionMessage" - }, - "resourceType": { - "target": "com.amazonaws.macie#ResourceType" - } - }, - "traits": { - "smithy.api#documentation": "

(Discontinued) You do not have required permissions to access the requested resource.

", - "smithy.api#error": "client" - } - }, - "com.amazonaws.macie#AssociateMemberAccount": { - "type": "operation", - "input": { - "target": "com.amazonaws.macie#AssociateMemberAccountRequest" - }, - "output": { - "target": "smithy.api#Unit" - }, - "errors": [ - { - "target": "com.amazonaws.macie#InternalException" - }, - { - "target": "com.amazonaws.macie#InvalidInputException" - }, - { - "target": "com.amazonaws.macie#LimitExceededException" - } - ], - "traits": { - "smithy.api#documentation": "

(Discontinued) Associates a specified Amazon Web Services account with Amazon Macie Classic as a member\n account.

" - } - }, - "com.amazonaws.macie#AssociateMemberAccountRequest": { - "type": "structure", - "members": { - "memberAccountId": { - "target": "com.amazonaws.macie#AWSAccountId", - "traits": { - "smithy.api#documentation": "

(Discontinued) The ID of the Amazon Web Services account that you want to associate with Amazon Macie\n Classic as a member account.

", - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.macie#AssociateS3Resources": { - "type": "operation", - "input": { - "target": "com.amazonaws.macie#AssociateS3ResourcesRequest" - }, - "output": { - "target": "com.amazonaws.macie#AssociateS3ResourcesResult" - }, - "errors": [ - { - "target": "com.amazonaws.macie#AccessDeniedException" - }, - { - "target": "com.amazonaws.macie#InternalException" - }, - { - "target": "com.amazonaws.macie#InvalidInputException" - }, - { - "target": "com.amazonaws.macie#LimitExceededException" - } - ], - "traits": { - "smithy.api#documentation": "

(Discontinued) Associates specified S3 resources with Amazon Macie Classic for\n monitoring and data classification. If memberAccountId isn't specified, the action associates\n specified S3 resources with Macie Classic for the current Macie Classic administrator account.\n If memberAccountId is specified, the action associates specified S3 resources with Macie\n Classic for the specified member account.

" - } - }, - "com.amazonaws.macie#AssociateS3ResourcesRequest": { - "type": "structure", - "members": { - "memberAccountId": { - "target": "com.amazonaws.macie#AWSAccountId", - "traits": { - "smithy.api#documentation": "

(Discontinued) The ID of the Amazon Macie Classic member account whose resources you\n want to associate with Macie Classic.

" - } - }, - "s3Resources": { - "target": "com.amazonaws.macie#S3ResourcesClassification", - "traits": { - "smithy.api#documentation": "

(Discontinued) The S3 resources that you want to associate with Amazon Macie Classic\n for monitoring and data classification.

", - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.macie#AssociateS3ResourcesResult": { - "type": "structure", - "members": { - "failedS3Resources": { - "target": "com.amazonaws.macie#FailedS3Resources", - "traits": { - "smithy.api#documentation": "

(Discontinued) S3 resources that couldn't be associated with Amazon Macie Classic. An\n error code and an error message are provided for each failed item.

" - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.macie#BucketName": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 0, - "max": 500 - } - } - }, - "com.amazonaws.macie#ClassificationType": { - "type": "structure", - "members": { - "oneTime": { - "target": "com.amazonaws.macie#S3OneTimeClassificationType", - "traits": { - "smithy.api#documentation": "

(Discontinued) A one-time classification of all of the existing objects in a specified\n S3 bucket.

", - "smithy.api#required": {} - } - }, - "continuous": { - "target": "com.amazonaws.macie#S3ContinuousClassificationType", - "traits": { - "smithy.api#documentation": "

(Discontinued) A continuous classification of the objects that are added to a specified\n S3 bucket. Amazon Macie Classic begins performing continuous classification after a bucket is\n successfully associated with Macie Classic.

", - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#documentation": "

(Discontinued) The classification type that Amazon Macie Classic applies to the\n associated S3 resources.

" - } - }, - "com.amazonaws.macie#ClassificationTypeUpdate": { - "type": "structure", - "members": { - "oneTime": { - "target": "com.amazonaws.macie#S3OneTimeClassificationType", - "traits": { - "smithy.api#documentation": "

(Discontinued) A one-time classification of all of the existing objects in a specified\n S3 bucket.

" - } - }, - "continuous": { - "target": "com.amazonaws.macie#S3ContinuousClassificationType", - "traits": { - "smithy.api#documentation": "

(Discontinued) A continuous classification of the objects that are added to a specified\n S3 bucket. Amazon Macie Classic begins performing continuous classification after a bucket is\n successfully associated with Macie Classic.

" - } - } - }, - "traits": { - "smithy.api#documentation": "

(Discontinued) The classification type that Amazon Macie Classic applies to the\n associated S3 resources. At least one of the classification types (oneTime or continuous) must\n be specified.

" - } - }, - "com.amazonaws.macie#DisassociateMemberAccount": { - "type": "operation", - "input": { - "target": "com.amazonaws.macie#DisassociateMemberAccountRequest" - }, - "output": { - "target": "smithy.api#Unit" - }, - "errors": [ - { - "target": "com.amazonaws.macie#InternalException" - }, - { - "target": "com.amazonaws.macie#InvalidInputException" - } - ], - "traits": { - "smithy.api#documentation": "

(Discontinued) Removes the specified member account from Amazon Macie\n Classic.

" - } - }, - "com.amazonaws.macie#DisassociateMemberAccountRequest": { - "type": "structure", - "members": { - "memberAccountId": { - "target": "com.amazonaws.macie#AWSAccountId", - "traits": { - "smithy.api#documentation": "

(Discontinued) The ID of the member account that you want to remove from Amazon Macie\n Classic.

", - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.macie#DisassociateS3Resources": { - "type": "operation", - "input": { - "target": "com.amazonaws.macie#DisassociateS3ResourcesRequest" - }, - "output": { - "target": "com.amazonaws.macie#DisassociateS3ResourcesResult" - }, - "errors": [ - { - "target": "com.amazonaws.macie#AccessDeniedException" - }, - { - "target": "com.amazonaws.macie#InternalException" - }, - { - "target": "com.amazonaws.macie#InvalidInputException" - } - ], - "traits": { - "smithy.api#documentation": "

(Discontinued) Removes specified S3 resources from being monitored by Amazon Macie\n Classic. If memberAccountId isn't specified, the action removes specified S3 resources from\n Macie Classic for the current Macie Classic administrator account. If memberAccountId is\n specified, the action removes specified S3 resources from Macie Classic for the specified\n member account.

" - } - }, - "com.amazonaws.macie#DisassociateS3ResourcesRequest": { - "type": "structure", - "members": { - "memberAccountId": { - "target": "com.amazonaws.macie#AWSAccountId", - "traits": { - "smithy.api#documentation": "

(Discontinued) The ID of the Amazon Macie Classic member account whose resources you\n want to remove from being monitored by Macie Classic.

" - } - }, - "associatedS3Resources": { - "target": "com.amazonaws.macie#S3Resources", - "traits": { - "smithy.api#documentation": "

(Discontinued) The S3 resources (buckets or prefixes) that you want to remove from\n being monitored and classified by Amazon Macie Classic.

", - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.macie#DisassociateS3ResourcesResult": { - "type": "structure", - "members": { - "failedS3Resources": { - "target": "com.amazonaws.macie#FailedS3Resources", - "traits": { - "smithy.api#documentation": "

(Discontinued) S3 resources that couldn't be removed from being monitored and\n classified by Amazon Macie Classic. An error code and an error message are provided for each\n failed item.

" - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.macie#ErrorCode": { - "type": "string", - "traits": { - "smithy.api#documentation": "Error code for the exception", - "smithy.api#length": { - "min": 0, - "max": 10 - } - } - }, - "com.amazonaws.macie#ExceptionMessage": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 0, - "max": 10000 - } - } - }, - "com.amazonaws.macie#FailedS3Resource": { - "type": "structure", - "members": { - "failedItem": { - "target": "com.amazonaws.macie#S3Resource", - "traits": { - "smithy.api#documentation": "

(Discontinued) The failed S3 resources.

" - } - }, - "errorCode": { - "target": "com.amazonaws.macie#ErrorCode", - "traits": { - "smithy.api#documentation": "

(Discontinued) The status code of a failed item.

" - } - }, - "errorMessage": { - "target": "com.amazonaws.macie#ExceptionMessage", - "traits": { - "smithy.api#documentation": "

(Discontinued) The error message of a failed item.

" - } - } - }, - "traits": { - "smithy.api#documentation": "

(Discontinued) Includes details about the failed S3 resources.

" - } - }, - "com.amazonaws.macie#FailedS3Resources": { - "type": "list", - "member": { - "target": "com.amazonaws.macie#FailedS3Resource" - } - }, - "com.amazonaws.macie#FieldName": { - "type": "string", - "traits": { - "smithy.api#documentation": "Field that has invalid input", - "smithy.api#length": { - "min": 0, - "max": 1000 - } - } - }, - "com.amazonaws.macie#InternalException": { - "type": "structure", - "members": { - "errorCode": { - "target": "com.amazonaws.macie#ErrorCode" - }, - "message": { - "target": "com.amazonaws.macie#ExceptionMessage" - } - }, - "traits": { - "smithy.api#documentation": "

(Discontinued) Internal server error.

", - "smithy.api#error": "server" - } - }, - "com.amazonaws.macie#InvalidInputException": { - "type": "structure", - "members": { - "errorCode": { - "target": "com.amazonaws.macie#ErrorCode" - }, - "message": { - "target": "com.amazonaws.macie#ExceptionMessage" - }, - "fieldName": { - "target": "com.amazonaws.macie#FieldName" - } - }, - "traits": { - "smithy.api#documentation": "

(Discontinued) The request was rejected because an invalid or out-of-range value was supplied for an\n input parameter.

", - "smithy.api#error": "client" - } - }, - "com.amazonaws.macie#LimitExceededException": { - "type": "structure", - "members": { - "errorCode": { - "target": "com.amazonaws.macie#ErrorCode" - }, - "message": { - "target": "com.amazonaws.macie#ExceptionMessage" - }, - "resourceType": { - "target": "com.amazonaws.macie#ResourceType" - } - }, - "traits": { - "smithy.api#documentation": "

(Discontinued) The request was rejected because it attempted to create resources beyond the current\n Amazon Web Services account quotas. The error code describes the quota exceeded.

", - "smithy.api#error": "client" - } - }, - "com.amazonaws.macie#ListMemberAccounts": { - "type": "operation", - "input": { - "target": "com.amazonaws.macie#ListMemberAccountsRequest" - }, - "output": { - "target": "com.amazonaws.macie#ListMemberAccountsResult" - }, - "errors": [ - { - "target": "com.amazonaws.macie#InternalException" - }, - { - "target": "com.amazonaws.macie#InvalidInputException" - } - ], - "traits": { - "smithy.api#documentation": "

(Discontinued) Lists all Amazon Macie Classic member accounts for the current Macie\n Classic administrator account.

", - "smithy.api#paginated": { - "inputToken": "nextToken", - "outputToken": "nextToken", - "pageSize": "maxResults" - } - } - }, - "com.amazonaws.macie#ListMemberAccountsRequest": { - "type": "structure", - "members": { - "nextToken": { - "target": "com.amazonaws.macie#NextToken", - "traits": { - "smithy.api#documentation": "

(Discontinued) Use this parameter when paginating results. Set the value of this\n parameter to null on your first call to the ListMemberAccounts action. Subsequent calls to the\n action fill nextToken in the request with the value of nextToken from the previous response to\n continue listing data.

" - } - }, - "maxResults": { - "target": "com.amazonaws.macie#MaxResults", - "traits": { - "smithy.api#documentation": "

(Discontinued) Use this parameter to indicate the maximum number of items that you want\n in the response. The default value is 250.

" - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.macie#ListMemberAccountsResult": { - "type": "structure", - "members": { - "memberAccounts": { - "target": "com.amazonaws.macie#MemberAccounts", - "traits": { - "smithy.api#documentation": "

(Discontinued) A list of the Amazon Macie Classic member accounts returned by the\n action. The current Macie Classic administrator account is also included in this\n list.

" - } - }, - "nextToken": { - "target": "com.amazonaws.macie#NextToken", - "traits": { - "smithy.api#documentation": "

(Discontinued) When a response is generated, if there is more data to be listed, this\n parameter is present in the response and contains the value to use for the nextToken parameter\n in a subsequent pagination request. If there is no more data to be listed, this parameter is\n set to null.

" - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.macie#ListS3Resources": { - "type": "operation", - "input": { - "target": "com.amazonaws.macie#ListS3ResourcesRequest" - }, - "output": { - "target": "com.amazonaws.macie#ListS3ResourcesResult" - }, - "errors": [ - { - "target": "com.amazonaws.macie#AccessDeniedException" - }, - { - "target": "com.amazonaws.macie#InternalException" - }, - { - "target": "com.amazonaws.macie#InvalidInputException" - } - ], - "traits": { - "smithy.api#documentation": "

(Discontinued) Lists all the S3 resources associated with Amazon Macie Classic. If\n memberAccountId isn't specified, the action lists the S3 resources associated with Macie\n Classic for the current Macie Classic administrator account. If memberAccountId is specified,\n the action lists the S3 resources associated with Macie Classic for the specified member\n account.

", - "smithy.api#paginated": { - "inputToken": "nextToken", - "outputToken": "nextToken", - "pageSize": "maxResults" - } - } - }, - "com.amazonaws.macie#ListS3ResourcesRequest": { - "type": "structure", - "members": { - "memberAccountId": { - "target": "com.amazonaws.macie#AWSAccountId", - "traits": { - "smithy.api#documentation": "

(Discontinued) The Amazon Macie Classic member account ID whose associated S3 resources\n you want to list.

" - } - }, - "nextToken": { - "target": "com.amazonaws.macie#NextToken", - "traits": { - "smithy.api#documentation": "

(Discontinued) Use this parameter when paginating results. Set its value to null on\n your first call to the ListS3Resources action. Subsequent calls to the action fill nextToken\n in the request with the value of nextToken from the previous response to continue listing\n data.

" - } - }, - "maxResults": { - "target": "com.amazonaws.macie#MaxResults", - "traits": { - "smithy.api#documentation": "

(Discontinued) Use this parameter to indicate the maximum number of items that you want\n in the response. The default value is 250.

" - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.macie#ListS3ResourcesResult": { - "type": "structure", - "members": { - "s3Resources": { - "target": "com.amazonaws.macie#S3ResourcesClassification", - "traits": { - "smithy.api#documentation": "

(Discontinued) A list of the associated S3 resources returned by the action.

" - } - }, - "nextToken": { - "target": "com.amazonaws.macie#NextToken", - "traits": { - "smithy.api#documentation": "

(Discontinued) When a response is generated, if there is more data to be listed, this\n parameter is present in the response and contains the value to use for the nextToken parameter\n in a subsequent pagination request. If there is no more data to be listed, this parameter is\n set to null.

" - } - } - }, - "traits": { - "smithy.api#output": {} - } - }, - "com.amazonaws.macie#MacieService": { - "type": "service", - "version": "2017-12-19", - "operations": [ - { - "target": "com.amazonaws.macie#AssociateMemberAccount" - }, - { - "target": "com.amazonaws.macie#AssociateS3Resources" - }, - { - "target": "com.amazonaws.macie#DisassociateMemberAccount" - }, - { - "target": "com.amazonaws.macie#DisassociateS3Resources" - }, - { - "target": "com.amazonaws.macie#ListMemberAccounts" - }, - { - "target": "com.amazonaws.macie#ListS3Resources" - }, - { - "target": "com.amazonaws.macie#UpdateS3Resources" - } - ], - "traits": { - "aws.api#service": { - "sdkId": "Macie", - "arnNamespace": "macie", - "cloudFormationName": "Macie", - "cloudTrailEventSource": "macie.amazonaws.com", - "endpointPrefix": "macie" - }, - "aws.auth#sigv4": { - "name": "macie" - }, - "aws.protocols#awsJson1_1": {}, - "smithy.api#documentation": "Amazon Macie Classic\n

Amazon Macie Classic has been discontinued and is no longer available.

\n

A new Amazon Macie is now available with significant design improvements and additional\n features, at a lower price and in most Amazon Web Services Regions. We encourage you to take advantage of the\n new and improved features, and benefit from the reduced cost. To learn about features and pricing for the new Macie, see Amazon Macie. To learn how to use the new Macie, see the Amazon Macie User\n Guide.

", - "smithy.api#title": "Amazon Macie", - "smithy.rules#endpointRuleSet": { - "version": "1.0", - "parameters": { - "Region": { - "builtIn": "AWS::Region", - "required": false, - "documentation": "The AWS region used to dispatch the request.", - "type": "String" - }, - "UseDualStack": { - "builtIn": "AWS::UseDualStack", - "required": true, - "default": false, - "documentation": "When true, use the dual-stack endpoint. If the configured endpoint does not support dual-stack, dispatching the request MAY return an error.", - "type": "Boolean" - }, - "UseFIPS": { - "builtIn": "AWS::UseFIPS", - "required": true, - "default": false, - "documentation": "When true, send this request to the FIPS-compliant regional endpoint. If the configured endpoint does not have a FIPS compliant endpoint, dispatching the request will return an error.", - "type": "Boolean" - }, - "Endpoint": { - "builtIn": "SDK::Endpoint", - "required": false, - "documentation": "Override the endpoint used to send this request", - "type": "String" - } - }, - "rules": [ - { - "conditions": [ - { - "fn": "isSet", - "argv": [ - { - "ref": "Endpoint" - } - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseFIPS" - }, - true - ] - } - ], - "error": "Invalid Configuration: FIPS and custom endpoint are not supported", - "type": "error" - }, - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseDualStack" - }, - true - ] - } - ], - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported", - "type": "error" - }, - { - "conditions": [], - "endpoint": { - "url": { - "ref": "Endpoint" - }, - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ] - }, - { - "conditions": [ - { - "fn": "isSet", - "argv": [ - { - "ref": "Region" - } - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [ - { - "fn": "aws.partition", - "argv": [ - { - "ref": "Region" - } - ], - "assign": "PartitionResult" - } - ], - "type": "tree", - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseFIPS" - }, - true - ] - }, - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseDualStack" - }, - true - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - true, - { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsFIPS" - ] - } - ] - }, - { - "fn": "booleanEquals", - "argv": [ - true, - { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsDualStack" - ] - } - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [], - "endpoint": { - "url": "https://macie-fips.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ] - }, - { - "conditions": [], - "error": "FIPS and DualStack are enabled, but this partition does not support one or both", - "type": "error" - } - ] - }, - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseFIPS" - }, - true - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - true, - { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsFIPS" - ] - } - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [], - "endpoint": { - "url": "https://macie-fips.{Region}.{PartitionResult#dnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ] - }, - { - "conditions": [], - "error": "FIPS is enabled but this partition does not support FIPS", - "type": "error" - } - ] - }, - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - { - "ref": "UseDualStack" - }, - true - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [ - { - "fn": "booleanEquals", - "argv": [ - true, - { - "fn": "getAttr", - "argv": [ - { - "ref": "PartitionResult" - }, - "supportsDualStack" - ] - } - ] - } - ], - "type": "tree", - "rules": [ - { - "conditions": [], - "endpoint": { - "url": "https://macie.{Region}.{PartitionResult#dualStackDnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ] - }, - { - "conditions": [], - "error": "DualStack is enabled but this partition does not support DualStack", - "type": "error" - } - ] - }, - { - "conditions": [], - "endpoint": { - "url": "https://macie.{Region}.{PartitionResult#dnsSuffix}", - "properties": {}, - "headers": {} - }, - "type": "endpoint" - } - ] - } - ] - }, - { - "conditions": [], - "error": "Invalid Configuration: Missing Region", - "type": "error" - } - ] - }, - "smithy.rules#endpointTests": { - "testCases": [ - { - "documentation": "For region us-east-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://macie.us-east-1.amazonaws.com" - } - }, - "params": { - "Region": "us-east-1", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For region us-east-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://macie-fips.us-east-1.amazonaws.com" - } - }, - "params": { - "Region": "us-east-1", - "UseFIPS": true, - "UseDualStack": false - } - }, - { - "documentation": "For region us-west-2 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://macie.us-west-2.amazonaws.com" - } - }, - "params": { - "Region": "us-west-2", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For region us-west-2 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://macie-fips.us-west-2.amazonaws.com" - } - }, - "params": { - "Region": "us-west-2", - "UseFIPS": true, - "UseDualStack": false - } - }, - { - "documentation": "For region us-east-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://macie-fips.us-east-1.api.aws" - } - }, - "params": { - "Region": "us-east-1", - "UseFIPS": true, - "UseDualStack": true - } - }, - { - "documentation": "For region us-east-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://macie.us-east-1.api.aws" - } - }, - "params": { - "Region": "us-east-1", - "UseFIPS": false, - "UseDualStack": true - } - }, - { - "documentation": "For region cn-north-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://macie-fips.cn-north-1.api.amazonwebservices.com.cn" - } - }, - "params": { - "Region": "cn-north-1", - "UseFIPS": true, - "UseDualStack": true - } - }, - { - "documentation": "For region cn-north-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://macie-fips.cn-north-1.amazonaws.com.cn" - } - }, - "params": { - "Region": "cn-north-1", - "UseFIPS": true, - "UseDualStack": false - } - }, - { - "documentation": "For region cn-north-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://macie.cn-north-1.api.amazonwebservices.com.cn" - } - }, - "params": { - "Region": "cn-north-1", - "UseFIPS": false, - "UseDualStack": true - } - }, - { - "documentation": "For region cn-north-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://macie.cn-north-1.amazonaws.com.cn" - } - }, - "params": { - "Region": "cn-north-1", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://macie-fips.us-gov-east-1.api.aws" - } - }, - "params": { - "Region": "us-gov-east-1", - "UseFIPS": true, - "UseDualStack": true - } - }, - { - "documentation": "For region us-gov-east-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://macie-fips.us-gov-east-1.amazonaws.com" - } - }, - "params": { - "Region": "us-gov-east-1", - "UseFIPS": true, - "UseDualStack": false - } - }, - { - "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack enabled", - "expect": { - "endpoint": { - "url": "https://macie.us-gov-east-1.api.aws" - } - }, - "params": { - "Region": "us-gov-east-1", - "UseFIPS": false, - "UseDualStack": true - } - }, - { - "documentation": "For region us-gov-east-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://macie.us-gov-east-1.amazonaws.com" - } - }, - "params": { - "Region": "us-gov-east-1", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack enabled", - "expect": { - "error": "FIPS and DualStack are enabled, but this partition does not support one or both" - }, - "params": { - "Region": "us-iso-east-1", - "UseFIPS": true, - "UseDualStack": true - } - }, - { - "documentation": "For region us-iso-east-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://macie-fips.us-iso-east-1.c2s.ic.gov" - } - }, - "params": { - "Region": "us-iso-east-1", - "UseFIPS": true, - "UseDualStack": false - } - }, - { - "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack enabled", - "expect": { - "error": "DualStack is enabled but this partition does not support DualStack" - }, - "params": { - "Region": "us-iso-east-1", - "UseFIPS": false, - "UseDualStack": true - } - }, - { - "documentation": "For region us-iso-east-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://macie.us-iso-east-1.c2s.ic.gov" - } - }, - "params": { - "Region": "us-iso-east-1", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack enabled", - "expect": { - "error": "FIPS and DualStack are enabled, but this partition does not support one or both" - }, - "params": { - "Region": "us-isob-east-1", - "UseFIPS": true, - "UseDualStack": true - } - }, - { - "documentation": "For region us-isob-east-1 with FIPS enabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://macie-fips.us-isob-east-1.sc2s.sgov.gov" - } - }, - "params": { - "Region": "us-isob-east-1", - "UseFIPS": true, - "UseDualStack": false - } - }, - { - "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack enabled", - "expect": { - "error": "DualStack is enabled but this partition does not support DualStack" - }, - "params": { - "Region": "us-isob-east-1", - "UseFIPS": false, - "UseDualStack": true - } - }, - { - "documentation": "For region us-isob-east-1 with FIPS disabled and DualStack disabled", - "expect": { - "endpoint": { - "url": "https://macie.us-isob-east-1.sc2s.sgov.gov" - } - }, - "params": { - "Region": "us-isob-east-1", - "UseFIPS": false, - "UseDualStack": false - } - }, - { - "documentation": "For custom endpoint with region set and fips disabled and dualstack disabled", - "expect": { - "endpoint": { - "url": "https://example.com" - } - }, - "params": { - "Region": "us-east-1", - "UseFIPS": false, - "UseDualStack": false, - "Endpoint": "https://example.com" - } - }, - { - "documentation": "For custom endpoint with region not set and fips disabled and dualstack disabled", - "expect": { - "endpoint": { - "url": "https://example.com" - } - }, - "params": { - "UseFIPS": false, - "UseDualStack": false, - "Endpoint": "https://example.com" - } - }, - { - "documentation": "For custom endpoint with fips enabled and dualstack disabled", - "expect": { - "error": "Invalid Configuration: FIPS and custom endpoint are not supported" - }, - "params": { - "Region": "us-east-1", - "UseFIPS": true, - "UseDualStack": false, - "Endpoint": "https://example.com" - } - }, - { - "documentation": "For custom endpoint with fips disabled and dualstack enabled", - "expect": { - "error": "Invalid Configuration: Dualstack and custom endpoint are not supported" - }, - "params": { - "Region": "us-east-1", - "UseFIPS": false, - "UseDualStack": true, - "Endpoint": "https://example.com" - } - }, - { - "documentation": "Missing region", - "expect": { - "error": "Invalid Configuration: Missing Region" - } - } - ], - "version": "1.0" - } - } - }, - "com.amazonaws.macie#MaxResults": { - "type": "integer", - "traits": { - "smithy.api#range": { - "max": 250 - } - } - }, - "com.amazonaws.macie#MemberAccount": { - "type": "structure", - "members": { - "accountId": { - "target": "com.amazonaws.macie#AWSAccountId", - "traits": { - "smithy.api#documentation": "

(Discontinued) The Amazon Web Services account ID of the Amazon Macie Classic member account.

" - } - } - }, - "traits": { - "smithy.api#documentation": "

(Discontinued) Contains information about the Amazon Macie Classic member\n account.

" - } - }, - "com.amazonaws.macie#MemberAccounts": { - "type": "list", - "member": { - "target": "com.amazonaws.macie#MemberAccount" - } - }, - "com.amazonaws.macie#NextToken": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 0, - "max": 500 - } - } - }, - "com.amazonaws.macie#Prefix": { - "type": "string", - "traits": { - "smithy.api#length": { - "min": 0, - "max": 10000 - } - } - }, - "com.amazonaws.macie#ResourceType": { - "type": "string", - "traits": { - "smithy.api#documentation": "Resource type that caused the exception", - "smithy.api#length": { - "min": 0, - "max": 1000 - } - } - }, - "com.amazonaws.macie#S3ContinuousClassificationType": { - "type": "enum", - "members": { - "FULL": { - "target": "smithy.api#Unit", - "traits": { - "smithy.api#enumValue": "FULL" - } - } - } - }, - "com.amazonaws.macie#S3OneTimeClassificationType": { - "type": "enum", - "members": { - "FULL": { - "target": "smithy.api#Unit", - "traits": { - "smithy.api#enumValue": "FULL" - } - }, - "NONE": { - "target": "smithy.api#Unit", - "traits": { - "smithy.api#enumValue": "NONE" - } - } - } - }, - "com.amazonaws.macie#S3Resource": { - "type": "structure", - "members": { - "bucketName": { - "target": "com.amazonaws.macie#BucketName", - "traits": { - "smithy.api#documentation": "

(Discontinued) The name of the S3 bucket.

", - "smithy.api#required": {} - } - }, - "prefix": { - "target": "com.amazonaws.macie#Prefix", - "traits": { - "smithy.api#documentation": "

(Discontinued) The prefix of the S3 bucket.

" - } - } - }, - "traits": { - "smithy.api#documentation": "

(Discontinued) Contains information about the S3 resource. This data type is used as a\n request parameter in the DisassociateS3Resources action and can be used as a response\n parameter in the AssociateS3Resources and UpdateS3Resources actions.

" - } - }, - "com.amazonaws.macie#S3ResourceClassification": { - "type": "structure", - "members": { - "bucketName": { - "target": "com.amazonaws.macie#BucketName", - "traits": { - "smithy.api#documentation": "

(Discontinued) The name of the S3 bucket that you want to associate with Amazon Macie\n Classic.

", - "smithy.api#required": {} - } - }, - "prefix": { - "target": "com.amazonaws.macie#Prefix", - "traits": { - "smithy.api#documentation": "

(Discontinued) The prefix of the S3 bucket that you want to associate with Amazon Macie\n Classic.

" - } - }, - "classificationType": { - "target": "com.amazonaws.macie#ClassificationType", - "traits": { - "smithy.api#documentation": "

(Discontinued) The classification type that you want to specify for the resource\n associated with Amazon Macie Classic.

", - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#documentation": "

(Discontinued) The S3 resources that you want to associate with Amazon Macie Classic\n for monitoring and data classification. This data type is used as a request parameter in the\n AssociateS3Resources action and a response parameter in the ListS3Resources action.

" - } - }, - "com.amazonaws.macie#S3ResourceClassificationUpdate": { - "type": "structure", - "members": { - "bucketName": { - "target": "com.amazonaws.macie#BucketName", - "traits": { - "smithy.api#documentation": "

(Discontinued) The name of the S3 bucket whose classification types you want to\n update.

", - "smithy.api#required": {} - } - }, - "prefix": { - "target": "com.amazonaws.macie#Prefix", - "traits": { - "smithy.api#documentation": "

(Discontinued) The prefix of the S3 bucket whose classification types you want to\n update.

" - } - }, - "classificationTypeUpdate": { - "target": "com.amazonaws.macie#ClassificationTypeUpdate", - "traits": { - "smithy.api#documentation": "

(Discontinued) The classification type that you want to update for the resource\n associated with Amazon Macie Classic.

", - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#documentation": "

(Discontinued) The S3 resources whose classification types you want to update. This\n data type is used as a request parameter in the UpdateS3Resources action.

" - } - }, - "com.amazonaws.macie#S3Resources": { - "type": "list", - "member": { - "target": "com.amazonaws.macie#S3Resource" - } - }, - "com.amazonaws.macie#S3ResourcesClassification": { - "type": "list", - "member": { - "target": "com.amazonaws.macie#S3ResourceClassification" - } - }, - "com.amazonaws.macie#S3ResourcesClassificationUpdate": { - "type": "list", - "member": { - "target": "com.amazonaws.macie#S3ResourceClassificationUpdate" - } - }, - "com.amazonaws.macie#UpdateS3Resources": { - "type": "operation", - "input": { - "target": "com.amazonaws.macie#UpdateS3ResourcesRequest" - }, - "output": { - "target": "com.amazonaws.macie#UpdateS3ResourcesResult" - }, - "errors": [ - { - "target": "com.amazonaws.macie#AccessDeniedException" - }, - { - "target": "com.amazonaws.macie#InternalException" - }, - { - "target": "com.amazonaws.macie#InvalidInputException" - } - ], - "traits": { - "smithy.api#documentation": "

(Discontinued) Updates the classification types for the specified S3 resources. If\n memberAccountId isn't specified, the action updates the classification types of the S3\n resources associated with Amazon Macie Classic for the current Macie Classic administrator\n account. If memberAccountId is specified, the action updates the classification types of the\n S3 resources associated with Macie Classic for the specified member account.

" - } - }, - "com.amazonaws.macie#UpdateS3ResourcesRequest": { - "type": "structure", - "members": { - "memberAccountId": { - "target": "com.amazonaws.macie#AWSAccountId", - "traits": { - "smithy.api#documentation": "

(Discontinued) The Amazon Web Services account ID of the Amazon Macie Classic member account whose S3\n resources' classification types you want to update.

" - } - }, - "s3ResourcesUpdate": { - "target": "com.amazonaws.macie#S3ResourcesClassificationUpdate", - "traits": { - "smithy.api#documentation": "

(Discontinued) The S3 resources whose classification types you want to\n update.

", - "smithy.api#required": {} - } - } - }, - "traits": { - "smithy.api#input": {} - } - }, - "com.amazonaws.macie#UpdateS3ResourcesResult": { - "type": "structure", - "members": { - "failedS3Resources": { - "target": "com.amazonaws.macie#FailedS3Resources", - "traits": { - "smithy.api#documentation": "

(Discontinued) The S3 resources whose classification types can't be updated. An error\n code and an error message are provided for each failed item.

" - } - } - }, - "traits": { - "smithy.api#output": {} - } - } - } -} diff --git a/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen/customization/APIGW_exports_nullability_exceptions.json b/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen/customization/APIGW_exports_nullability_exceptions.json deleted file mode 100644 index 88127e35598..00000000000 --- a/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen/customization/APIGW_exports_nullability_exceptions.json +++ /dev/null @@ -1,293 +0,0 @@ -{ - "com.amazonaws.amplifybackend#AmplifyBackend": [ - "com.amazonaws.amplifybackend#__boolean", - "com.amazonaws.amplifybackend#__double", - "com.amazonaws.amplifybackend#__integerMin1Max25" - ], - "com.amazonaws.apigatewaymanagementapi#ApiGatewayManagementApi": [], - "com.amazonaws.apigatewayv2#ApiGatewayV2": [ - "com.amazonaws.apigatewayv2#__boolean", - "com.amazonaws.apigatewayv2#__double", - "com.amazonaws.apigatewayv2#__integer", - "com.amazonaws.apigatewayv2#IntegerWithLengthBetween0And3600", - "com.amazonaws.apigatewayv2#IntegerWithLengthBetween50And30000", - "com.amazonaws.apigatewayv2#IntegerWithLengthBetweenMinus1And86400" - ], - "com.amazonaws.dataexchange#DataExchange": [ - "com.amazonaws.dataexchange#__boolean", - "com.amazonaws.dataexchange#__double", - "com.amazonaws.dataexchange#__doubleMin0", - "com.amazonaws.dataexchange#MaxResults" - ], - "com.amazonaws.greengrass#Greengrass": [ - "com.amazonaws.greengrass#__boolean", - "com.amazonaws.greengrass#__integer" - ], - "com.amazonaws.iot1clickdevicesservice#IoT1ClickDevicesService": [ - "com.amazonaws.iot1clickdevicesservice#__boolean", - "com.amazonaws.iot1clickdevicesservice#__doubleMin0Max100", - "com.amazonaws.iot1clickdevicesservice#__integer", - "com.amazonaws.iot1clickdevicesservice#MaxResults" - ], - "com.amazonaws.kafka#Kafka": [ - "com.amazonaws.kafka#__boolean", - "com.amazonaws.kafka#__double", - "com.amazonaws.kafka#__integer", - "com.amazonaws.kafka#__integerMin1Max15", - "com.amazonaws.kafka#__integerMin1Max16384", - "com.amazonaws.kafka#__long", - "com.amazonaws.kafka#MaxResults" - ], - "com.amazonaws.kafkaconnect#KafkaConnect": [ - "com.amazonaws.kafkaconnect#__boolean", - "com.amazonaws.kafkaconnect#__integer", - "com.amazonaws.kafkaconnect#__integerMin1Max10", - "com.amazonaws.kafkaconnect#__integerMin1Max100", - "com.amazonaws.kafkaconnect#__integerMin1Max8", - "com.amazonaws.kafkaconnect#__long", - "com.amazonaws.kafkaconnect#__longMin1", - "com.amazonaws.kafkaconnect#MaxResults" - ], - "com.amazonaws.macie2#Macie2": [ - "com.amazonaws.macie2#__boolean", - "com.amazonaws.macie2#__double", - "com.amazonaws.macie2#__integer", - "com.amazonaws.macie2#__long", - "com.amazonaws.macie2#MaxResults" - ], - "com.amazonaws.mediaconnect#MediaConnect": [ - "com.amazonaws.mediaconnect#__boolean", - "com.amazonaws.mediaconnect#__double", - "com.amazonaws.mediaconnect#__integer", - "com.amazonaws.mediaconnect#MaxResults" - ], - "com.amazonaws.mediaconvert#MediaConvert": [ - "com.amazonaws.mediaconvert#__doubleMin0", - "com.amazonaws.mediaconvert#__doubleMin0Max1", - "com.amazonaws.mediaconvert#__doubleMin0Max2147483647", - "com.amazonaws.mediaconvert#__doubleMinNegative20Max0", - "com.amazonaws.mediaconvert#__doubleMinNegative59Max0", - "com.amazonaws.mediaconvert#__doubleMinNegative60Max3", - "com.amazonaws.mediaconvert#__doubleMinNegative60Max6", - "com.amazonaws.mediaconvert#__doubleMinNegative60MaxNegative1", - "com.amazonaws.mediaconvert#__doubleMinNegative6Max3", - "com.amazonaws.mediaconvert#__doubleMinNegative8Max0", - "com.amazonaws.mediaconvert#__integer", - "com.amazonaws.mediaconvert#__integerMin0Max0", - "com.amazonaws.mediaconvert#__integerMin0Max1", - "com.amazonaws.mediaconvert#__integerMin0Max10", - "com.amazonaws.mediaconvert#__integerMin0Max100", - "com.amazonaws.mediaconvert#__integerMin0Max1000", - "com.amazonaws.mediaconvert#__integerMin0Max10000", - "com.amazonaws.mediaconvert#__integerMin0Max1152000000", - "com.amazonaws.mediaconvert#__integerMin0Max128", - "com.amazonaws.mediaconvert#__integerMin0Max1466400000", - "com.amazonaws.mediaconvert#__integerMin0Max15", - "com.amazonaws.mediaconvert#__integerMin0Max16", - "com.amazonaws.mediaconvert#__integerMin0Max2147483647", - "com.amazonaws.mediaconvert#__integerMin0Max255", - "com.amazonaws.mediaconvert#__integerMin0Max3", - "com.amazonaws.mediaconvert#__integerMin0Max30", - "com.amazonaws.mediaconvert#__integerMin0Max30000", - "com.amazonaws.mediaconvert#__integerMin0Max3600", - "com.amazonaws.mediaconvert#__integerMin0Max4", - "com.amazonaws.mediaconvert#__integerMin0Max4000", - "com.amazonaws.mediaconvert#__integerMin0Max4194303", - "com.amazonaws.mediaconvert#__integerMin0Max47185920", - "com.amazonaws.mediaconvert#__integerMin0Max5", - "com.amazonaws.mediaconvert#__integerMin0Max500", - "com.amazonaws.mediaconvert#__integerMin0Max50000", - "com.amazonaws.mediaconvert#__integerMin0Max65534", - "com.amazonaws.mediaconvert#__integerMin0Max65535", - "com.amazonaws.mediaconvert#__integerMin0Max7", - "com.amazonaws.mediaconvert#__integerMin0Max8", - "com.amazonaws.mediaconvert#__integerMin0Max9", - "com.amazonaws.mediaconvert#__integerMin0Max96", - "com.amazonaws.mediaconvert#__integerMin0Max99", - "com.amazonaws.mediaconvert#__integerMin100000Max100000000", - "com.amazonaws.mediaconvert#__integerMin1000Max1152000000", - "com.amazonaws.mediaconvert#__integerMin1000Max1466400000", - "com.amazonaws.mediaconvert#__integerMin1000Max288000000", - "com.amazonaws.mediaconvert#__integerMin1000Max30000", - "com.amazonaws.mediaconvert#__integerMin1000Max300000000", - "com.amazonaws.mediaconvert#__integerMin1000Max480000000", - "com.amazonaws.mediaconvert#__integerMin100Max1000", - "com.amazonaws.mediaconvert#__integerMin10Max48", - "com.amazonaws.mediaconvert#__integerMin16000Max320000", - "com.amazonaws.mediaconvert#__integerMin16000Max48000", - "com.amazonaws.mediaconvert#__integerMin16Max24", - "com.amazonaws.mediaconvert#__integerMin1Max1", - "com.amazonaws.mediaconvert#__integerMin1Max10", - "com.amazonaws.mediaconvert#__integerMin1Max100", - "com.amazonaws.mediaconvert#__integerMin1Max10000000", - "com.amazonaws.mediaconvert#__integerMin1Max1001", - "com.amazonaws.mediaconvert#__integerMin1Max17895697", - "com.amazonaws.mediaconvert#__integerMin1Max2", - "com.amazonaws.mediaconvert#__integerMin1Max20", - "com.amazonaws.mediaconvert#__integerMin1Max2048", - "com.amazonaws.mediaconvert#__integerMin1Max2147483640", - "com.amazonaws.mediaconvert#__integerMin1Max2147483647", - "com.amazonaws.mediaconvert#__integerMin1Max31", - "com.amazonaws.mediaconvert#__integerMin1Max32", - "com.amazonaws.mediaconvert#__integerMin1Max4", - "com.amazonaws.mediaconvert#__integerMin1Max4096", - "com.amazonaws.mediaconvert#__integerMin1Max512", - "com.amazonaws.mediaconvert#__integerMin1Max6", - "com.amazonaws.mediaconvert#__integerMin1Max60000", - "com.amazonaws.mediaconvert#__integerMin1Max64", - "com.amazonaws.mediaconvert#__integerMin22050Max48000", - "com.amazonaws.mediaconvert#__integerMin24Max60000", - "com.amazonaws.mediaconvert#__integerMin25Max10000", - "com.amazonaws.mediaconvert#__integerMin25Max2000", - "com.amazonaws.mediaconvert#__integerMin2Max2147483647", - "com.amazonaws.mediaconvert#__integerMin2Max4096", - "com.amazonaws.mediaconvert#__integerMin32000Max192000", - "com.amazonaws.mediaconvert#__integerMin32000Max3024000", - "com.amazonaws.mediaconvert#__integerMin32000Max384000", - "com.amazonaws.mediaconvert#__integerMin32000Max48000", - "com.amazonaws.mediaconvert#__integerMin32Max8182", - "com.amazonaws.mediaconvert#__integerMin32Max8192", - "com.amazonaws.mediaconvert#__integerMin384000Max1024000", - "com.amazonaws.mediaconvert#__integerMin3Max15", - "com.amazonaws.mediaconvert#__integerMin48000Max48000", - "com.amazonaws.mediaconvert#__integerMin4Max12", - "com.amazonaws.mediaconvert#__integerMin50Max86400000", - "com.amazonaws.mediaconvert#__integerMin6000Max1024000", - "com.amazonaws.mediaconvert#__integerMin64000Max640000", - "com.amazonaws.mediaconvert#__integerMin8000Max192000", - "com.amazonaws.mediaconvert#__integerMin8000Max96000", - "com.amazonaws.mediaconvert#__integerMin8Max12", - "com.amazonaws.mediaconvert#__integerMin8Max4096", - "com.amazonaws.mediaconvert#__integerMin90Max105", - "com.amazonaws.mediaconvert#__integerMin920Max1023", - "com.amazonaws.mediaconvert#__integerMin96Max600", - "com.amazonaws.mediaconvert#__integerMinNegative1000Max1000", - "com.amazonaws.mediaconvert#__integerMinNegative180Max180", - "com.amazonaws.mediaconvert#__integerMinNegative1Max10", - "com.amazonaws.mediaconvert#__integerMinNegative1Max3", - "com.amazonaws.mediaconvert#__integerMinNegative2147483648Max2147483647", - "com.amazonaws.mediaconvert#__integerMinNegative2Max3", - "com.amazonaws.mediaconvert#__integerMinNegative50Max50", - "com.amazonaws.mediaconvert#__integerMinNegative5Max10", - "com.amazonaws.mediaconvert#__integerMinNegative60Max6", - "com.amazonaws.mediaconvert#__integerMinNegative70Max0" - ], - "com.amazonaws.medialive#MediaLive": [ - "com.amazonaws.medialive#__double", - "com.amazonaws.medialive#__doubleMin0", - "com.amazonaws.medialive#__doubleMin0Max1", - "com.amazonaws.medialive#__doubleMin0Max100", - "com.amazonaws.medialive#__doubleMin0Max5000", - "com.amazonaws.medialive#__doubleMin1", - "com.amazonaws.medialive#__doubleMin1Max65535", - "com.amazonaws.medialive#__doubleMinNegative59Max0", - "com.amazonaws.medialive#__integer", - "com.amazonaws.medialive#__integerMin0", - "com.amazonaws.medialive#__integerMin0Max10", - "com.amazonaws.medialive#__integerMin0Max100", - "com.amazonaws.medialive#__integerMin0Max1000", - "com.amazonaws.medialive#__integerMin0Max10000", - "com.amazonaws.medialive#__integerMin0Max1000000", - "com.amazonaws.medialive#__integerMin0Max100000000", - "com.amazonaws.medialive#__integerMin0Max128", - "com.amazonaws.medialive#__integerMin0Max15", - "com.amazonaws.medialive#__integerMin0Max255", - "com.amazonaws.medialive#__integerMin0Max30", - "com.amazonaws.medialive#__integerMin0Max32768", - "com.amazonaws.medialive#__integerMin0Max3600", - "com.amazonaws.medialive#__integerMin0Max500", - "com.amazonaws.medialive#__integerMin0Max600", - "com.amazonaws.medialive#__integerMin0Max65535", - "com.amazonaws.medialive#__integerMin0Max65536", - "com.amazonaws.medialive#__integerMin0Max7", - "com.amazonaws.medialive#__integerMin0Max8191", - "com.amazonaws.medialive#__integerMin1", - "com.amazonaws.medialive#__integerMin100", - "com.amazonaws.medialive#__integerMin1000", - "com.amazonaws.medialive#__integerMin1000000Max100000000", - "com.amazonaws.medialive#__integerMin100000Max100000000", - "com.amazonaws.medialive#__integerMin100000Max40000000", - "com.amazonaws.medialive#__integerMin100000Max80000000", - "com.amazonaws.medialive#__integerMin1000Max30000", - "com.amazonaws.medialive#__integerMin1Max10", - "com.amazonaws.medialive#__integerMin1Max1000000", - "com.amazonaws.medialive#__integerMin1Max16", - "com.amazonaws.medialive#__integerMin1Max20", - "com.amazonaws.medialive#__integerMin1Max3003", - "com.amazonaws.medialive#__integerMin1Max31", - "com.amazonaws.medialive#__integerMin1Max32", - "com.amazonaws.medialive#__integerMin1Max3600000", - "com.amazonaws.medialive#__integerMin1Max4", - "com.amazonaws.medialive#__integerMin1Max5", - "com.amazonaws.medialive#__integerMin1Max6", - "com.amazonaws.medialive#__integerMin1Max8", - "com.amazonaws.medialive#__integerMin25Max10000", - "com.amazonaws.medialive#__integerMin25Max2000", - "com.amazonaws.medialive#__integerMin3", - "com.amazonaws.medialive#__integerMin30", - "com.amazonaws.medialive#__integerMin32Max8191", - "com.amazonaws.medialive#__integerMin4Max20", - "com.amazonaws.medialive#__integerMin800Max3000", - "com.amazonaws.medialive#__integerMin96Max600", - "com.amazonaws.medialive#__integerMinNegative1000Max1000", - "com.amazonaws.medialive#__integerMinNegative5Max5", - "com.amazonaws.medialive#__integerMinNegative60Max6", - "com.amazonaws.medialive#__integerMinNegative60Max60", - "com.amazonaws.medialive#__long", - "com.amazonaws.medialive#__longMin0Max1099511627775", - "com.amazonaws.medialive#__longMin0Max4294967295", - "com.amazonaws.medialive#__longMin0Max8589934591", - "com.amazonaws.medialive#__longMin0Max86400000", - "com.amazonaws.medialive#MaxResults" - ], - "com.amazonaws.mediapackage#MediaPackage": [ - "com.amazonaws.mediapackage#__boolean", - "com.amazonaws.mediapackage#__integer", - "com.amazonaws.mediapackage#MaxResults" - ], - "com.amazonaws.mediapackagevod#MediaPackageVod": [ - "com.amazonaws.mediapackagevod#__boolean", - "com.amazonaws.mediapackagevod#__integer", - "com.amazonaws.mediapackagevod#MaxResults" - ], - "com.amazonaws.mediatailor#MediaTailor": [ - "com.amazonaws.mediatailor#__boolean", - "com.amazonaws.mediatailor#__integer", - "com.amazonaws.mediatailor#__integerMin1", - "com.amazonaws.mediatailor#__integerMin1Max100", - "com.amazonaws.mediatailor#__long", - "com.amazonaws.mediatailor#MaxResults" - ], - "com.amazonaws.mq#mq": [ - "com.amazonaws.mq#__boolean", - "com.amazonaws.mq#__integer", - "com.amazonaws.mq#__integerMin5Max100", - "com.amazonaws.mq#MaxResults" - ], - "com.amazonaws.pinpoint#Pinpoint": [ - "com.amazonaws.pinpoint#__boolean", - "com.amazonaws.pinpoint#__double", - "com.amazonaws.pinpoint#__integer" - ], - "com.amazonaws.pinpointsmsvoice#PinpointSMSVoice": [ - "com.amazonaws.pinpointsmsvoice#Boolean" - ], - "com.amazonaws.route53recoverycontrolconfig#Route53RecoveryControlConfig": [ - "com.amazonaws.route53recoverycontrolconfig#__boolean", - "com.amazonaws.route53recoverycontrolconfig#__integer", - "com.amazonaws.route53recoverycontrolconfig#MaxResults" - ], - "com.amazonaws.route53recoveryreadiness#Route53RecoveryReadiness": [ - "com.amazonaws.route53recoveryreadiness#MaxResults" - ], - "com.amazonaws.schemas#schemas": [ - "com.amazonaws.schemas#__boolean", - "com.amazonaws.schemas#__integer", - "com.amazonaws.schemas#__long" - ], - "com.amazonaws.serverlessapplicationrepository#ServerlessApplicationRepository": [ - "com.amazonaws.serverlessapplicationrepository#__boolean", - "com.amazonaws.serverlessapplicationrepository#__integer", - "com.amazonaws.serverlessapplicationrepository#MaxItems" - ] -} diff --git a/service/macie/CHANGELOG.md b/service/macie/CHANGELOG.md deleted file mode 100644 index 354d6a900a6..00000000000 --- a/service/macie/CHANGELOG.md +++ /dev/null @@ -1,295 +0,0 @@ -# v1.19.2 (2023-11-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.1 (2023-11-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.19.0 (2023-11-01) - -* **Feature**: Adds support for configured endpoints via environment variables and the AWS shared configuration file. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.18.0 (2023-10-31) - -* **Feature**: **BREAKING CHANGE**: Bump minimum go version to 1.19 per the revised [go version support policy](https://aws.amazon.com/blogs/developer/aws-sdk-for-go-aligns-with-go-release-policy-on-supported-runtimes/). -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.2 (2023-10-12) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.1 (2023-10-06) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.17.0 (2023-09-18) - -* **Announcement**: [BREAKFIX] Change in MaxResults datatype from value to pointer type in cognito-sync service. -* **Feature**: Adds several endpoint ruleset changes across all models: smaller rulesets, removed non-unique regional endpoints, fixes FIPS and DualStack endpoints, and make region not required in SDK::Endpoint. Additional breakfix to cognito-sync field. - -# v1.16.5 (2023-08-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.4 (2023-08-18) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.3 (2023-08-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.2 (2023-08-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.16.1 (2023-08-01) - -* No change notes available for this release. - -# v1.16.0 (2023-07-31) - -* **Feature**: Adds support for smithy-modeled endpoint resolution. A new rules-based endpoint resolution will be added to the SDK which will supercede and deprecate existing endpoint resolution. Specifically, EndpointResolver will be deprecated while BaseEndpoint and EndpointResolverV2 will take its place. For more information, please see the Endpoints section in our Developer Guide. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.14 (2023-07-28) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.13 (2023-07-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.12 (2023-06-15) - -* No change notes available for this release. - -# v1.15.11 (2023-06-13) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.10 (2023-05-04) - -* No change notes available for this release. - -# v1.15.9 (2023-04-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.8 (2023-04-10) - -* No change notes available for this release. - -# v1.15.7 (2023-04-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.6 (2023-03-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.5 (2023-03-10) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.4 (2023-02-22) - -* **Bug Fix**: Prevent nil pointer dereference when retrieving error codes. - -# v1.15.3 (2023-02-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.2 (2023-02-15) - -* **Announcement**: When receiving an error response in restJson-based services, an incorrect error type may have been returned based on the content of the response. This has been fixed via PR #2012 tracked in issue #1910. -* **Bug Fix**: Correct error type parsing for restJson services. - -# v1.15.1 (2023-02-03) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.15.0 (2023-01-05) - -* **Feature**: Add `ErrorCodeOverride` field to all error structs (aws/smithy-go#401). - -# v1.14.21 (2022-12-15) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.20 (2022-12-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.19 (2022-10-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.18 (2022-10-21) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.17 (2022-09-20) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.16 (2022-09-14) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.15 (2022-09-02) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.14 (2022-08-31) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.13 (2022-08-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.12 (2022-08-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.11 (2022-08-09) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.10 (2022-08-08) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.9 (2022-08-01) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.8 (2022-07-05) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.7 (2022-06-29) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.6 (2022-06-07) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.5 (2022-05-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.4 (2022-04-25) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.3 (2022-03-30) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.2 (2022-03-24) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.1 (2022-03-23) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.14.0 (2022-03-08) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Documentation**: Updated service client model to latest release. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.13.0 (2022-02-24) - -* **Feature**: API client updated -* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.12.0 (2022-01-14) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.11.0 (2022-01-07) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.10.0 (2021-12-21) - -* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens. - -# v1.9.2 (2021-12-02) - -* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514)) -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.1 (2021-11-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.9.0 (2021-11-12) - -* **Feature**: Service clients now support custom endpoints that have an initial URI path defined. - -# v1.8.0 (2021-11-06) - -* **Feature**: The SDK now supports configuration of FIPS and DualStack endpoints using environment variables, shared configuration, or programmatically. -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.7.0 (2021-10-21) - -* **Feature**: Updated to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.2 (2021-10-11) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.1 (2021-09-17) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.6.0 (2021-08-27) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.3 (2021-08-19) - -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.2 (2021-08-04) - -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version. -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.1 (2021-07-15) - -* **Documentation**: Updated service model to latest revision. -* **Dependency Update**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.5.0 (2021-06-25) - -* **Feature**: Updated `github.com/aws/smithy-go` to latest version -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.4.0 (2021-05-20) - -* **Feature**: API client updated -* **Dependency Update**: Updated to the latest SDK module versions - -# v1.3.0 (2021-05-14) - -* **Feature**: Constant has been added to modules to enable runtime version inspection for reporting. -* **Dependency Update**: Updated to the latest SDK module versions - diff --git a/service/macie/LICENSE.txt b/service/macie/LICENSE.txt deleted file mode 100644 index d6456956733..00000000000 --- a/service/macie/LICENSE.txt +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/service/macie/api_client.go b/service/macie/api_client.go deleted file mode 100644 index 394757f90d8..00000000000 --- a/service/macie/api_client.go +++ /dev/null @@ -1,454 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package macie - -import ( - "context" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/aws/defaults" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - "github.com/aws/aws-sdk-go-v2/aws/retry" - "github.com/aws/aws-sdk-go-v2/aws/signer/v4" - awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" - internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - smithy "github.com/aws/smithy-go" - smithydocument "github.com/aws/smithy-go/document" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net" - "net/http" - "time" -) - -const ServiceID = "Macie" -const ServiceAPIVersion = "2017-12-19" - -// Client provides the API client to make operations call for Amazon Macie. -type Client struct { - options Options -} - -// New returns an initialized Client based on the functional options. Provide -// additional functional options to further configure the behavior of the client, -// such as changing the client's endpoint or adding custom middleware behavior. -func New(options Options, optFns ...func(*Options)) *Client { - options = options.Copy() - - resolveDefaultLogger(&options) - - setResolvedDefaultsMode(&options) - - resolveRetryer(&options) - - resolveHTTPClient(&options) - - resolveHTTPSignerV4(&options) - - resolveEndpointResolverV2(&options) - - resolveAuthSchemeResolver(&options) - - for _, fn := range optFns { - fn(&options) - } - - ignoreAnonymousAuth(&options) - - resolveAuthSchemes(&options) - - client := &Client{ - options: options, - } - - return client -} - -func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { - ctx = middleware.ClearStackValues(ctx) - stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) - options := c.options.Copy() - - for _, fn := range optFns { - fn(&options) - } - - finalizeRetryMaxAttemptOptions(&options, *c) - - finalizeClientEndpointResolverOptions(&options) - - for _, fn := range stackFns { - if err := fn(stack, options); err != nil { - return nil, metadata, err - } - } - - for _, fn := range options.APIOptions { - if err := fn(stack); err != nil { - return nil, metadata, err - } - } - - handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) - result, metadata, err = handler.Handle(ctx, params) - if err != nil { - err = &smithy.OperationError{ - ServiceID: ServiceID, - OperationName: opID, - Err: err, - } - } - return result, metadata, err -} - -type operationInputKey struct{} - -func setOperationInput(ctx context.Context, input interface{}) context.Context { - return middleware.WithStackValue(ctx, operationInputKey{}, input) -} - -func getOperationInput(ctx context.Context) interface{} { - return middleware.GetStackValue(ctx, operationInputKey{}) -} - -type setOperationInputMiddleware struct { -} - -func (*setOperationInputMiddleware) ID() string { - return "setOperationInput" -} - -func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - ctx = setOperationInput(ctx, in.Parameters) - return next.HandleSerialize(ctx, in) -} - -func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { - if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { - return fmt.Errorf("add ResolveAuthScheme: %v", err) - } - if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { - return fmt.Errorf("add GetIdentity: %v", err) - } - if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { - return fmt.Errorf("add ResolveEndpointV2: %v", err) - } - if err := stack.Finalize.Insert(&signRequestMiddleware{}, "ResolveEndpointV2", middleware.After); err != nil { - return fmt.Errorf("add Signing: %v", err) - } - return nil -} -func resolveAuthSchemeResolver(options *Options) { - if options.AuthSchemeResolver == nil { - options.AuthSchemeResolver = &defaultAuthSchemeResolver{} - } -} - -func resolveAuthSchemes(options *Options) { - if options.AuthSchemes == nil { - options.AuthSchemes = []smithyhttp.AuthScheme{ - internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ - Signer: options.HTTPSignerV4, - Logger: options.Logger, - LogSigning: options.ClientLogMode.IsSigning(), - }), - } - } -} - -type noSmithyDocumentSerde = smithydocument.NoSerde - -type legacyEndpointContextSetter struct { - LegacyResolver EndpointResolver -} - -func (*legacyEndpointContextSetter) ID() string { - return "legacyEndpointContextSetter" -} - -func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - if m.LegacyResolver != nil { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) - } - - return next.HandleInitialize(ctx, in) - -} -func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { - return stack.Initialize.Add(&legacyEndpointContextSetter{ - LegacyResolver: o.EndpointResolver, - }, middleware.Before) -} - -func resolveDefaultLogger(o *Options) { - if o.Logger != nil { - return - } - o.Logger = logging.Nop{} -} - -func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { - return middleware.AddSetLoggerMiddleware(stack, o.Logger) -} - -func setResolvedDefaultsMode(o *Options) { - if len(o.resolvedDefaultsMode) > 0 { - return - } - - var mode aws.DefaultsMode - mode.SetFromString(string(o.DefaultsMode)) - - if mode == aws.DefaultsModeAuto { - mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) - } - - o.resolvedDefaultsMode = mode -} - -// NewFromConfig returns a new client from the provided config. -func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { - opts := Options{ - Region: cfg.Region, - DefaultsMode: cfg.DefaultsMode, - RuntimeEnvironment: cfg.RuntimeEnvironment, - HTTPClient: cfg.HTTPClient, - Credentials: cfg.Credentials, - APIOptions: cfg.APIOptions, - Logger: cfg.Logger, - ClientLogMode: cfg.ClientLogMode, - AppID: cfg.AppID, - } - resolveAWSRetryerProvider(cfg, &opts) - resolveAWSRetryMaxAttempts(cfg, &opts) - resolveAWSRetryMode(cfg, &opts) - resolveAWSEndpointResolver(cfg, &opts) - resolveUseDualStackEndpoint(cfg, &opts) - resolveUseFIPSEndpoint(cfg, &opts) - resolveBaseEndpoint(cfg, &opts) - return New(opts, optFns...) -} - -func resolveHTTPClient(o *Options) { - var buildable *awshttp.BuildableClient - - if o.HTTPClient != nil { - var ok bool - buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) - if !ok { - return - } - } else { - buildable = awshttp.NewBuildableClient() - } - - modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) - if err == nil { - buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { - if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { - dialer.Timeout = dialerTimeout - } - }) - - buildable = buildable.WithTransportOptions(func(transport *http.Transport) { - if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { - transport.TLSHandshakeTimeout = tlsHandshakeTimeout - } - }) - } - - o.HTTPClient = buildable -} - -func resolveRetryer(o *Options) { - if o.Retryer != nil { - return - } - - if len(o.RetryMode) == 0 { - modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) - if err == nil { - o.RetryMode = modeConfig.RetryMode - } - } - if len(o.RetryMode) == 0 { - o.RetryMode = aws.RetryModeStandard - } - - var standardOptions []func(*retry.StandardOptions) - if v := o.RetryMaxAttempts; v != 0 { - standardOptions = append(standardOptions, func(so *retry.StandardOptions) { - so.MaxAttempts = v - }) - } - - switch o.RetryMode { - case aws.RetryModeAdaptive: - var adaptiveOptions []func(*retry.AdaptiveModeOptions) - if len(standardOptions) != 0 { - adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { - ao.StandardOptions = append(ao.StandardOptions, standardOptions...) - }) - } - o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) - - default: - o.Retryer = retry.NewStandard(standardOptions...) - } -} - -func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { - if cfg.Retryer == nil { - return - } - o.Retryer = cfg.Retryer() -} - -func resolveAWSRetryMode(cfg aws.Config, o *Options) { - if len(cfg.RetryMode) == 0 { - return - } - o.RetryMode = cfg.RetryMode -} -func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { - if cfg.RetryMaxAttempts == 0 { - return - } - o.RetryMaxAttempts = cfg.RetryMaxAttempts -} - -func finalizeRetryMaxAttemptOptions(o *Options, client Client) { - if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { - return - } - - o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) -} - -func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { - if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { - return - } - o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) -} - -func addClientUserAgent(stack *middleware.Stack, options Options) error { - if err := awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "macie", goModuleVersion)(stack); err != nil { - return err - } - - if len(options.AppID) > 0 { - return awsmiddleware.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID)(stack) - } - - return nil -} - -type HTTPSignerV4 interface { - SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error -} - -func resolveHTTPSignerV4(o *Options) { - if o.HTTPSignerV4 != nil { - return - } - o.HTTPSignerV4 = newDefaultV4Signer(*o) -} - -func newDefaultV4Signer(o Options) *v4.Signer { - return v4.NewSigner(func(so *v4.SignerOptions) { - so.Logger = o.Logger - so.LogSigning = o.ClientLogMode.IsSigning() - }) -} - -func addRetryMiddlewares(stack *middleware.Stack, o Options) error { - mo := retry.AddRetryMiddlewaresOptions{ - Retryer: o.Retryer, - LogRetryAttempts: o.ClientLogMode.IsRetries(), - } - return retry.AddRetryMiddlewares(stack, mo) -} - -// resolves dual-stack endpoint configuration -func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { - if len(cfg.ConfigSources) == 0 { - return nil - } - value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) - if err != nil { - return err - } - if found { - o.EndpointOptions.UseDualStackEndpoint = value - } - return nil -} - -// resolves FIPS endpoint configuration -func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { - if len(cfg.ConfigSources) == 0 { - return nil - } - value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) - if err != nil { - return err - } - if found { - o.EndpointOptions.UseFIPSEndpoint = value - } - return nil -} - -func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { - return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) -} - -func addResponseErrorMiddleware(stack *middleware.Stack) error { - return awshttp.AddResponseErrorMiddleware(stack) -} - -func addRequestResponseLogging(stack *middleware.Stack, o Options) error { - return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ - LogRequest: o.ClientLogMode.IsRequest(), - LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), - LogResponse: o.ClientLogMode.IsResponse(), - LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), - }, middleware.After) -} - -type disableHTTPSMiddleware struct { - DisableHTTPS bool -} - -func (*disableHTTPSMiddleware) ID() string { - return "disableHTTPS" -} - -func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { - req.URL.Scheme = "http" - } - - return next.HandleFinalize(ctx, in) -} - -func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { - return stack.Finalize.Insert(&disableHTTPSMiddleware{ - DisableHTTPS: o.EndpointOptions.DisableHTTPS, - }, "ResolveEndpointV2", middleware.After) -} diff --git a/service/macie/api_client_test.go b/service/macie/api_client_test.go deleted file mode 100644 index d87d1de896b..00000000000 --- a/service/macie/api_client_test.go +++ /dev/null @@ -1,123 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package macie - -import ( - "context" - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "io/ioutil" - "net/http" - "strings" - "testing" -) - -func TestClient_resolveRetryOptions(t *testing.T) { - nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { - return &http.Response{ - StatusCode: 200, - Header: http.Header{}, - Body: ioutil.NopCloser(strings.NewReader("")), - }, nil - }) - - cases := map[string]struct { - defaultsMode aws.DefaultsMode - retryer aws.Retryer - retryMaxAttempts int - opRetryMaxAttempts *int - retryMode aws.RetryMode - expectClientRetryMode aws.RetryMode - expectClientMaxAttempts int - expectOpMaxAttempts int - }{ - "defaults": { - defaultsMode: aws.DefaultsModeStandard, - expectClientRetryMode: aws.RetryModeStandard, - expectClientMaxAttempts: 3, - expectOpMaxAttempts: 3, - }, - "custom default retry": { - retryMode: aws.RetryModeAdaptive, - retryMaxAttempts: 10, - expectClientRetryMode: aws.RetryModeAdaptive, - expectClientMaxAttempts: 10, - expectOpMaxAttempts: 10, - }, - "custom op max attempts": { - retryMode: aws.RetryModeAdaptive, - retryMaxAttempts: 10, - opRetryMaxAttempts: aws.Int(2), - expectClientRetryMode: aws.RetryModeAdaptive, - expectClientMaxAttempts: 10, - expectOpMaxAttempts: 2, - }, - "custom op no change max attempts": { - retryMode: aws.RetryModeAdaptive, - retryMaxAttempts: 10, - opRetryMaxAttempts: aws.Int(10), - expectClientRetryMode: aws.RetryModeAdaptive, - expectClientMaxAttempts: 10, - expectOpMaxAttempts: 10, - }, - "custom op 0 max attempts": { - retryMode: aws.RetryModeAdaptive, - retryMaxAttempts: 10, - opRetryMaxAttempts: aws.Int(0), - expectClientRetryMode: aws.RetryModeAdaptive, - expectClientMaxAttempts: 10, - expectOpMaxAttempts: 10, - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - client := NewFromConfig(aws.Config{ - DefaultsMode: c.defaultsMode, - Retryer: func() func() aws.Retryer { - if c.retryer == nil { - return nil - } - - return func() aws.Retryer { return c.retryer } - }(), - HTTPClient: nopClient, - RetryMaxAttempts: c.retryMaxAttempts, - RetryMode: c.retryMode, - }) - - if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { - t.Errorf("expect %v retry mode, got %v", e, a) - } - if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { - t.Errorf("expect %v max attempts, got %v", e, a) - } - - _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, - []func(*Options){ - func(o *Options) { - if c.opRetryMaxAttempts == nil { - return - } - o.RetryMaxAttempts = *c.opRetryMaxAttempts - }, - }, - func(s *middleware.Stack, o Options) error { - s.Initialize.Clear() - s.Serialize.Clear() - s.Build.Clear() - s.Finalize.Clear() - s.Deserialize.Clear() - - if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { - t.Errorf("expect %v op max attempts, got %v", e, a) - } - return nil - }) - if err != nil { - t.Fatalf("expect no operation error, got %v", err) - } - }) - } -} diff --git a/service/macie/api_op_AssociateMemberAccount.go b/service/macie/api_op_AssociateMemberAccount.go deleted file mode 100644 index ad707dd303a..00000000000 --- a/service/macie/api_op_AssociateMemberAccount.go +++ /dev/null @@ -1,134 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package macie - -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" -) - -// (Discontinued) Associates a specified Amazon Web Services account with Amazon -// Macie Classic as a member account. -func (c *Client) AssociateMemberAccount(ctx context.Context, params *AssociateMemberAccountInput, optFns ...func(*Options)) (*AssociateMemberAccountOutput, error) { - if params == nil { - params = &AssociateMemberAccountInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateMemberAccount", params, optFns, c.addOperationAssociateMemberAccountMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateMemberAccountOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateMemberAccountInput struct { - - // (Discontinued) The ID of the Amazon Web Services account that you want to - // associate with Amazon Macie Classic as a member account. - // - // This member is required. - MemberAccountId *string - - noSmithyDocumentSerde -} - -type AssociateMemberAccountOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateMemberAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateMemberAccount{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateMemberAccount{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateMemberAccount"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { - return err - } - if err = addRetryMiddlewares(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, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addOpAssociateMemberAccountValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateMemberAccount(options.Region), middleware.Before); err != nil { - return err - } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssociateMemberAccount(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateMemberAccount", - } -} diff --git a/service/macie/api_op_AssociateS3Resources.go b/service/macie/api_op_AssociateS3Resources.go deleted file mode 100644 index a663c8ee1a5..00000000000 --- a/service/macie/api_op_AssociateS3Resources.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package macie - -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/macie/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// (Discontinued) Associates specified S3 resources with Amazon Macie Classic for -// monitoring and data classification. If memberAccountId isn't specified, the -// action associates specified S3 resources with Macie Classic for the current -// Macie Classic administrator account. If memberAccountId is specified, the -// action associates specified S3 resources with Macie Classic for the specified -// member account. -func (c *Client) AssociateS3Resources(ctx context.Context, params *AssociateS3ResourcesInput, optFns ...func(*Options)) (*AssociateS3ResourcesOutput, error) { - if params == nil { - params = &AssociateS3ResourcesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "AssociateS3Resources", params, optFns, c.addOperationAssociateS3ResourcesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*AssociateS3ResourcesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type AssociateS3ResourcesInput struct { - - // (Discontinued) The S3 resources that you want to associate with Amazon Macie - // Classic for monitoring and data classification. - // - // This member is required. - S3Resources []types.S3ResourceClassification - - // (Discontinued) The ID of the Amazon Macie Classic member account whose - // resources you want to associate with Macie Classic. - MemberAccountId *string - - noSmithyDocumentSerde -} - -type AssociateS3ResourcesOutput struct { - - // (Discontinued) S3 resources that couldn't be associated with Amazon Macie - // Classic. An error code and an error message are provided for each failed item. - FailedS3Resources []types.FailedS3Resource - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationAssociateS3ResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpAssociateS3Resources{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpAssociateS3Resources{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateS3Resources"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { - return err - } - if err = addRetryMiddlewares(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, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addOpAssociateS3ResourcesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateS3Resources(options.Region), middleware.Before); err != nil { - return err - } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opAssociateS3Resources(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "AssociateS3Resources", - } -} diff --git a/service/macie/api_op_DisassociateMemberAccount.go b/service/macie/api_op_DisassociateMemberAccount.go deleted file mode 100644 index 25a3d3e48da..00000000000 --- a/service/macie/api_op_DisassociateMemberAccount.go +++ /dev/null @@ -1,133 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package macie - -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" -) - -// (Discontinued) Removes the specified member account from Amazon Macie Classic. -func (c *Client) DisassociateMemberAccount(ctx context.Context, params *DisassociateMemberAccountInput, optFns ...func(*Options)) (*DisassociateMemberAccountOutput, error) { - if params == nil { - params = &DisassociateMemberAccountInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateMemberAccount", params, optFns, c.addOperationDisassociateMemberAccountMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateMemberAccountOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateMemberAccountInput struct { - - // (Discontinued) The ID of the member account that you want to remove from Amazon - // Macie Classic. - // - // This member is required. - MemberAccountId *string - - noSmithyDocumentSerde -} - -type DisassociateMemberAccountOutput struct { - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateMemberAccountMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisassociateMemberAccount{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisassociateMemberAccount{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateMemberAccount"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { - return err - } - if err = addRetryMiddlewares(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, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addOpDisassociateMemberAccountValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateMemberAccount(options.Region), middleware.Before); err != nil { - return err - } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateMemberAccount(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateMemberAccount", - } -} diff --git a/service/macie/api_op_DisassociateS3Resources.go b/service/macie/api_op_DisassociateS3Resources.go deleted file mode 100644 index 2cab4abb3b3..00000000000 --- a/service/macie/api_op_DisassociateS3Resources.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package macie - -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/macie/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// (Discontinued) Removes specified S3 resources from being monitored by Amazon -// Macie Classic. If memberAccountId isn't specified, the action removes specified -// S3 resources from Macie Classic for the current Macie Classic administrator -// account. If memberAccountId is specified, the action removes specified S3 -// resources from Macie Classic for the specified member account. -func (c *Client) DisassociateS3Resources(ctx context.Context, params *DisassociateS3ResourcesInput, optFns ...func(*Options)) (*DisassociateS3ResourcesOutput, error) { - if params == nil { - params = &DisassociateS3ResourcesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "DisassociateS3Resources", params, optFns, c.addOperationDisassociateS3ResourcesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*DisassociateS3ResourcesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type DisassociateS3ResourcesInput struct { - - // (Discontinued) The S3 resources (buckets or prefixes) that you want to remove - // from being monitored and classified by Amazon Macie Classic. - // - // This member is required. - AssociatedS3Resources []types.S3Resource - - // (Discontinued) The ID of the Amazon Macie Classic member account whose - // resources you want to remove from being monitored by Macie Classic. - MemberAccountId *string - - noSmithyDocumentSerde -} - -type DisassociateS3ResourcesOutput struct { - - // (Discontinued) S3 resources that couldn't be removed from being monitored and - // classified by Amazon Macie Classic. An error code and an error message are - // provided for each failed item. - FailedS3Resources []types.FailedS3Resource - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationDisassociateS3ResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpDisassociateS3Resources{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDisassociateS3Resources{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateS3Resources"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { - return err - } - if err = addRetryMiddlewares(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, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addOpDisassociateS3ResourcesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateS3Resources(options.Region), middleware.Before); err != nil { - return err - } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opDisassociateS3Resources(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "DisassociateS3Resources", - } -} diff --git a/service/macie/api_op_ListMemberAccounts.go b/service/macie/api_op_ListMemberAccounts.go deleted file mode 100644 index bf9f92dd3a3..00000000000 --- a/service/macie/api_op_ListMemberAccounts.go +++ /dev/null @@ -1,240 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package macie - -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/macie/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// (Discontinued) Lists all Amazon Macie Classic member accounts for the current -// Macie Classic administrator account. -func (c *Client) ListMemberAccounts(ctx context.Context, params *ListMemberAccountsInput, optFns ...func(*Options)) (*ListMemberAccountsOutput, error) { - if params == nil { - params = &ListMemberAccountsInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListMemberAccounts", params, optFns, c.addOperationListMemberAccountsMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListMemberAccountsOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListMemberAccountsInput struct { - - // (Discontinued) Use this parameter to indicate the maximum number of items that - // you want in the response. The default value is 250. - MaxResults *int32 - - // (Discontinued) Use this parameter when paginating results. Set the value of - // this parameter to null on your first call to the ListMemberAccounts action. - // Subsequent calls to the action fill nextToken in the request with the value of - // nextToken from the previous response to continue listing data. - NextToken *string - - noSmithyDocumentSerde -} - -type ListMemberAccountsOutput struct { - - // (Discontinued) A list of the Amazon Macie Classic member accounts returned by - // the action. The current Macie Classic administrator account is also included in - // this list. - MemberAccounts []types.MemberAccount - - // (Discontinued) When a response is generated, if there is more data to be - // listed, this parameter is present in the response and contains the value to use - // for the nextToken parameter in a subsequent pagination request. If there is no - // more data to be listed, this parameter is set to null. - NextToken *string - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListMemberAccountsMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListMemberAccounts{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListMemberAccounts{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListMemberAccounts"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { - return err - } - if err = addRetryMiddlewares(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, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListMemberAccounts(options.Region), middleware.Before); err != nil { - return err - } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - return nil -} - -// ListMemberAccountsAPIClient is a client that implements the ListMemberAccounts -// operation. -type ListMemberAccountsAPIClient interface { - ListMemberAccounts(context.Context, *ListMemberAccountsInput, ...func(*Options)) (*ListMemberAccountsOutput, error) -} - -var _ ListMemberAccountsAPIClient = (*Client)(nil) - -// ListMemberAccountsPaginatorOptions is the paginator options for -// ListMemberAccounts -type ListMemberAccountsPaginatorOptions struct { - // (Discontinued) Use this parameter to indicate the maximum number of items that - // you want in the response. The default value is 250. - 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 -} - -// ListMemberAccountsPaginator is a paginator for ListMemberAccounts -type ListMemberAccountsPaginator struct { - options ListMemberAccountsPaginatorOptions - client ListMemberAccountsAPIClient - params *ListMemberAccountsInput - nextToken *string - firstPage bool -} - -// NewListMemberAccountsPaginator returns a new ListMemberAccountsPaginator -func NewListMemberAccountsPaginator(client ListMemberAccountsAPIClient, params *ListMemberAccountsInput, optFns ...func(*ListMemberAccountsPaginatorOptions)) *ListMemberAccountsPaginator { - if params == nil { - params = &ListMemberAccountsInput{} - } - - options := ListMemberAccountsPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListMemberAccountsPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListMemberAccountsPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListMemberAccounts page. -func (p *ListMemberAccountsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMemberAccountsOutput, 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.ListMemberAccounts(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_opListMemberAccounts(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListMemberAccounts", - } -} diff --git a/service/macie/api_op_ListS3Resources.go b/service/macie/api_op_ListS3Resources.go deleted file mode 100644 index 298b3129c08..00000000000 --- a/service/macie/api_op_ListS3Resources.go +++ /dev/null @@ -1,244 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package macie - -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/macie/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// (Discontinued) Lists all the S3 resources associated with Amazon Macie Classic. -// If memberAccountId isn't specified, the action lists the S3 resources -// associated with Macie Classic for the current Macie Classic administrator -// account. If memberAccountId is specified, the action lists the S3 resources -// associated with Macie Classic for the specified member account. -func (c *Client) ListS3Resources(ctx context.Context, params *ListS3ResourcesInput, optFns ...func(*Options)) (*ListS3ResourcesOutput, error) { - if params == nil { - params = &ListS3ResourcesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "ListS3Resources", params, optFns, c.addOperationListS3ResourcesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*ListS3ResourcesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type ListS3ResourcesInput struct { - - // (Discontinued) Use this parameter to indicate the maximum number of items that - // you want in the response. The default value is 250. - MaxResults *int32 - - // (Discontinued) The Amazon Macie Classic member account ID whose associated S3 - // resources you want to list. - MemberAccountId *string - - // (Discontinued) Use this parameter when paginating results. Set its value to - // null on your first call to the ListS3Resources action. Subsequent calls to the - // action fill nextToken in the request with the value of nextToken from the - // previous response to continue listing data. - NextToken *string - - noSmithyDocumentSerde -} - -type ListS3ResourcesOutput struct { - - // (Discontinued) When a response is generated, if there is more data to be - // listed, this parameter is present in the response and contains the value to use - // for the nextToken parameter in a subsequent pagination request. If there is no - // more data to be listed, this parameter is set to null. - NextToken *string - - // (Discontinued) A list of the associated S3 resources returned by the action. - S3Resources []types.S3ResourceClassification - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationListS3ResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpListS3Resources{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListS3Resources{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "ListS3Resources"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { - return err - } - if err = addRetryMiddlewares(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, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListS3Resources(options.Region), middleware.Before); err != nil { - return err - } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - return nil -} - -// ListS3ResourcesAPIClient is a client that implements the ListS3Resources -// operation. -type ListS3ResourcesAPIClient interface { - ListS3Resources(context.Context, *ListS3ResourcesInput, ...func(*Options)) (*ListS3ResourcesOutput, error) -} - -var _ ListS3ResourcesAPIClient = (*Client)(nil) - -// ListS3ResourcesPaginatorOptions is the paginator options for ListS3Resources -type ListS3ResourcesPaginatorOptions struct { - // (Discontinued) Use this parameter to indicate the maximum number of items that - // you want in the response. The default value is 250. - 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 -} - -// ListS3ResourcesPaginator is a paginator for ListS3Resources -type ListS3ResourcesPaginator struct { - options ListS3ResourcesPaginatorOptions - client ListS3ResourcesAPIClient - params *ListS3ResourcesInput - nextToken *string - firstPage bool -} - -// NewListS3ResourcesPaginator returns a new ListS3ResourcesPaginator -func NewListS3ResourcesPaginator(client ListS3ResourcesAPIClient, params *ListS3ResourcesInput, optFns ...func(*ListS3ResourcesPaginatorOptions)) *ListS3ResourcesPaginator { - if params == nil { - params = &ListS3ResourcesInput{} - } - - options := ListS3ResourcesPaginatorOptions{} - if params.MaxResults != nil { - options.Limit = *params.MaxResults - } - - for _, fn := range optFns { - fn(&options) - } - - return &ListS3ResourcesPaginator{ - options: options, - client: client, - params: params, - firstPage: true, - nextToken: params.NextToken, - } -} - -// HasMorePages returns a boolean indicating whether more pages are available -func (p *ListS3ResourcesPaginator) HasMorePages() bool { - return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) -} - -// NextPage retrieves the next ListS3Resources page. -func (p *ListS3ResourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListS3ResourcesOutput, 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.ListS3Resources(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_opListS3Resources(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "ListS3Resources", - } -} diff --git a/service/macie/api_op_UpdateS3Resources.go b/service/macie/api_op_UpdateS3Resources.go deleted file mode 100644 index 74b89aff186..00000000000 --- a/service/macie/api_op_UpdateS3Resources.go +++ /dev/null @@ -1,147 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package macie - -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/macie/types" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -// (Discontinued) Updates the classification types for the specified S3 resources. -// If memberAccountId isn't specified, the action updates the classification types -// of the S3 resources associated with Amazon Macie Classic for the current Macie -// Classic administrator account. If memberAccountId is specified, the action -// updates the classification types of the S3 resources associated with Macie -// Classic for the specified member account. -func (c *Client) UpdateS3Resources(ctx context.Context, params *UpdateS3ResourcesInput, optFns ...func(*Options)) (*UpdateS3ResourcesOutput, error) { - if params == nil { - params = &UpdateS3ResourcesInput{} - } - - result, metadata, err := c.invokeOperation(ctx, "UpdateS3Resources", params, optFns, c.addOperationUpdateS3ResourcesMiddlewares) - if err != nil { - return nil, err - } - - out := result.(*UpdateS3ResourcesOutput) - out.ResultMetadata = metadata - return out, nil -} - -type UpdateS3ResourcesInput struct { - - // (Discontinued) The S3 resources whose classification types you want to update. - // - // This member is required. - S3ResourcesUpdate []types.S3ResourceClassificationUpdate - - // (Discontinued) The Amazon Web Services account ID of the Amazon Macie Classic - // member account whose S3 resources' classification types you want to update. - MemberAccountId *string - - noSmithyDocumentSerde -} - -type UpdateS3ResourcesOutput struct { - - // (Discontinued) The S3 resources whose classification types can't be updated. An - // error code and an error message are provided for each failed item. - FailedS3Resources []types.FailedS3Resource - - // Metadata pertaining to the operation's result. - ResultMetadata middleware.Metadata - - noSmithyDocumentSerde -} - -func (c *Client) addOperationUpdateS3ResourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { - if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { - return err - } - err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateS3Resources{}, middleware.After) - if err != nil { - return err - } - err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateS3Resources{}, middleware.After) - if err != nil { - return err - } - if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateS3Resources"); err != nil { - return fmt.Errorf("add protocol finalizers: %v", err) - } - - if err = addlegacyEndpointContextSetter(stack, options); err != nil { - return err - } - if err = addSetLoggerMiddleware(stack, options); err != nil { - return err - } - if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { - return err - } - if err = addResolveEndpointMiddleware(stack, options); err != nil { - return err - } - if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { - return err - } - if err = addRetryMiddlewares(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, options); err != nil { - return err - } - if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { - return err - } - if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { - return err - } - if err = addOpUpdateS3ResourcesValidationMiddleware(stack); err != nil { - return err - } - if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateS3Resources(options.Region), middleware.Before); err != nil { - return err - } - if err = awsmiddleware.AddRecursionDetection(stack); err != nil { - return err - } - if err = addRequestIDRetrieverMiddleware(stack); err != nil { - return err - } - if err = addResponseErrorMiddleware(stack); err != nil { - return err - } - if err = addRequestResponseLogging(stack, options); err != nil { - return err - } - if err = addDisableHTTPSMiddleware(stack, options); err != nil { - return err - } - return nil -} - -func newServiceMetadataMiddleware_opUpdateS3Resources(region string) *awsmiddleware.RegisterServiceMetadata { - return &awsmiddleware.RegisterServiceMetadata{ - Region: region, - ServiceID: ServiceID, - OperationName: "UpdateS3Resources", - } -} diff --git a/service/macie/auth.go b/service/macie/auth.go deleted file mode 100644 index d04d70bc402..00000000000 --- a/service/macie/auth.go +++ /dev/null @@ -1,256 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package macie - -import ( - "context" - "fmt" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - smithy "github.com/aws/smithy-go" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" -) - -func bindAuthParamsRegion(params *AuthResolverParameters, _ interface{}, options Options) { - params.Region = options.Region -} - -type setLegacyContextSigningOptionsMiddleware struct { -} - -func (*setLegacyContextSigningOptionsMiddleware) ID() string { - return "setLegacyContextSigningOptions" -} - -func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - rscheme := getResolvedAuthScheme(ctx) - schemeID := rscheme.Scheme.SchemeID() - - if sn := awsmiddleware.GetSigningName(ctx); sn != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) - } - } - - if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { - if schemeID == "aws.auth#sigv4" { - smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) - } else if schemeID == "aws.auth#sigv4a" { - smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) - } - } - - return next.HandleFinalize(ctx, in) -} - -func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { - return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) -} - -// AuthResolverParameters contains the set of inputs necessary for auth scheme -// resolution. -type AuthResolverParameters struct { - // The name of the operation being invoked. - Operation string - - // The region in which the operation is being invoked. - Region string -} - -func bindAuthResolverParams(operation string, input interface{}, options Options) *AuthResolverParameters { - params := &AuthResolverParameters{ - Operation: operation, - } - - bindAuthParamsRegion(params, input, options) - - return params -} - -// AuthSchemeResolver returns a set of possible authentication options for an -// operation. -type AuthSchemeResolver interface { - ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) -} - -type defaultAuthSchemeResolver struct{} - -var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) - -func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { - if overrides, ok := operationAuthOptions[params.Operation]; ok { - return overrides(params), nil - } - return serviceAuthOptions(params), nil -} - -var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} - -func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { - return []*smithyauth.Option{ - { - SchemeID: smithyauth.SchemeIDSigV4, - SignerProperties: func() smithy.Properties { - var props smithy.Properties - smithyhttp.SetSigV4SigningName(&props, "macie") - smithyhttp.SetSigV4SigningRegion(&props, params.Region) - return props - }(), - }, - } -} - -type resolveAuthSchemeMiddleware struct { - operation string - options Options -} - -func (*resolveAuthSchemeMiddleware) ID() string { - return "ResolveAuthScheme" -} - -func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - params := bindAuthResolverParams(m.operation, getOperationInput(ctx), m.options) - options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) - if err != nil { - return out, metadata, fmt.Errorf("resolve auth scheme: %v", err) - } - - scheme, ok := m.selectScheme(options) - if !ok { - return out, metadata, fmt.Errorf("could not select an auth scheme") - } - - ctx = setResolvedAuthScheme(ctx, scheme) - return next.HandleFinalize(ctx, in) -} - -func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { - for _, option := range options { - if option.SchemeID == smithyauth.SchemeIDAnonymous { - return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true - } - - for _, scheme := range m.options.AuthSchemes { - if scheme.SchemeID() != option.SchemeID { - continue - } - - if scheme.IdentityResolver(m.options) != nil { - return newResolvedAuthScheme(scheme, option), true - } - } - } - - return nil, false -} - -type resolvedAuthSchemeKey struct{} - -type resolvedAuthScheme struct { - Scheme smithyhttp.AuthScheme - IdentityProperties smithy.Properties - SignerProperties smithy.Properties -} - -func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { - return &resolvedAuthScheme{ - Scheme: scheme, - IdentityProperties: option.IdentityProperties, - SignerProperties: option.SignerProperties, - } -} - -func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { - return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) -} - -func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { - v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) - return v -} - -type getIdentityMiddleware struct { - options Options -} - -func (*getIdentityMiddleware) ID() string { - return "GetIdentity" -} - -func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - resolver := rscheme.Scheme.IdentityResolver(m.options) - if resolver == nil { - return out, metadata, fmt.Errorf("no identity resolver") - } - - identity, err := resolver.GetIdentity(ctx, rscheme.IdentityProperties) - if err != nil { - return out, metadata, fmt.Errorf("get identity: %v", err) - } - - ctx = setIdentity(ctx, identity) - return next.HandleFinalize(ctx, in) -} - -type identityKey struct{} - -func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { - return middleware.WithStackValue(ctx, identityKey{}, identity) -} - -func getIdentity(ctx context.Context) smithyauth.Identity { - v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) - return v -} - -type signRequestMiddleware struct { -} - -func (*signRequestMiddleware) ID() string { - return "Signing" -} - -func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - identity := getIdentity(ctx) - if identity == nil { - return out, metadata, fmt.Errorf("no identity") - } - - signer := rscheme.Scheme.Signer() - if signer == nil { - return out, metadata, fmt.Errorf("no signer") - } - - if err := signer.SignRequest(ctx, req, identity, rscheme.SignerProperties); err != nil { - return out, metadata, fmt.Errorf("sign request: %v", err) - } - - return next.HandleFinalize(ctx, in) -} diff --git a/service/macie/deserializers.go b/service/macie/deserializers.go deleted file mode 100644 index f6cfa13c281..00000000000 --- a/service/macie/deserializers.go +++ /dev/null @@ -1,1692 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package macie - -import ( - "bytes" - "context" - "encoding/json" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" - "github.com/aws/aws-sdk-go-v2/service/macie/types" - smithy "github.com/aws/smithy-go" - smithyio "github.com/aws/smithy-go/io" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/ptr" - smithyhttp "github.com/aws/smithy-go/transport/http" - "io" - "io/ioutil" - "strings" -) - -type awsAwsjson11_deserializeOpAssociateMemberAccount struct { -} - -func (*awsAwsjson11_deserializeOpAssociateMemberAccount) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpAssociateMemberAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - 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_deserializeOpErrorAssociateMemberAccount(response, &metadata) - } - output := &AssociateMemberAccountOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorAssociateMemberAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InternalException", errorCode): - return awsAwsjson11_deserializeErrorInternalException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpAssociateS3Resources struct { -} - -func (*awsAwsjson11_deserializeOpAssociateS3Resources) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpAssociateS3Resources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - 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_deserializeOpErrorAssociateS3Resources(response, &metadata) - } - output := &AssociateS3ResourcesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.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_deserializeOpDocumentAssociateS3ResourcesOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - 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_deserializeOpErrorAssociateS3Resources(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InternalException", errorCode): - return awsAwsjson11_deserializeErrorInternalException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDisassociateMemberAccount struct { -} - -func (*awsAwsjson11_deserializeOpDisassociateMemberAccount) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDisassociateMemberAccount) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - 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_deserializeOpErrorDisassociateMemberAccount(response, &metadata) - } - output := &DisassociateMemberAccountOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsAwsjson11_deserializeOpErrorDisassociateMemberAccount(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InternalException", errorCode): - return awsAwsjson11_deserializeErrorInternalException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpDisassociateS3Resources struct { -} - -func (*awsAwsjson11_deserializeOpDisassociateS3Resources) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpDisassociateS3Resources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - 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_deserializeOpErrorDisassociateS3Resources(response, &metadata) - } - output := &DisassociateS3ResourcesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.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_deserializeOpDocumentDisassociateS3ResourcesOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - 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_deserializeOpErrorDisassociateS3Resources(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InternalException", errorCode): - return awsAwsjson11_deserializeErrorInternalException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListMemberAccounts struct { -} - -func (*awsAwsjson11_deserializeOpListMemberAccounts) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListMemberAccounts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - 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_deserializeOpErrorListMemberAccounts(response, &metadata) - } - output := &ListMemberAccountsOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.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_deserializeOpDocumentListMemberAccountsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - 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_deserializeOpErrorListMemberAccounts(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InternalException", errorCode): - return awsAwsjson11_deserializeErrorInternalException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpListS3Resources struct { -} - -func (*awsAwsjson11_deserializeOpListS3Resources) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpListS3Resources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - 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_deserializeOpErrorListS3Resources(response, &metadata) - } - output := &ListS3ResourcesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.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_deserializeOpDocumentListS3ResourcesOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - 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_deserializeOpErrorListS3Resources(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InternalException", errorCode): - return awsAwsjson11_deserializeErrorInternalException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsAwsjson11_deserializeOpUpdateS3Resources struct { -} - -func (*awsAwsjson11_deserializeOpUpdateS3Resources) ID() string { - return "OperationDeserializer" -} - -func (m *awsAwsjson11_deserializeOpUpdateS3Resources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - 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_deserializeOpErrorUpdateS3Resources(response, &metadata) - } - output := &UpdateS3ResourcesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.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_deserializeOpDocumentUpdateS3ResourcesOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - 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_deserializeOpErrorUpdateS3Resources(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InternalException", errorCode): - return awsAwsjson11_deserializeErrorInternalException(response, errorBody) - - case strings.EqualFold("InvalidInputException", errorCode): - return awsAwsjson11_deserializeErrorInvalidInputException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsAwsjson11_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.AccessDeniedException{} - err := awsAwsjson11_deserializeDocumentAccessDeniedException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorInternalException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.InternalException{} - err := awsAwsjson11_deserializeDocumentInternalException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorInvalidInputException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.InvalidInputException{} - err := awsAwsjson11_deserializeDocumentInvalidInputException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - output := &types.LimitExceededException{} - err := awsAwsjson11_deserializeDocumentLimitExceededException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - return output -} - -func awsAwsjson11_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.AccessDeniedException - if *v == nil { - sv = &types.AccessDeniedException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "resourceType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) - } - sv.ResourceType = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentClassificationType(v **types.ClassificationType, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.ClassificationType - if *v == nil { - sv = &types.ClassificationType{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "continuous": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected S3ContinuousClassificationType to be of type string, got %T instead", value) - } - sv.Continuous = types.S3ContinuousClassificationType(jtv) - } - - case "oneTime": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected S3OneTimeClassificationType to be of type string, got %T instead", value) - } - sv.OneTime = types.S3OneTimeClassificationType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentFailedS3Resource(v **types.FailedS3Resource, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.FailedS3Resource - if *v == nil { - sv = &types.FailedS3Resource{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "errorCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) - } - sv.ErrorCode = ptr.String(jtv) - } - - case "errorMessage": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.ErrorMessage = ptr.String(jtv) - } - - case "failedItem": - if err := awsAwsjson11_deserializeDocumentS3Resource(&sv.FailedItem, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentFailedS3Resources(v *[]types.FailedS3Resource, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.FailedS3Resource - if *v == nil { - cv = []types.FailedS3Resource{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.FailedS3Resource - destAddr := &col - if err := awsAwsjson11_deserializeDocumentFailedS3Resource(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentInternalException(v **types.InternalException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InternalException - if *v == nil { - sv = &types.InternalException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "errorCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) - } - sv.ErrorCode_ = ptr.String(jtv) - } - - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentInvalidInputException(v **types.InvalidInputException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.InvalidInputException - if *v == nil { - sv = &types.InvalidInputException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "errorCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) - } - sv.ErrorCode_ = ptr.String(jtv) - } - - case "fieldName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FieldName to be of type string, got %T instead", value) - } - sv.FieldName = ptr.String(jtv) - } - - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.LimitExceededException - if *v == nil { - sv = &types.LimitExceededException{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "errorCode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) - } - sv.ErrorCode_ = ptr.String(jtv) - } - - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ExceptionMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "resourceType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) - } - sv.ResourceType = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentMemberAccount(v **types.MemberAccount, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.MemberAccount - if *v == nil { - sv = &types.MemberAccount{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "accountId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AWSAccountId to be of type string, got %T instead", value) - } - sv.AccountId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentMemberAccounts(v *[]types.MemberAccount, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.MemberAccount - if *v == nil { - cv = []types.MemberAccount{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.MemberAccount - destAddr := &col - if err := awsAwsjson11_deserializeDocumentMemberAccount(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentS3Resource(v **types.S3Resource, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.S3Resource - if *v == nil { - sv = &types.S3Resource{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "bucketName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected BucketName to be of type string, got %T instead", value) - } - sv.BucketName = ptr.String(jtv) - } - - case "prefix": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Prefix to be of type string, got %T instead", value) - } - sv.Prefix = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentS3ResourceClassification(v **types.S3ResourceClassification, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *types.S3ResourceClassification - if *v == nil { - sv = &types.S3ResourceClassification{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "bucketName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected BucketName to be of type string, got %T instead", value) - } - sv.BucketName = ptr.String(jtv) - } - - case "classificationType": - if err := awsAwsjson11_deserializeDocumentClassificationType(&sv.ClassificationType, value); err != nil { - return err - } - - case "prefix": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Prefix to be of type string, got %T instead", value) - } - sv.Prefix = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeDocumentS3ResourcesClassification(v *[]types.S3ResourceClassification, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.([]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var cv []types.S3ResourceClassification - if *v == nil { - cv = []types.S3ResourceClassification{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.S3ResourceClassification - destAddr := &col - if err := awsAwsjson11_deserializeDocumentS3ResourceClassification(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeOpDocumentAssociateS3ResourcesOutput(v **AssociateS3ResourcesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *AssociateS3ResourcesOutput - if *v == nil { - sv = &AssociateS3ResourcesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "failedS3Resources": - if err := awsAwsjson11_deserializeDocumentFailedS3Resources(&sv.FailedS3Resources, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentDisassociateS3ResourcesOutput(v **DisassociateS3ResourcesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DisassociateS3ResourcesOutput - if *v == nil { - sv = &DisassociateS3ResourcesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "failedS3Resources": - if err := awsAwsjson11_deserializeDocumentFailedS3Resources(&sv.FailedS3Resources, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListMemberAccountsOutput(v **ListMemberAccountsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListMemberAccountsOutput - if *v == nil { - sv = &ListMemberAccountsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "memberAccounts": - if err := awsAwsjson11_deserializeDocumentMemberAccounts(&sv.MemberAccounts, 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_deserializeOpDocumentListS3ResourcesOutput(v **ListS3ResourcesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListS3ResourcesOutput - if *v == nil { - sv = &ListS3ResourcesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "s3Resources": - if err := awsAwsjson11_deserializeDocumentS3ResourcesClassification(&sv.S3Resources, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentUpdateS3ResourcesOutput(v **UpdateS3ResourcesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateS3ResourcesOutput - if *v == nil { - sv = &UpdateS3ResourcesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "failedS3Resources": - if err := awsAwsjson11_deserializeDocumentFailedS3Resources(&sv.FailedS3Resources, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} diff --git a/service/macie/doc.go b/service/macie/doc.go deleted file mode 100644 index 7a233c38bf5..00000000000 --- a/service/macie/doc.go +++ /dev/null @@ -1,14 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -// Package macie provides the API client, operations, and parameter types for -// Amazon Macie. -// -// Amazon Macie Classic Amazon Macie Classic has been discontinued and is no -// longer available. A new Amazon Macie is now available with significant design -// improvements and additional features, at a lower price and in most Amazon Web -// Services Regions. We encourage you to take advantage of the new and improved -// features, and benefit from the reduced cost. To learn about features and pricing -// for the new Macie, see Amazon Macie (http://aws.amazon.com/macie/) . To learn -// how to use the new Macie, see the Amazon Macie User Guide (https://docs.aws.amazon.com/macie/latest/user/what-is-macie.html) -// . -package macie diff --git a/service/macie/endpoints.go b/service/macie/endpoints.go deleted file mode 100644 index 7161a5b2fd3..00000000000 --- a/service/macie/endpoints.go +++ /dev/null @@ -1,509 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package macie - -import ( - "context" - "errors" - "fmt" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" - "github.com/aws/aws-sdk-go-v2/internal/endpoints" - "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" - internalendpoints "github.com/aws/aws-sdk-go-v2/service/macie/internal/endpoints" - smithyauth "github.com/aws/smithy-go/auth" - smithyendpoints "github.com/aws/smithy-go/endpoints" - "github.com/aws/smithy-go/middleware" - "github.com/aws/smithy-go/ptr" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" - "net/url" - "os" - "strings" -) - -// EndpointResolverOptions is the service endpoint resolver options -type EndpointResolverOptions = internalendpoints.Options - -// EndpointResolver interface for resolving service endpoints. -type EndpointResolver interface { - ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) -} - -var _ EndpointResolver = &internalendpoints.Resolver{} - -// NewDefaultEndpointResolver constructs a new service endpoint resolver -func NewDefaultEndpointResolver() *internalendpoints.Resolver { - return internalendpoints.New() -} - -// EndpointResolverFunc is a helper utility that wraps a function so it satisfies -// the EndpointResolver interface. This is useful when you want to add additional -// endpoint resolving logic, or stub out specific endpoints with custom values. -type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) - -func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return fn(region, options) -} - -// EndpointResolverFromURL returns an EndpointResolver configured using the -// provided endpoint url. By default, the resolved endpoint resolver uses the -// client region as signing region, and the endpoint source is set to -// EndpointSourceCustom.You can provide functional options to configure endpoint -// values for the resolved endpoint. -func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { - e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} - for _, fn := range optFns { - fn(&e) - } - - return EndpointResolverFunc( - func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { - if len(e.SigningRegion) == 0 { - e.SigningRegion = region - } - return e, nil - }, - ) -} - -type ResolveEndpoint struct { - Resolver EndpointResolver - Options EndpointResolverOptions -} - -func (*ResolveEndpoint) ID() string { - return "ResolveEndpoint" -} - -func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleSerialize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.Resolver == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - eo := m.Options - eo.Logger = middleware.GetLogger(ctx) - - var endpoint aws.Endpoint - endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) - if err != nil { - nf := (&aws.EndpointNotFoundError{}) - if errors.As(err, &nf) { - ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) - return next.HandleSerialize(ctx, in) - } - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - req.URL, err = url.Parse(endpoint.URL) - if err != nil { - return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) - } - - if len(awsmiddleware.GetSigningName(ctx)) == 0 { - signingName := endpoint.SigningName - if len(signingName) == 0 { - signingName = "macie" - } - ctx = awsmiddleware.SetSigningName(ctx, signingName) - } - ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) - ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) - ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) - ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) - return next.HandleSerialize(ctx, in) -} -func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { - return stack.Serialize.Insert(&ResolveEndpoint{ - Resolver: o.EndpointResolver, - Options: o.EndpointOptions, - }, "OperationSerializer", middleware.Before) -} - -func removeResolveEndpointMiddleware(stack *middleware.Stack) error { - _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) - return err -} - -type wrappedEndpointResolver struct { - awsResolver aws.EndpointResolverWithOptions -} - -func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { - return w.awsResolver.ResolveEndpoint(ServiceID, region, options) -} - -type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) - -func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { - return a(service, region) -} - -var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) - -// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. -// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, -// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked -// via its middleware. -// -// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. -func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { - var resolver aws.EndpointResolverWithOptions - - if awsResolverWithOptions != nil { - resolver = awsResolverWithOptions - } else if awsResolver != nil { - resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) - } - - return &wrappedEndpointResolver{ - awsResolver: resolver, - } -} - -func finalizeClientEndpointResolverOptions(options *Options) { - options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() - - if len(options.EndpointOptions.ResolvedRegion) == 0 { - const fipsInfix = "-fips-" - const fipsPrefix = "fips-" - const fipsSuffix = "-fips" - - if strings.Contains(options.Region, fipsInfix) || - strings.Contains(options.Region, fipsPrefix) || - strings.Contains(options.Region, fipsSuffix) { - options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( - options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") - options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled - } - } - -} - -func resolveEndpointResolverV2(options *Options) { - if options.EndpointResolverV2 == nil { - options.EndpointResolverV2 = NewDefaultEndpointResolverV2() - } -} - -func resolveBaseEndpoint(cfg aws.Config, o *Options) { - if cfg.BaseEndpoint != nil { - o.BaseEndpoint = cfg.BaseEndpoint - } - - _, g := os.LookupEnv("AWS_ENDPOINT_URL") - _, s := os.LookupEnv("AWS_ENDPOINT_URL_MACIE") - - if g && !s { - return - } - - value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "Macie", cfg.ConfigSources) - if found && err == nil { - o.BaseEndpoint = &value - } -} - -// EndpointParameters provides the parameters that influence how endpoints are -// resolved. -type EndpointParameters struct { - // The AWS region used to dispatch the request. - // - // Parameter is - // required. - // - // AWS::Region - Region *string - - // When true, use the dual-stack endpoint. If the configured endpoint does not - // support dual-stack, dispatching the request MAY return an error. - // - // Defaults to - // false if no value is provided. - // - // AWS::UseDualStack - UseDualStack *bool - - // When true, send this request to the FIPS-compliant regional endpoint. If the - // configured endpoint does not have a FIPS compliant endpoint, dispatching the - // request will return an error. - // - // Defaults to false if no value is - // provided. - // - // AWS::UseFIPS - UseFIPS *bool - - // Override the endpoint used to send this request - // - // Parameter is - // required. - // - // SDK::Endpoint - Endpoint *string -} - -// ValidateRequired validates required parameters are set. -func (p EndpointParameters) ValidateRequired() error { - if p.UseDualStack == nil { - return fmt.Errorf("parameter UseDualStack is required") - } - - if p.UseFIPS == nil { - return fmt.Errorf("parameter UseFIPS is required") - } - - return nil -} - -// WithDefaults returns a shallow copy of EndpointParameterswith default values -// applied to members where applicable. -func (p EndpointParameters) WithDefaults() EndpointParameters { - if p.UseDualStack == nil { - p.UseDualStack = ptr.Bool(false) - } - - if p.UseFIPS == nil { - p.UseFIPS = ptr.Bool(false) - } - return p -} - -// EndpointResolverV2 provides the interface for resolving service endpoints. -type EndpointResolverV2 interface { - // ResolveEndpoint attempts to resolve the endpoint with the provided options, - // returning the endpoint if found. Otherwise an error is returned. - ResolveEndpoint(ctx context.Context, params EndpointParameters) ( - smithyendpoints.Endpoint, error, - ) -} - -// resolver provides the implementation for resolving endpoints. -type resolver struct{} - -func NewDefaultEndpointResolverV2() EndpointResolverV2 { - return &resolver{} -} - -// ResolveEndpoint attempts to resolve the endpoint with the provided options, -// returning the endpoint if found. Otherwise an error is returned. -func (r *resolver) ResolveEndpoint( - ctx context.Context, params EndpointParameters, -) ( - endpoint smithyendpoints.Endpoint, err error, -) { - params = params.WithDefaults() - if err = params.ValidateRequired(); err != nil { - return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) - } - _UseDualStack := *params.UseDualStack - _UseFIPS := *params.UseFIPS - - if exprVal := params.Endpoint; exprVal != nil { - _Endpoint := *exprVal - _ = _Endpoint - if _UseFIPS == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") - } - if _UseDualStack == true { - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Dualstack and custom endpoint are not supported") - } - uriString := _Endpoint - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - if exprVal := params.Region; exprVal != nil { - _Region := *exprVal - _ = _Region - if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { - _PartitionResult := *exprVal - _ = _PartitionResult - if _UseFIPS == true { - if _UseDualStack == true { - if true == _PartitionResult.SupportsFIPS { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://macie-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS and DualStack are enabled, but this partition does not support one or both") - } - } - if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { - uriString := func() string { - var out strings.Builder - out.WriteString("https://macie-fips.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "FIPS is enabled but this partition does not support FIPS") - } - if _UseDualStack == true { - if true == _PartitionResult.SupportsDualStack { - uriString := func() string { - var out strings.Builder - out.WriteString("https://macie.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DualStackDnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "DualStack is enabled but this partition does not support DualStack") - } - uriString := func() string { - var out strings.Builder - out.WriteString("https://macie.") - out.WriteString(_Region) - out.WriteString(".") - out.WriteString(_PartitionResult.DnsSuffix) - return out.String() - }() - - uri, err := url.Parse(uriString) - if err != nil { - return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) - } - - return smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - }, nil - } - return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") - } - return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") -} - -type endpointParamsBinder interface { - bindEndpointParams(*EndpointParameters) -} - -func bindEndpointParams(input interface{}, options Options) *EndpointParameters { - params := &EndpointParameters{} - - params.Region = aws.String(endpoints.MapFIPSRegion(options.Region)) - params.UseDualStack = aws.Bool(options.EndpointOptions.UseDualStackEndpoint == aws.DualStackEndpointStateEnabled) - params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) - params.Endpoint = options.BaseEndpoint - - if b, ok := input.(endpointParamsBinder); ok { - b.bindEndpointParams(params) - } - - return params -} - -type resolveEndpointV2Middleware struct { - options Options -} - -func (*resolveEndpointV2Middleware) ID() string { - return "ResolveEndpointV2" -} - -func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( - out middleware.FinalizeOutput, metadata middleware.Metadata, err error, -) { - if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { - return next.HandleFinalize(ctx, in) - } - - req, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) - } - - if m.options.EndpointResolverV2 == nil { - return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") - } - - params := bindEndpointParams(getOperationInput(ctx), m.options) - endpt, err := m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) - if err != nil { - return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) - } - - if endpt.URI.RawPath == "" && req.URL.RawPath != "" { - endpt.URI.RawPath = endpt.URI.Path - } - req.URL.Scheme = endpt.URI.Scheme - req.URL.Host = endpt.URI.Host - req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) - req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) - for k := range endpt.Headers { - req.Header.Set(k, endpt.Headers.Get(k)) - } - - rscheme := getResolvedAuthScheme(ctx) - if rscheme == nil { - return out, metadata, fmt.Errorf("no resolved auth scheme") - } - - opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) - for _, o := range opts { - rscheme.SignerProperties.SetAll(&o.SignerProperties) - } - - return next.HandleFinalize(ctx, in) -} diff --git a/service/macie/endpoints_config_test.go b/service/macie/endpoints_config_test.go deleted file mode 100644 index 819eb8b0f2c..00000000000 --- a/service/macie/endpoints_config_test.go +++ /dev/null @@ -1,139 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package macie - -import ( - "context" - "github.com/aws/aws-sdk-go-v2/aws" - "os" - "reflect" - "testing" -) - -type mockConfigSource struct { - global string - service string - ignore bool -} - -// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured -// endpoints feature. -func (m mockConfigSource) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { - return m.ignore, m.ignore, nil -} - -// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use -// with configured endpoints. -func (m mockConfigSource) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { - if m.service != "" { - return m.service, true, nil - } - return "", false, nil -} - -func TestResolveBaseEndpoint(t *testing.T) { - cases := map[string]struct { - envGlobal string - envService string - envIgnore bool - configGlobal string - configService string - configIgnore bool - clientEndpoint *string - expectURL *string - }{ - "env ignore": { - envGlobal: "https://env-global.dev", - envService: "https://env-macie.dev", - envIgnore: true, - configGlobal: "http://config-global.dev", - configService: "http://config-macie.dev", - expectURL: nil, - }, - "env global": { - envGlobal: "https://env-global.dev", - configGlobal: "http://config-global.dev", - configService: "http://config-macie.dev", - expectURL: aws.String("https://env-global.dev"), - }, - "env service": { - envGlobal: "https://env-global.dev", - envService: "https://env-macie.dev", - configGlobal: "http://config-global.dev", - configService: "http://config-macie.dev", - expectURL: aws.String("https://env-macie.dev"), - }, - "config ignore": { - envGlobal: "https://env-global.dev", - envService: "https://env-macie.dev", - configGlobal: "http://config-global.dev", - configService: "http://config-macie.dev", - configIgnore: true, - expectURL: nil, - }, - "config global": { - configGlobal: "http://config-global.dev", - expectURL: aws.String("http://config-global.dev"), - }, - "config service": { - configGlobal: "http://config-global.dev", - configService: "http://config-macie.dev", - expectURL: aws.String("http://config-macie.dev"), - }, - "client": { - envGlobal: "https://env-global.dev", - envService: "https://env-macie.dev", - configGlobal: "http://config-global.dev", - configService: "http://config-macie.dev", - clientEndpoint: aws.String("https://client-macie.dev"), - expectURL: aws.String("https://client-macie.dev"), - }, - } - - for name, c := range cases { - t.Run(name, func(t *testing.T) { - os.Clearenv() - - awsConfig := aws.Config{} - ignore := c.envIgnore || c.configIgnore - - if c.configGlobal != "" && !ignore { - awsConfig.BaseEndpoint = aws.String(c.configGlobal) - } - - if c.envGlobal != "" { - t.Setenv("AWS_ENDPOINT_URL", c.envGlobal) - if !ignore { - awsConfig.BaseEndpoint = aws.String(c.envGlobal) - } - } - - if c.envService != "" { - t.Setenv("AWS_ENDPOINT_URL_MACIE", c.envService) - } - - awsConfig.ConfigSources = []interface{}{ - mockConfigSource{ - global: c.envGlobal, - service: c.envService, - ignore: c.envIgnore, - }, - mockConfigSource{ - global: c.configGlobal, - service: c.configService, - ignore: c.configIgnore, - }, - } - - client := NewFromConfig(awsConfig, func(o *Options) { - if c.clientEndpoint != nil { - o.BaseEndpoint = c.clientEndpoint - } - }) - - if e, a := c.expectURL, client.options.BaseEndpoint; !reflect.DeepEqual(e, a) { - t.Errorf("expect endpoint %v , got %v", e, a) - } - }) - } -} diff --git a/service/macie/endpoints_test.go b/service/macie/endpoints_test.go deleted file mode 100644 index 62143d6d63c..00000000000 --- a/service/macie/endpoints_test.go +++ /dev/null @@ -1,934 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package macie - -import ( - "context" - smithy "github.com/aws/smithy-go" - smithyendpoints "github.com/aws/smithy-go/endpoints" - "github.com/aws/smithy-go/ptr" - "github.com/google/go-cmp/cmp" - "net/http" - "net/url" - "strings" - "testing" -) - -// For region us-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase0(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://macie.us-east-1.amazonaws.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { - t.Errorf("expect headers to match\n%s", diff) - } - - if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, - cmp.AllowUnexported(smithy.Properties{}), - ); diff != "" { - t.Errorf("expect properties to match\n%s", diff) - } -} - -// For region us-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase1(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://macie-fips.us-east-1.amazonaws.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { - t.Errorf("expect headers to match\n%s", diff) - } - - if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, - cmp.AllowUnexported(smithy.Properties{}), - ); diff != "" { - t.Errorf("expect properties to match\n%s", diff) - } -} - -// For region us-west-2 with FIPS disabled and DualStack disabled -func TestEndpointCase2(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-west-2"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://macie.us-west-2.amazonaws.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { - t.Errorf("expect headers to match\n%s", diff) - } - - if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, - cmp.AllowUnexported(smithy.Properties{}), - ); diff != "" { - t.Errorf("expect properties to match\n%s", diff) - } -} - -// For region us-west-2 with FIPS enabled and DualStack disabled -func TestEndpointCase3(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-west-2"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://macie-fips.us-west-2.amazonaws.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { - t.Errorf("expect headers to match\n%s", diff) - } - - if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, - cmp.AllowUnexported(smithy.Properties{}), - ); diff != "" { - t.Errorf("expect properties to match\n%s", diff) - } -} - -// For region us-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase4(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://macie-fips.us-east-1.api.aws") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { - t.Errorf("expect headers to match\n%s", diff) - } - - if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, - cmp.AllowUnexported(smithy.Properties{}), - ); diff != "" { - t.Errorf("expect properties to match\n%s", diff) - } -} - -// For region us-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase5(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://macie.us-east-1.api.aws") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { - t.Errorf("expect headers to match\n%s", diff) - } - - if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, - cmp.AllowUnexported(smithy.Properties{}), - ); diff != "" { - t.Errorf("expect properties to match\n%s", diff) - } -} - -// For region cn-north-1 with FIPS enabled and DualStack enabled -func TestEndpointCase6(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://macie-fips.cn-north-1.api.amazonwebservices.com.cn") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { - t.Errorf("expect headers to match\n%s", diff) - } - - if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, - cmp.AllowUnexported(smithy.Properties{}), - ); diff != "" { - t.Errorf("expect properties to match\n%s", diff) - } -} - -// For region cn-north-1 with FIPS enabled and DualStack disabled -func TestEndpointCase7(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://macie-fips.cn-north-1.amazonaws.com.cn") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { - t.Errorf("expect headers to match\n%s", diff) - } - - if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, - cmp.AllowUnexported(smithy.Properties{}), - ); diff != "" { - t.Errorf("expect properties to match\n%s", diff) - } -} - -// For region cn-north-1 with FIPS disabled and DualStack enabled -func TestEndpointCase8(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://macie.cn-north-1.api.amazonwebservices.com.cn") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { - t.Errorf("expect headers to match\n%s", diff) - } - - if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, - cmp.AllowUnexported(smithy.Properties{}), - ); diff != "" { - t.Errorf("expect properties to match\n%s", diff) - } -} - -// For region cn-north-1 with FIPS disabled and DualStack disabled -func TestEndpointCase9(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("cn-north-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://macie.cn-north-1.amazonaws.com.cn") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { - t.Errorf("expect headers to match\n%s", diff) - } - - if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, - cmp.AllowUnexported(smithy.Properties{}), - ); diff != "" { - t.Errorf("expect properties to match\n%s", diff) - } -} - -// For region us-gov-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase10(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://macie-fips.us-gov-east-1.api.aws") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { - t.Errorf("expect headers to match\n%s", diff) - } - - if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, - cmp.AllowUnexported(smithy.Properties{}), - ); diff != "" { - t.Errorf("expect properties to match\n%s", diff) - } -} - -// For region us-gov-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase11(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://macie-fips.us-gov-east-1.amazonaws.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { - t.Errorf("expect headers to match\n%s", diff) - } - - if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, - cmp.AllowUnexported(smithy.Properties{}), - ); diff != "" { - t.Errorf("expect properties to match\n%s", diff) - } -} - -// For region us-gov-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase12(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://macie.us-gov-east-1.api.aws") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { - t.Errorf("expect headers to match\n%s", diff) - } - - if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, - cmp.AllowUnexported(smithy.Properties{}), - ); diff != "" { - t.Errorf("expect properties to match\n%s", diff) - } -} - -// For region us-gov-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase13(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-gov-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://macie.us-gov-east-1.amazonaws.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { - t.Errorf("expect headers to match\n%s", diff) - } - - if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, - cmp.AllowUnexported(smithy.Properties{}), - ); diff != "" { - t.Errorf("expect properties to match\n%s", diff) - } -} - -// For region us-iso-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase14(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-iso-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For region us-iso-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase15(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-iso-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://macie-fips.us-iso-east-1.c2s.ic.gov") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { - t.Errorf("expect headers to match\n%s", diff) - } - - if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, - cmp.AllowUnexported(smithy.Properties{}), - ); diff != "" { - t.Errorf("expect properties to match\n%s", diff) - } -} - -// For region us-iso-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase16(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-iso-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For region us-iso-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase17(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-iso-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://macie.us-iso-east-1.c2s.ic.gov") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { - t.Errorf("expect headers to match\n%s", diff) - } - - if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, - cmp.AllowUnexported(smithy.Properties{}), - ); diff != "" { - t.Errorf("expect properties to match\n%s", diff) - } -} - -// For region us-isob-east-1 with FIPS enabled and DualStack enabled -func TestEndpointCase18(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-isob-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "FIPS and DualStack are enabled, but this partition does not support one or both", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For region us-isob-east-1 with FIPS enabled and DualStack disabled -func TestEndpointCase19(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-isob-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://macie-fips.us-isob-east-1.sc2s.sgov.gov") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { - t.Errorf("expect headers to match\n%s", diff) - } - - if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, - cmp.AllowUnexported(smithy.Properties{}), - ); diff != "" { - t.Errorf("expect properties to match\n%s", diff) - } -} - -// For region us-isob-east-1 with FIPS disabled and DualStack enabled -func TestEndpointCase20(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-isob-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "DualStack is enabled but this partition does not support DualStack", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For region us-isob-east-1 with FIPS disabled and DualStack disabled -func TestEndpointCase21(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-isob-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://macie.us-isob-east-1.sc2s.sgov.gov") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { - t.Errorf("expect headers to match\n%s", diff) - } - - if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, - cmp.AllowUnexported(smithy.Properties{}), - ); diff != "" { - t.Errorf("expect properties to match\n%s", diff) - } -} - -// For custom endpoint with region set and fips disabled and dualstack disabled -func TestEndpointCase22(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - Endpoint: ptr.String("https://example.com"), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://example.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { - t.Errorf("expect headers to match\n%s", diff) - } - - if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, - cmp.AllowUnexported(smithy.Properties{}), - ); diff != "" { - t.Errorf("expect properties to match\n%s", diff) - } -} - -// For custom endpoint with region not set and fips disabled and dualstack disabled -func TestEndpointCase23(t *testing.T) { - var params = EndpointParameters{ - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(false), - Endpoint: ptr.String("https://example.com"), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err != nil { - t.Fatalf("expect no error, got %v", err) - } - - uri, _ := url.Parse("https://example.com") - - expectEndpoint := smithyendpoints.Endpoint{ - URI: *uri, - Headers: http.Header{}, - Properties: smithy.Properties{}, - } - - if e, a := expectEndpoint.URI, result.URI; e != a { - t.Errorf("expect %v URI, got %v", e, a) - } - - if diff := cmp.Diff(expectEndpoint.Headers, result.Headers); diff != "" { - t.Errorf("expect headers to match\n%s", diff) - } - - if diff := cmp.Diff(expectEndpoint.Properties, result.Properties, - cmp.AllowUnexported(smithy.Properties{}), - ); diff != "" { - t.Errorf("expect properties to match\n%s", diff) - } -} - -// For custom endpoint with fips enabled and dualstack disabled -func TestEndpointCase24(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(true), - UseDualStack: ptr.Bool(false), - Endpoint: ptr.String("https://example.com"), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "Invalid Configuration: FIPS and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// For custom endpoint with fips disabled and dualstack enabled -func TestEndpointCase25(t *testing.T) { - var params = EndpointParameters{ - Region: ptr.String("us-east-1"), - UseFIPS: ptr.Bool(false), - UseDualStack: ptr.Bool(true), - Endpoint: ptr.String("https://example.com"), - } - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "Invalid Configuration: Dualstack and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} - -// Missing region -func TestEndpointCase26(t *testing.T) { - var params = EndpointParameters{} - - resolver := NewDefaultEndpointResolverV2() - result, err := resolver.ResolveEndpoint(context.Background(), params) - _, _ = result, err - - if err == nil { - t.Fatalf("expect error, got none") - } - if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { - t.Errorf("expect %v error in %v", e, a) - } -} diff --git a/service/macie/generated.json b/service/macie/generated.json deleted file mode 100644 index 3d361466fb7..00000000000 --- a/service/macie/generated.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "dependencies": { - "github.com/aws/aws-sdk-go-v2": "v1.4.0", - "github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000", - "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000", - "github.com/aws/smithy-go": "v1.4.0", - "github.com/google/go-cmp": "v0.5.4" - }, - "files": [ - "api_client.go", - "api_client_test.go", - "api_op_AssociateMemberAccount.go", - "api_op_AssociateS3Resources.go", - "api_op_DisassociateMemberAccount.go", - "api_op_DisassociateS3Resources.go", - "api_op_ListMemberAccounts.go", - "api_op_ListS3Resources.go", - "api_op_UpdateS3Resources.go", - "auth.go", - "deserializers.go", - "doc.go", - "endpoints.go", - "endpoints_config_test.go", - "endpoints_test.go", - "generated.json", - "internal/endpoints/endpoints.go", - "internal/endpoints/endpoints_test.go", - "options.go", - "protocol_test.go", - "serializers.go", - "types/enums.go", - "types/errors.go", - "types/types.go", - "validators.go" - ], - "go": "1.15", - "module": "github.com/aws/aws-sdk-go-v2/service/macie", - "unstable": false -} diff --git a/service/macie/go.mod b/service/macie/go.mod deleted file mode 100644 index efd9a4569df..00000000000 --- a/service/macie/go.mod +++ /dev/null @@ -1,17 +0,0 @@ -module github.com/aws/aws-sdk-go-v2/service/macie - -go 1.19 - -require ( - github.com/aws/aws-sdk-go-v2 v1.23.0 - github.com/aws/aws-sdk-go-v2/internal/configsources v1.2.3 - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.5.3 - github.com/aws/smithy-go v1.17.0 - github.com/google/go-cmp v0.5.8 -) - -replace github.com/aws/aws-sdk-go-v2 => ../../ - -replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ - -replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/macie/go.sum b/service/macie/go.sum deleted file mode 100644 index 42e4fc806b4..00000000000 --- a/service/macie/go.sum +++ /dev/null @@ -1,4 +0,0 @@ -github.com/aws/smithy-go v1.17.0 h1:wWJD7LX6PBV6etBUwO0zElG0nWN9rUhp0WdYeHSHAaI= -github.com/aws/smithy-go v1.17.0/go.mod h1:NukqUGpCZIILqqiV0NIjeFh24kd/FAa4beRb6nbIUPE= -github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= -github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= diff --git a/service/macie/go_module_metadata.go b/service/macie/go_module_metadata.go deleted file mode 100644 index 91ae08d330a..00000000000 --- a/service/macie/go_module_metadata.go +++ /dev/null @@ -1,6 +0,0 @@ -// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. - -package macie - -// goModuleVersion is the tagged release for this module -const goModuleVersion = "1.19.2" diff --git a/service/macie/internal/endpoints/endpoints.go b/service/macie/internal/endpoints/endpoints.go deleted file mode 100644 index a9dcff28dae..00000000000 --- a/service/macie/internal/endpoints/endpoints.go +++ /dev/null @@ -1,334 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package endpoints - -import ( - "github.com/aws/aws-sdk-go-v2/aws" - endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" - "github.com/aws/smithy-go/logging" - "regexp" -) - -// Options is the endpoint resolver configuration options -type Options struct { - // Logger is a logging implementation that log events should be sent to. - Logger logging.Logger - - // LogDeprecated indicates that deprecated endpoints should be logged to the - // provided logger. - LogDeprecated bool - - // ResolvedRegion is used to override the region to be resolved, rather then the - // using the value passed to the ResolveEndpoint method. This value is used by the - // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative - // name. You must not set this value directly in your application. - ResolvedRegion string - - // DisableHTTPS informs the resolver to return an endpoint that does not use the - // HTTPS scheme. - DisableHTTPS bool - - // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. - UseDualStackEndpoint aws.DualStackEndpointState - - // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. - UseFIPSEndpoint aws.FIPSEndpointState -} - -func (o Options) GetResolvedRegion() string { - return o.ResolvedRegion -} - -func (o Options) GetDisableHTTPS() bool { - return o.DisableHTTPS -} - -func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { - return o.UseDualStackEndpoint -} - -func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { - return o.UseFIPSEndpoint -} - -func transformToSharedOptions(options Options) endpoints.Options { - return endpoints.Options{ - Logger: options.Logger, - LogDeprecated: options.LogDeprecated, - ResolvedRegion: options.ResolvedRegion, - DisableHTTPS: options.DisableHTTPS, - UseDualStackEndpoint: options.UseDualStackEndpoint, - UseFIPSEndpoint: options.UseFIPSEndpoint, - } -} - -// Resolver Macie endpoint resolver -type Resolver struct { - partitions endpoints.Partitions -} - -// ResolveEndpoint resolves the service endpoint for the given region and options -func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { - if len(region) == 0 { - return endpoint, &aws.MissingRegionError{} - } - - opt := transformToSharedOptions(options) - return r.partitions.ResolveEndpoint(region, opt) -} - -// New returns a new Resolver -func New() *Resolver { - return &Resolver{ - partitions: defaultPartitions, - } -} - -var partitionRegexp = struct { - Aws *regexp.Regexp - AwsCn *regexp.Regexp - AwsIso *regexp.Regexp - AwsIsoB *regexp.Regexp - AwsIsoE *regexp.Regexp - AwsIsoF *regexp.Regexp - AwsUsGov *regexp.Regexp -}{ - - Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il)\\-\\w+\\-\\d+$"), - AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), - AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), - AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), - AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), - AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), - AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), -} - -var defaultPartitions = endpoints.Partitions{ - { - ID: "aws", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "macie.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "macie-fips.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "macie-fips.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "macie.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.Aws, - IsRegionalized: true, - Endpoints: endpoints.Endpoints{ - endpoints.EndpointKey{ - Region: "fips-us-east-1", - }: endpoints.Endpoint{ - Hostname: "macie-fips.us-east-1.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-east-1", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "fips-us-west-2", - }: endpoints.Endpoint{ - Hostname: "macie-fips.us-west-2.amazonaws.com", - CredentialScope: endpoints.CredentialScope{ - Region: "us-west-2", - }, - Deprecated: aws.TrueTernary, - }, - endpoints.EndpointKey{ - Region: "us-east-1", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-east-1", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "macie-fips.us-east-1.amazonaws.com", - }, - endpoints.EndpointKey{ - Region: "us-west-2", - }: endpoints.Endpoint{}, - endpoints.EndpointKey{ - Region: "us-west-2", - Variant: endpoints.FIPSVariant, - }: { - Hostname: "macie-fips.us-west-2.amazonaws.com", - }, - }, - }, - { - ID: "aws-cn", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "macie.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "macie-fips.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "macie-fips.{region}.api.amazonwebservices.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "macie.{region}.amazonaws.com.cn", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsCn, - IsRegionalized: true, - }, - { - ID: "aws-iso", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "macie-fips.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "macie.{region}.c2s.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIso, - IsRegionalized: true, - }, - { - ID: "aws-iso-b", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "macie-fips.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "macie.{region}.sc2s.sgov.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoB, - IsRegionalized: true, - }, - { - ID: "aws-iso-e", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "macie-fips.{region}.cloud.adc-e.uk", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "macie.{region}.cloud.adc-e.uk", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoE, - IsRegionalized: true, - }, - { - ID: "aws-iso-f", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "macie-fips.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "macie.{region}.csp.hci.ic.gov", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsIsoF, - IsRegionalized: true, - }, - { - ID: "aws-us-gov", - Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ - { - Variant: endpoints.DualStackVariant, - }: { - Hostname: "macie.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant, - }: { - Hostname: "macie-fips.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, - }: { - Hostname: "macie-fips.{region}.api.aws", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - { - Variant: 0, - }: { - Hostname: "macie.{region}.amazonaws.com", - Protocols: []string{"https"}, - SignatureVersions: []string{"v4"}, - }, - }, - RegionRegex: partitionRegexp.AwsUsGov, - IsRegionalized: true, - }, -} diff --git a/service/macie/internal/endpoints/endpoints_test.go b/service/macie/internal/endpoints/endpoints_test.go deleted file mode 100644 index 08e5da2d833..00000000000 --- a/service/macie/internal/endpoints/endpoints_test.go +++ /dev/null @@ -1,11 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package endpoints - -import ( - "testing" -) - -func TestRegexCompile(t *testing.T) { - _ = defaultPartitions -} diff --git a/service/macie/options.go b/service/macie/options.go deleted file mode 100644 index 15584502ac4..00000000000 --- a/service/macie/options.go +++ /dev/null @@ -1,219 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package macie - -import ( - "context" - "github.com/aws/aws-sdk-go-v2/aws" - awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" - internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" - smithyauth "github.com/aws/smithy-go/auth" - "github.com/aws/smithy-go/logging" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "net/http" -) - -type HTTPClient interface { - Do(*http.Request) (*http.Response, error) -} - -type Options struct { - // Set of options to modify how an operation is invoked. These apply to all - // operations invoked for this client. Use functional options on operation call to - // modify this list for per operation behavior. - APIOptions []func(*middleware.Stack) error - - // The optional application specific identifier appended to the User-Agent header. - AppID string - - // This endpoint will be given as input to an EndpointResolverV2. It is used for - // providing a custom base endpoint that is subject to modifications by the - // processing EndpointResolverV2. - BaseEndpoint *string - - // Configures the events that will be sent to the configured logger. - ClientLogMode aws.ClientLogMode - - // The credentials object to use when signing requests. - Credentials aws.CredentialsProvider - - // The configuration DefaultsMode that the SDK should use when constructing the - // clients initial default settings. - DefaultsMode aws.DefaultsMode - - // The endpoint options to be used when attempting to resolve an endpoint. - EndpointOptions EndpointResolverOptions - - // The service endpoint resolver. - // - // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a - // value for this field will likely prevent you from using any endpoint-related - // service features released after the introduction of EndpointResolverV2 and - // BaseEndpoint. To migrate an EndpointResolver implementation that uses a custom - // endpoint, set the client option BaseEndpoint instead. - EndpointResolver EndpointResolver - - // Resolves the endpoint used for a particular service operation. This should be - // used over the deprecated EndpointResolver. - EndpointResolverV2 EndpointResolverV2 - - // Signature Version 4 (SigV4) Signer - HTTPSignerV4 HTTPSignerV4 - - // The logger writer interface to write logging messages to. - Logger logging.Logger - - // The region to send requests to. (Required) - Region string - - // RetryMaxAttempts specifies the maximum number attempts an API client will call - // an operation that fails with a retryable error. A value of 0 is ignored, and - // will not be used to configure the API client created default retryer, or modify - // per operation call's retry max attempts. When creating a new API Clients this - // member will only be used if the Retryer Options member is nil. This value will - // be ignored if Retryer is not nil. If specified in an operation call's functional - // options with a value that is different than the constructed client's Options, - // the Client's Retryer will be wrapped to use the operation's specific - // RetryMaxAttempts value. - RetryMaxAttempts int - - // RetryMode specifies the retry mode the API client will be created with, if - // Retryer option is not also specified. When creating a new API Clients this - // member will only be used if the Retryer Options member is nil. This value will - // be ignored if Retryer is not nil. Currently does not support per operation call - // overrides, may in the future. - RetryMode aws.RetryMode - - // Retryer guides how HTTP requests should be retried in case of recoverable - // failures. When nil the API client will use a default retryer. The kind of - // default retry created by the API client can be changed with the RetryMode - // option. - Retryer aws.Retryer - - // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set - // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You - // should not populate this structure programmatically, or rely on the values here - // within your applications. - RuntimeEnvironment aws.RuntimeEnvironment - - // The initial DefaultsMode used when the client options were constructed. If the - // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved - // value was at that point in time. Currently does not support per operation call - // overrides, may in the future. - resolvedDefaultsMode aws.DefaultsMode - - // The HTTP client to invoke API calls with. Defaults to client's default HTTP - // implementation if nil. - HTTPClient HTTPClient - - // The auth scheme resolver which determines how to authenticate for each - // operation. - AuthSchemeResolver AuthSchemeResolver - - // The list of auth schemes supported by the client. - AuthSchemes []smithyhttp.AuthScheme -} - -// Copy creates a clone where the APIOptions list is deep copied. -func (o Options) Copy() Options { - to := o - to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) - copy(to.APIOptions, o.APIOptions) - - return to -} - -func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { - if schemeID == "aws.auth#sigv4" { - return getSigV4IdentityResolver(o) - } - if schemeID == "smithy.api#noAuth" { - return &smithyauth.AnonymousIdentityResolver{} - } - return nil -} - -// WithAPIOptions returns a functional option for setting the Client's APIOptions -// option. -func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { - return func(o *Options) { - o.APIOptions = append(o.APIOptions, optFns...) - } -} - -// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for -// this field will likely prevent you from using any endpoint-related service -// features released after the introduction of EndpointResolverV2 and BaseEndpoint. -// To migrate an EndpointResolver implementation that uses a custom endpoint, set -// the client option BaseEndpoint instead. -func WithEndpointResolver(v EndpointResolver) func(*Options) { - return func(o *Options) { - o.EndpointResolver = v - } -} - -// WithEndpointResolverV2 returns a functional option for setting the Client's -// EndpointResolverV2 option. -func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { - return func(o *Options) { - o.EndpointResolverV2 = v - } -} - -func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { - if o.Credentials != nil { - return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} - } - return nil -} - -// WithSigV4SigningName applies an override to the authentication workflow to -// use the given signing name for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing name from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningName(name string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), - middleware.Before, - ) - }) - } -} - -// WithSigV4SigningRegion applies an override to the authentication workflow to -// use the given signing region for SigV4-authenticated operations. -// -// This is an advanced setting. The value here is FINAL, taking precedence over -// the resolved signing region from both auth scheme resolution and endpoint -// resolution. -func WithSigV4SigningRegion(region string) func(*Options) { - fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, - ) { - return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) - } - return func(o *Options) { - o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { - return s.Initialize.Add( - middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), - middleware.Before, - ) - }) - } -} - -func ignoreAnonymousAuth(options *Options) { - if _, ok := options.Credentials.(aws.AnonymousCredentials); ok { - options.Credentials = nil - } -} diff --git a/service/macie/protocol_test.go b/service/macie/protocol_test.go deleted file mode 100644 index 40d04b92260..00000000000 --- a/service/macie/protocol_test.go +++ /dev/null @@ -1,3 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package macie diff --git a/service/macie/serializers.go b/service/macie/serializers.go deleted file mode 100644 index fcef62f0b37..00000000000 --- a/service/macie/serializers.go +++ /dev/null @@ -1,658 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package macie - -import ( - "bytes" - "context" - "fmt" - "github.com/aws/aws-sdk-go-v2/service/macie/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/encoding/httpbinding" - smithyjson "github.com/aws/smithy-go/encoding/json" - "github.com/aws/smithy-go/middleware" - smithyhttp "github.com/aws/smithy-go/transport/http" - "path" -) - -type awsAwsjson11_serializeOpAssociateMemberAccount struct { -} - -func (*awsAwsjson11_serializeOpAssociateMemberAccount) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpAssociateMemberAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*AssociateMemberAccountInput) - _ = 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("MacieService.AssociateMemberAccount") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentAssociateMemberAccountInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{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_serializeOpAssociateS3Resources struct { -} - -func (*awsAwsjson11_serializeOpAssociateS3Resources) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpAssociateS3Resources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*AssociateS3ResourcesInput) - _ = 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("MacieService.AssociateS3Resources") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentAssociateS3ResourcesInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{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_serializeOpDisassociateMemberAccount struct { -} - -func (*awsAwsjson11_serializeOpDisassociateMemberAccount) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDisassociateMemberAccount) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DisassociateMemberAccountInput) - _ = 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("MacieService.DisassociateMemberAccount") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDisassociateMemberAccountInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{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_serializeOpDisassociateS3Resources struct { -} - -func (*awsAwsjson11_serializeOpDisassociateS3Resources) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpDisassociateS3Resources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*DisassociateS3ResourcesInput) - _ = 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("MacieService.DisassociateS3Resources") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDisassociateS3ResourcesInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{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_serializeOpListMemberAccounts struct { -} - -func (*awsAwsjson11_serializeOpListMemberAccounts) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListMemberAccounts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListMemberAccountsInput) - _ = 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("MacieService.ListMemberAccounts") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListMemberAccountsInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{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_serializeOpListS3Resources struct { -} - -func (*awsAwsjson11_serializeOpListS3Resources) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpListS3Resources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*ListS3ResourcesInput) - _ = 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("MacieService.ListS3Resources") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListS3ResourcesInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{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_serializeOpUpdateS3Resources struct { -} - -func (*awsAwsjson11_serializeOpUpdateS3Resources) ID() string { - return "OperationSerializer" -} - -func (m *awsAwsjson11_serializeOpUpdateS3Resources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( - out middleware.SerializeOutput, metadata middleware.Metadata, err error, -) { - request, ok := in.Request.(*smithyhttp.Request) - if !ok { - return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} - } - - input, ok := in.Parameters.(*UpdateS3ResourcesInput) - _ = 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("MacieService.UpdateS3Resources") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentUpdateS3ResourcesInput(input, jsonEncoder.Value); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - - if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { - return out, metadata, &smithy.SerializationError{Err: err} - } - in.Request = request - - return next.HandleSerialize(ctx, in) -} -func awsAwsjson11_serializeDocumentClassificationType(v *types.ClassificationType, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.Continuous) > 0 { - ok := object.Key("continuous") - ok.String(string(v.Continuous)) - } - - if len(v.OneTime) > 0 { - ok := object.Key("oneTime") - ok.String(string(v.OneTime)) - } - - return nil -} - -func awsAwsjson11_serializeDocumentClassificationTypeUpdate(v *types.ClassificationTypeUpdate, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if len(v.Continuous) > 0 { - ok := object.Key("continuous") - ok.String(string(v.Continuous)) - } - - if len(v.OneTime) > 0 { - ok := object.Key("oneTime") - ok.String(string(v.OneTime)) - } - - return nil -} - -func awsAwsjson11_serializeDocumentS3Resource(v *types.S3Resource, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.BucketName != nil { - ok := object.Key("bucketName") - ok.String(*v.BucketName) - } - - if v.Prefix != nil { - ok := object.Key("prefix") - ok.String(*v.Prefix) - } - - return nil -} - -func awsAwsjson11_serializeDocumentS3ResourceClassification(v *types.S3ResourceClassification, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.BucketName != nil { - ok := object.Key("bucketName") - ok.String(*v.BucketName) - } - - if v.ClassificationType != nil { - ok := object.Key("classificationType") - if err := awsAwsjson11_serializeDocumentClassificationType(v.ClassificationType, ok); err != nil { - return err - } - } - - if v.Prefix != nil { - ok := object.Key("prefix") - ok.String(*v.Prefix) - } - - return nil -} - -func awsAwsjson11_serializeDocumentS3ResourceClassificationUpdate(v *types.S3ResourceClassificationUpdate, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.BucketName != nil { - ok := object.Key("bucketName") - ok.String(*v.BucketName) - } - - if v.ClassificationTypeUpdate != nil { - ok := object.Key("classificationTypeUpdate") - if err := awsAwsjson11_serializeDocumentClassificationTypeUpdate(v.ClassificationTypeUpdate, ok); err != nil { - return err - } - } - - if v.Prefix != nil { - ok := object.Key("prefix") - ok.String(*v.Prefix) - } - - return nil -} - -func awsAwsjson11_serializeDocumentS3Resources(v []types.S3Resource, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsAwsjson11_serializeDocumentS3Resource(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsAwsjson11_serializeDocumentS3ResourcesClassification(v []types.S3ResourceClassification, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsAwsjson11_serializeDocumentS3ResourceClassification(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsAwsjson11_serializeDocumentS3ResourcesClassificationUpdate(v []types.S3ResourceClassificationUpdate, value smithyjson.Value) error { - array := value.Array() - defer array.Close() - - for i := range v { - av := array.Value() - if err := awsAwsjson11_serializeDocumentS3ResourceClassificationUpdate(&v[i], av); err != nil { - return err - } - } - return nil -} - -func awsAwsjson11_serializeOpDocumentAssociateMemberAccountInput(v *AssociateMemberAccountInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MemberAccountId != nil { - ok := object.Key("memberAccountId") - ok.String(*v.MemberAccountId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentAssociateS3ResourcesInput(v *AssociateS3ResourcesInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MemberAccountId != nil { - ok := object.Key("memberAccountId") - ok.String(*v.MemberAccountId) - } - - if v.S3Resources != nil { - ok := object.Key("s3Resources") - if err := awsAwsjson11_serializeDocumentS3ResourcesClassification(v.S3Resources, ok); err != nil { - return err - } - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentDisassociateMemberAccountInput(v *DisassociateMemberAccountInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MemberAccountId != nil { - ok := object.Key("memberAccountId") - ok.String(*v.MemberAccountId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentDisassociateS3ResourcesInput(v *DisassociateS3ResourcesInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.AssociatedS3Resources != nil { - ok := object.Key("associatedS3Resources") - if err := awsAwsjson11_serializeDocumentS3Resources(v.AssociatedS3Resources, ok); err != nil { - return err - } - } - - if v.MemberAccountId != nil { - ok := object.Key("memberAccountId") - ok.String(*v.MemberAccountId) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListMemberAccountsInput(v *ListMemberAccountsInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("maxResults") - ok.Integer(*v.MaxResults) - } - - if v.NextToken != nil { - ok := object.Key("nextToken") - ok.String(*v.NextToken) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentListS3ResourcesInput(v *ListS3ResourcesInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MaxResults != nil { - ok := object.Key("maxResults") - ok.Integer(*v.MaxResults) - } - - if v.MemberAccountId != nil { - ok := object.Key("memberAccountId") - ok.String(*v.MemberAccountId) - } - - if v.NextToken != nil { - ok := object.Key("nextToken") - ok.String(*v.NextToken) - } - - return nil -} - -func awsAwsjson11_serializeOpDocumentUpdateS3ResourcesInput(v *UpdateS3ResourcesInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.MemberAccountId != nil { - ok := object.Key("memberAccountId") - ok.String(*v.MemberAccountId) - } - - if v.S3ResourcesUpdate != nil { - ok := object.Key("s3ResourcesUpdate") - if err := awsAwsjson11_serializeDocumentS3ResourcesClassificationUpdate(v.S3ResourcesUpdate, ok); err != nil { - return err - } - } - - return nil -} diff --git a/service/macie/types/enums.go b/service/macie/types/enums.go deleted file mode 100644 index 239b9ee1cac..00000000000 --- a/service/macie/types/enums.go +++ /dev/null @@ -1,38 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -type S3ContinuousClassificationType string - -// Enum values for S3ContinuousClassificationType -const ( - S3ContinuousClassificationTypeFull S3ContinuousClassificationType = "FULL" -) - -// Values returns all known values for S3ContinuousClassificationType. Note that -// this can be expanded in the future, and 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 (S3ContinuousClassificationType) Values() []S3ContinuousClassificationType { - return []S3ContinuousClassificationType{ - "FULL", - } -} - -type S3OneTimeClassificationType string - -// Enum values for S3OneTimeClassificationType -const ( - S3OneTimeClassificationTypeFull S3OneTimeClassificationType = "FULL" - S3OneTimeClassificationTypeNone S3OneTimeClassificationType = "NONE" -) - -// Values returns all known values for S3OneTimeClassificationType. Note that this -// can be expanded in the future, and 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 (S3OneTimeClassificationType) Values() []S3OneTimeClassificationType { - return []S3OneTimeClassificationType{ - "FULL", - "NONE", - } -} diff --git a/service/macie/types/errors.go b/service/macie/types/errors.go deleted file mode 100644 index 8c8b0494ddd..00000000000 --- a/service/macie/types/errors.go +++ /dev/null @@ -1,126 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - "fmt" - smithy "github.com/aws/smithy-go" -) - -// (Discontinued) You do not have required permissions to access the requested -// resource. -type AccessDeniedException struct { - Message *string - - ErrorCodeOverride *string - - ResourceType *string - - noSmithyDocumentSerde -} - -func (e *AccessDeniedException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *AccessDeniedException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *AccessDeniedException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "AccessDeniedException" - } - return *e.ErrorCodeOverride -} -func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// (Discontinued) Internal server error. -type InternalException struct { - Message *string - - ErrorCodeOverride *string - - ErrorCode_ *string - - noSmithyDocumentSerde -} - -func (e *InternalException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InternalException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InternalException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InternalException" - } - return *e.ErrorCodeOverride -} -func (e *InternalException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } - -// (Discontinued) The request was rejected because an invalid or out-of-range -// value was supplied for an input parameter. -type InvalidInputException struct { - Message *string - - ErrorCodeOverride *string - - ErrorCode_ *string - FieldName *string - - noSmithyDocumentSerde -} - -func (e *InvalidInputException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *InvalidInputException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *InvalidInputException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "InvalidInputException" - } - return *e.ErrorCodeOverride -} -func (e *InvalidInputException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } - -// (Discontinued) The request was rejected because it attempted to create -// resources beyond the current Amazon Web Services account quotas. The error code -// describes the quota exceeded. -type LimitExceededException struct { - Message *string - - ErrorCodeOverride *string - - ErrorCode_ *string - ResourceType *string - - noSmithyDocumentSerde -} - -func (e *LimitExceededException) Error() string { - return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) -} -func (e *LimitExceededException) ErrorMessage() string { - if e.Message == nil { - return "" - } - return *e.Message -} -func (e *LimitExceededException) ErrorCode() string { - if e == nil || e.ErrorCodeOverride == nil { - return "LimitExceededException" - } - return *e.ErrorCodeOverride -} -func (e *LimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/macie/types/types.go b/service/macie/types/types.go deleted file mode 100644 index fe3b9c99be5..00000000000 --- a/service/macie/types/types.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package types - -import ( - smithydocument "github.com/aws/smithy-go/document" -) - -// (Discontinued) The classification type that Amazon Macie Classic applies to the -// associated S3 resources. -type ClassificationType struct { - - // (Discontinued) A continuous classification of the objects that are added to a - // specified S3 bucket. Amazon Macie Classic begins performing continuous - // classification after a bucket is successfully associated with Macie Classic. - // - // This member is required. - Continuous S3ContinuousClassificationType - - // (Discontinued) A one-time classification of all of the existing objects in a - // specified S3 bucket. - // - // This member is required. - OneTime S3OneTimeClassificationType - - noSmithyDocumentSerde -} - -// (Discontinued) The classification type that Amazon Macie Classic applies to the -// associated S3 resources. At least one of the classification types ( oneTime or -// continuous ) must be specified. -type ClassificationTypeUpdate struct { - - // (Discontinued) A continuous classification of the objects that are added to a - // specified S3 bucket. Amazon Macie Classic begins performing continuous - // classification after a bucket is successfully associated with Macie Classic. - Continuous S3ContinuousClassificationType - - // (Discontinued) A one-time classification of all of the existing objects in a - // specified S3 bucket. - OneTime S3OneTimeClassificationType - - noSmithyDocumentSerde -} - -// (Discontinued) Includes details about the failed S3 resources. -type FailedS3Resource struct { - - // (Discontinued) The status code of a failed item. - ErrorCode *string - - // (Discontinued) The error message of a failed item. - ErrorMessage *string - - // (Discontinued) The failed S3 resources. - FailedItem *S3Resource - - noSmithyDocumentSerde -} - -// (Discontinued) Contains information about the Amazon Macie Classic member -// account. -type MemberAccount struct { - - // (Discontinued) The Amazon Web Services account ID of the Amazon Macie Classic - // member account. - AccountId *string - - noSmithyDocumentSerde -} - -// (Discontinued) Contains information about the S3 resource. This data type is -// used as a request parameter in the DisassociateS3Resources action and can be -// used as a response parameter in the AssociateS3Resources and UpdateS3Resources -// actions. -type S3Resource struct { - - // (Discontinued) The name of the S3 bucket. - // - // This member is required. - BucketName *string - - // (Discontinued) The prefix of the S3 bucket. - Prefix *string - - noSmithyDocumentSerde -} - -// (Discontinued) The S3 resources that you want to associate with Amazon Macie -// Classic for monitoring and data classification. This data type is used as a -// request parameter in the AssociateS3Resources action and a response parameter -// in the ListS3Resources action. -type S3ResourceClassification struct { - - // (Discontinued) The name of the S3 bucket that you want to associate with Amazon - // Macie Classic. - // - // This member is required. - BucketName *string - - // (Discontinued) The classification type that you want to specify for the - // resource associated with Amazon Macie Classic. - // - // This member is required. - ClassificationType *ClassificationType - - // (Discontinued) The prefix of the S3 bucket that you want to associate with - // Amazon Macie Classic. - Prefix *string - - noSmithyDocumentSerde -} - -// (Discontinued) The S3 resources whose classification types you want to update. -// This data type is used as a request parameter in the UpdateS3Resources action. -type S3ResourceClassificationUpdate struct { - - // (Discontinued) The name of the S3 bucket whose classification types you want to - // update. - // - // This member is required. - BucketName *string - - // (Discontinued) The classification type that you want to update for the resource - // associated with Amazon Macie Classic. - // - // This member is required. - ClassificationTypeUpdate *ClassificationTypeUpdate - - // (Discontinued) The prefix of the S3 bucket whose classification types you want - // to update. - Prefix *string - - noSmithyDocumentSerde -} - -type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/macie/validators.go b/service/macie/validators.go deleted file mode 100644 index 7bd8fb6ae47..00000000000 --- a/service/macie/validators.go +++ /dev/null @@ -1,342 +0,0 @@ -// Code generated by smithy-go-codegen DO NOT EDIT. - -package macie - -import ( - "context" - "fmt" - "github.com/aws/aws-sdk-go-v2/service/macie/types" - smithy "github.com/aws/smithy-go" - "github.com/aws/smithy-go/middleware" -) - -type validateOpAssociateMemberAccount struct { -} - -func (*validateOpAssociateMemberAccount) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateMemberAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateMemberAccountInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateMemberAccountInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpAssociateS3Resources struct { -} - -func (*validateOpAssociateS3Resources) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpAssociateS3Resources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*AssociateS3ResourcesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpAssociateS3ResourcesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateMemberAccount struct { -} - -func (*validateOpDisassociateMemberAccount) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateMemberAccount) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateMemberAccountInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateMemberAccountInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpDisassociateS3Resources struct { -} - -func (*validateOpDisassociateS3Resources) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpDisassociateS3Resources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*DisassociateS3ResourcesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpDisassociateS3ResourcesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -type validateOpUpdateS3Resources struct { -} - -func (*validateOpUpdateS3Resources) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpUpdateS3Resources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*UpdateS3ResourcesInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpUpdateS3ResourcesInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - -func addOpAssociateMemberAccountValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateMemberAccount{}, middleware.After) -} - -func addOpAssociateS3ResourcesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpAssociateS3Resources{}, middleware.After) -} - -func addOpDisassociateMemberAccountValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateMemberAccount{}, middleware.After) -} - -func addOpDisassociateS3ResourcesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpDisassociateS3Resources{}, middleware.After) -} - -func addOpUpdateS3ResourcesValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpUpdateS3Resources{}, middleware.After) -} - -func validateClassificationType(v *types.ClassificationType) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ClassificationType"} - if len(v.OneTime) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("OneTime")) - } - if len(v.Continuous) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("Continuous")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateS3Resource(v *types.S3Resource) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "S3Resource"} - if v.BucketName == nil { - invalidParams.Add(smithy.NewErrParamRequired("BucketName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateS3ResourceClassification(v *types.S3ResourceClassification) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "S3ResourceClassification"} - if v.BucketName == nil { - invalidParams.Add(smithy.NewErrParamRequired("BucketName")) - } - if v.ClassificationType == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClassificationType")) - } else if v.ClassificationType != nil { - if err := validateClassificationType(v.ClassificationType); err != nil { - invalidParams.AddNested("ClassificationType", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateS3ResourceClassificationUpdate(v *types.S3ResourceClassificationUpdate) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "S3ResourceClassificationUpdate"} - if v.BucketName == nil { - invalidParams.Add(smithy.NewErrParamRequired("BucketName")) - } - if v.ClassificationTypeUpdate == nil { - invalidParams.Add(smithy.NewErrParamRequired("ClassificationTypeUpdate")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateS3Resources(v []types.S3Resource) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "S3Resources"} - for i := range v { - if err := validateS3Resource(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateS3ResourcesClassification(v []types.S3ResourceClassification) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "S3ResourcesClassification"} - for i := range v { - if err := validateS3ResourceClassification(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateS3ResourcesClassificationUpdate(v []types.S3ResourceClassificationUpdate) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "S3ResourcesClassificationUpdate"} - for i := range v { - if err := validateS3ResourceClassificationUpdate(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateMemberAccountInput(v *AssociateMemberAccountInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateMemberAccountInput"} - if v.MemberAccountId == nil { - invalidParams.Add(smithy.NewErrParamRequired("MemberAccountId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpAssociateS3ResourcesInput(v *AssociateS3ResourcesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "AssociateS3ResourcesInput"} - if v.S3Resources == nil { - invalidParams.Add(smithy.NewErrParamRequired("S3Resources")) - } else if v.S3Resources != nil { - if err := validateS3ResourcesClassification(v.S3Resources); err != nil { - invalidParams.AddNested("S3Resources", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateMemberAccountInput(v *DisassociateMemberAccountInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateMemberAccountInput"} - if v.MemberAccountId == nil { - invalidParams.Add(smithy.NewErrParamRequired("MemberAccountId")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpDisassociateS3ResourcesInput(v *DisassociateS3ResourcesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "DisassociateS3ResourcesInput"} - if v.AssociatedS3Resources == nil { - invalidParams.Add(smithy.NewErrParamRequired("AssociatedS3Resources")) - } else if v.AssociatedS3Resources != nil { - if err := validateS3Resources(v.AssociatedS3Resources); err != nil { - invalidParams.AddNested("AssociatedS3Resources", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - -func validateOpUpdateS3ResourcesInput(v *UpdateS3ResourcesInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "UpdateS3ResourcesInput"} - if v.S3ResourcesUpdate == nil { - invalidParams.Add(smithy.NewErrParamRequired("S3ResourcesUpdate")) - } else if v.S3ResourcesUpdate != nil { - if err := validateS3ResourcesClassificationUpdate(v.S3ResourcesUpdate); err != nil { - invalidParams.AddNested("S3ResourcesUpdate", err.(smithy.InvalidParamsError)) - } - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -}