From 8d2cdc19e6d5d9e785c4dfe395f597ab8a49bc18 Mon Sep 17 00:00:00 2001 From: AWS SDK for Go v2 automation user Date: Thu, 9 Nov 2023 19:17:24 +0000 Subject: [PATCH] Regenerated Clients --- .../28d752f3c96c45bb96a2f48a638e7f08.json | 8 + .../3bd14426c89e4cde9438bf9d7fb4a2ec.json | 8 + .../57ef8b60d92b4014be0864604f9ffc43.json | 8 + .../77c5897a416441a6ab275bf871d24bf2.json | 8 + .../7f9d30b3477b447b8745b49a62386092.json | 8 + .../94fae5f130054bf19cc464f2e54802e1.json | 8 + .../bdbb87836fe94c4aae8e742f06c7bbf5.json | 8 + .../c0248aec7a724683abbc6f2d350a8ba5.json | 8 + .../c91341a9c5ae4a16b7d669bcd762ce72.json | 8 + config/shared_config_test.go | 6 +- .../cloudformation/api_op_CreateChangeSet.go | 4 +- service/cloudformation/api_op_CreateStack.go | 3 +- .../cloudformation/api_op_DescribeStacks.go | 2 +- service/cloudformation/api_op_RegisterType.go | 2 +- service/cloudformation/api_op_UpdateStack.go | 3 +- service/cloudformation/deserializers.go | 13 + service/cloudformation/endpoints_test.go | 20 + service/cloudformation/serializers.go | 5 + service/cloudformation/types/enums.go | 18 + service/cloudformation/types/types.go | 27 +- service/cloudtrail/api_op_CreateTrail.go | 3 +- .../cloudtrail/api_op_GetInsightSelectors.go | 39 +- service/cloudtrail/api_op_LookupEvents.go | 5 +- .../cloudtrail/api_op_PutInsightSelectors.go | 60 +- ...i_op_RegisterOrganizationDelegatedAdmin.go | 3 +- .../cloudtrail/api_op_UpdateEventDataStore.go | 11 +- service/cloudtrail/api_op_UpdateTrail.go | 19 +- service/cloudtrail/deserializers.go | 51 + service/cloudtrail/endpoints.go | 2 +- service/cloudtrail/serializers.go | 15 + service/cloudtrail/types/errors.go | 32 +- service/cloudtrail/types/types.go | 68 +- service/cloudtrail/validators.go | 42 - .../cloudwatchlogs/api_op_CreateDelivery.go | 298 ++ .../cloudwatchlogs/api_op_DeleteDelivery.go | 261 + .../api_op_DeleteDeliveryDestination.go | 263 + .../api_op_DeleteDeliveryDestinationPolicy.go | 258 + .../api_op_DeleteDeliverySource.go | 260 + .../api_op_DescribeDeliveries.go | 354 ++ .../api_op_DescribeDeliveryDestinations.go | 359 ++ .../api_op_DescribeDeliverySources.go | 357 ++ service/cloudwatchlogs/api_op_GetDelivery.go | 265 + .../api_op_GetDeliveryDestination.go | 261 + .../api_op_GetDeliveryDestinationPolicy.go | 264 + .../api_op_GetDeliverySource.go | 261 + .../cloudwatchlogs/api_op_GetQueryResults.go | 2 + .../api_op_PutDeliveryDestination.go | 304 ++ .../api_op_PutDeliveryDestinationPolicy.go | 290 + .../api_op_PutDeliverySource.go | 308 ++ service/cloudwatchlogs/deserializers.go | 4742 ++++++++++++++--- service/cloudwatchlogs/endpoints.go | 2 +- service/cloudwatchlogs/generated.json | 15 + service/cloudwatchlogs/serializers.go | 1403 ++++- service/cloudwatchlogs/types/enums.go | 44 + service/cloudwatchlogs/types/errors.go | 130 + service/cloudwatchlogs/types/types.go | 157 + service/cloudwatchlogs/validators.go | 502 ++ .../api_op_BatchDetectTargetedSentiment.go | 2 +- service/comprehend/api_op_ClassifyDocument.go | 51 +- .../api_op_CreateDocumentClassifier.go | 2 +- service/comprehend/api_op_CreateFlywheel.go | 9 +- .../api_op_DetectTargetedSentiment.go | 2 +- .../comprehend/api_op_DetectToxicContent.go | 275 + ...i_op_StartTargetedSentimentDetectionJob.go | 2 +- service/comprehend/deserializers.go | 368 ++ service/comprehend/endpoints.go | 2 +- service/comprehend/generated.json | 1 + service/comprehend/serializers.go | 99 + service/comprehend/types/enums.go | 28 + service/comprehend/types/types.go | 77 +- service/comprehend/validators.go | 78 + .../api_op_ListIntegrationAssociations.go | 3 + service/connect/serializers.go | 4 + service/connect/types/enums.go | 2 + ...api_op_DisableSnapshotBlockPublicAccess.go | 266 + .../api_op_EnableSnapshotBlockPublicAccess.go | 292 + ...pi_op_GetSnapshotBlockPublicAccessState.go | 270 + service/ec2/deserializers.go | 420 ++ service/ec2/generated.json | 3 + service/ec2/serializers.go | 233 + service/ec2/types/enums.go | 21 + service/ec2/validators.go | 39 + service/eks/api_op_CreateAddon.go | 7 +- .../api_op_CreateEksAnywhereSubscription.go | 337 ++ service/eks/api_op_CreateFargateProfile.go | 2 +- service/eks/api_op_CreateNodegroup.go | 11 +- .../api_op_DeleteEksAnywhereSubscription.go | 265 + .../api_op_DescribeEksAnywhereSubscription.go | 261 + ...i_op_DisassociateIdentityProviderConfig.go | 3 +- service/eks/api_op_ListAddons.go | 4 +- .../api_op_ListEksAnywhereSubscriptions.go | 279 + .../api_op_UpdateEksAnywhereSubscription.go | 306 ++ service/eks/deserializers.go | 1608 +++++- service/eks/generated.json | 5 + service/eks/serializers.go | 419 ++ service/eks/types/enums.go | 61 + service/eks/types/errors.go | 42 +- service/eks/types/types.go | 75 +- service/eks/validators.go | 159 + service/lambda/types/enums.go | 68 +- .../api_op_CreateMultipartReadSetUpload.go | 8 +- service/omics/types/enums.go | 2 + service/omics/types/types.go | 8 +- service/omics/validators.go | 6 - 104 files changed, 16828 insertions(+), 1542 deletions(-) create mode 100644 .changelog/28d752f3c96c45bb96a2f48a638e7f08.json create mode 100644 .changelog/3bd14426c89e4cde9438bf9d7fb4a2ec.json create mode 100644 .changelog/57ef8b60d92b4014be0864604f9ffc43.json create mode 100644 .changelog/77c5897a416441a6ab275bf871d24bf2.json create mode 100644 .changelog/7f9d30b3477b447b8745b49a62386092.json create mode 100644 .changelog/94fae5f130054bf19cc464f2e54802e1.json create mode 100644 .changelog/bdbb87836fe94c4aae8e742f06c7bbf5.json create mode 100644 .changelog/c0248aec7a724683abbc6f2d350a8ba5.json create mode 100644 .changelog/c91341a9c5ae4a16b7d669bcd762ce72.json create mode 100644 service/cloudwatchlogs/api_op_CreateDelivery.go create mode 100644 service/cloudwatchlogs/api_op_DeleteDelivery.go create mode 100644 service/cloudwatchlogs/api_op_DeleteDeliveryDestination.go create mode 100644 service/cloudwatchlogs/api_op_DeleteDeliveryDestinationPolicy.go create mode 100644 service/cloudwatchlogs/api_op_DeleteDeliverySource.go create mode 100644 service/cloudwatchlogs/api_op_DescribeDeliveries.go create mode 100644 service/cloudwatchlogs/api_op_DescribeDeliveryDestinations.go create mode 100644 service/cloudwatchlogs/api_op_DescribeDeliverySources.go create mode 100644 service/cloudwatchlogs/api_op_GetDelivery.go create mode 100644 service/cloudwatchlogs/api_op_GetDeliveryDestination.go create mode 100644 service/cloudwatchlogs/api_op_GetDeliveryDestinationPolicy.go create mode 100644 service/cloudwatchlogs/api_op_GetDeliverySource.go create mode 100644 service/cloudwatchlogs/api_op_PutDeliveryDestination.go create mode 100644 service/cloudwatchlogs/api_op_PutDeliveryDestinationPolicy.go create mode 100644 service/cloudwatchlogs/api_op_PutDeliverySource.go create mode 100644 service/comprehend/api_op_DetectToxicContent.go create mode 100644 service/ec2/api_op_DisableSnapshotBlockPublicAccess.go create mode 100644 service/ec2/api_op_EnableSnapshotBlockPublicAccess.go create mode 100644 service/ec2/api_op_GetSnapshotBlockPublicAccessState.go create mode 100644 service/eks/api_op_CreateEksAnywhereSubscription.go create mode 100644 service/eks/api_op_DeleteEksAnywhereSubscription.go create mode 100644 service/eks/api_op_DescribeEksAnywhereSubscription.go create mode 100644 service/eks/api_op_ListEksAnywhereSubscriptions.go create mode 100644 service/eks/api_op_UpdateEksAnywhereSubscription.go diff --git a/.changelog/28d752f3c96c45bb96a2f48a638e7f08.json b/.changelog/28d752f3c96c45bb96a2f48a638e7f08.json new file mode 100644 index 00000000000..f6fc23d1c1c --- /dev/null +++ b/.changelog/28d752f3c96c45bb96a2f48a638e7f08.json @@ -0,0 +1,8 @@ +{ + "id": "28d752f3-c96c-45bb-96a2-f48a638e7f08", + "type": "feature", + "description": "The Insights in Lake feature lets customers enable CloudTrail Insights on a source CloudTrail Lake event data store and create a destination event data store to collect Insights events based on unusual management event activity in the source event data store.", + "modules": [ + "service/cloudtrail" + ] +} \ No newline at end of file diff --git a/.changelog/3bd14426c89e4cde9438bf9d7fb4a2ec.json b/.changelog/3bd14426c89e4cde9438bf9d7fb4a2ec.json new file mode 100644 index 00000000000..640c6d4eb77 --- /dev/null +++ b/.changelog/3bd14426c89e4cde9438bf9d7fb4a2ec.json @@ -0,0 +1,8 @@ +{ + "id": "3bd14426-c89e-4cde-9438-bf9d7fb4a2ec", + "type": "feature", + "description": "Update to support new APIs for delivery of logs from AWS services.", + "modules": [ + "service/cloudwatchlogs" + ] +} \ No newline at end of file diff --git a/.changelog/57ef8b60d92b4014be0864604f9ffc43.json b/.changelog/57ef8b60d92b4014be0864604f9ffc43.json new file mode 100644 index 00000000000..3975ced6bd1 --- /dev/null +++ b/.changelog/57ef8b60d92b4014be0864604f9ffc43.json @@ -0,0 +1,8 @@ +{ + "id": "57ef8b60-d92b-4014-be08-64604f9ffc43", + "type": "feature", + "description": "Support UBAM filetype for Omics Storage and make referenceArn optional", + "modules": [ + "service/omics" + ] +} \ No newline at end of file diff --git a/.changelog/77c5897a416441a6ab275bf871d24bf2.json b/.changelog/77c5897a416441a6ab275bf871d24bf2.json new file mode 100644 index 00000000000..ff6fa901c13 --- /dev/null +++ b/.changelog/77c5897a416441a6ab275bf871d24bf2.json @@ -0,0 +1,8 @@ +{ + "id": "77c5897a-4164-41a6-ab27-5bf871d24bf2", + "type": "feature", + "description": "Add Custom runtime on Amazon Linux 2023 (provided.al2023) support to AWS Lambda.", + "modules": [ + "service/lambda" + ] +} \ No newline at end of file diff --git a/.changelog/7f9d30b3477b447b8745b49a62386092.json b/.changelog/7f9d30b3477b447b8745b49a62386092.json new file mode 100644 index 00000000000..c8069d99750 --- /dev/null +++ b/.changelog/7f9d30b3477b447b8745b49a62386092.json @@ -0,0 +1,8 @@ +{ + "id": "7f9d30b3-477b-447b-8745-b49a62386092", + "type": "feature", + "description": "This release adds support for toxicity detection and prompt safety classification.", + "modules": [ + "service/comprehend" + ] +} \ No newline at end of file diff --git a/.changelog/94fae5f130054bf19cc464f2e54802e1.json b/.changelog/94fae5f130054bf19cc464f2e54802e1.json new file mode 100644 index 00000000000..2b7fd23e2a9 --- /dev/null +++ b/.changelog/94fae5f130054bf19cc464f2e54802e1.json @@ -0,0 +1,8 @@ +{ + "id": "94fae5f1-3005-4bf1-9cc4-64f2e54802e1", + "type": "feature", + "description": "Added new ConcurrencyMode feature for AWS CloudFormation StackSets for faster deployments to target accounts.", + "modules": [ + "service/cloudformation" + ] +} \ No newline at end of file diff --git a/.changelog/bdbb87836fe94c4aae8e742f06c7bbf5.json b/.changelog/bdbb87836fe94c4aae8e742f06c7bbf5.json new file mode 100644 index 00000000000..427fa3d4469 --- /dev/null +++ b/.changelog/bdbb87836fe94c4aae8e742f06c7bbf5.json @@ -0,0 +1,8 @@ +{ + "id": "bdbb8783-6fe9-4c4a-ae8e-742f06c7bbf5", + "type": "feature", + "description": "This release adds the ability to integrate customer lambda functions with Connect attachments for scanning and updates the ListIntegrationAssociations API to support filtering on IntegrationArn.", + "modules": [ + "service/connect" + ] +} \ No newline at end of file diff --git a/.changelog/c0248aec7a724683abbc6f2d350a8ba5.json b/.changelog/c0248aec7a724683abbc6f2d350a8ba5.json new file mode 100644 index 00000000000..0f6396e2280 --- /dev/null +++ b/.changelog/c0248aec7a724683abbc6f2d350a8ba5.json @@ -0,0 +1,8 @@ +{ + "id": "c0248aec-7a72-4683-abbc-6f2d350a8ba5", + "type": "feature", + "description": "Adding EKS Anywhere subscription related operations.", + "modules": [ + "service/eks" + ] +} \ No newline at end of file diff --git a/.changelog/c91341a9c5ae4a16b7d669bcd762ce72.json b/.changelog/c91341a9c5ae4a16b7d669bcd762ce72.json new file mode 100644 index 00000000000..b41a2654eef --- /dev/null +++ b/.changelog/c91341a9c5ae4a16b7d669bcd762ce72.json @@ -0,0 +1,8 @@ +{ + "id": "c91341a9-c5ae-4a16-b7d6-69bcd762ce72", + "type": "feature", + "description": "AWS EBS now supports Block Public Access for EBS Snapshots. This release introduces the EnableSnapshotBlockPublicAccess, DisableSnapshotBlockPublicAccess and GetSnapshotBlockPublicAccessState APIs to manage account-level public access settings for EBS Snapshots in an AWS Region.", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/config/shared_config_test.go b/config/shared_config_test.go index 2b0900a961a..f09c548e9dd 100644 --- a/config/shared_config_test.go +++ b/config/shared_config_test.go @@ -22,9 +22,9 @@ import ( var _ regionProvider = (*SharedConfig)(nil) var ( - testConfigFilename = filepath.Join("testdata", "shared_config") - testConfigOtherFilename = filepath.Join("testdata", "shared_config_other") - testCredentialsFilename = filepath.Join("testdata", "shared_credentials") + testConfigFilename = filepath.Join("testdata", "shared_config") + testConfigOtherFilename = filepath.Join("testdata", "shared_config_other") + testCredentialsFilename = filepath.Join("testdata", "shared_credentials") testConfigLeadingWSFilename1 = filepath.Join("testdata", "leading_ws") testConfigLeadingWSFilename2 = filepath.Join("testdata", "leading_ws_trailing_nl") ) diff --git a/service/cloudformation/api_op_CreateChangeSet.go b/service/cloudformation/api_op_CreateChangeSet.go index f8f52cebdb6..367f8fa9fc1 100644 --- a/service/cloudformation/api_op_CreateChangeSet.go +++ b/service/cloudformation/api_op_CreateChangeSet.go @@ -112,6 +112,7 @@ type CreateChangeSetInput struct { // capability. For more information about macros, see Using CloudFormation // macros to perform custom processing on templates (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html) // . + // Only one of the Capabilities and ResourceType parameters can be specified. Capabilities []types.Capability // The type of change set operation. To create a change set for a new stack, @@ -173,7 +174,8 @@ type CreateChangeSetInput struct { // Management (IAM) uses this parameter for condition keys in IAM policies for // CloudFormation. For more information, see Controlling access with Identity and // Access Management (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html) - // in the CloudFormation User Guide. + // in the CloudFormation User Guide. Only one of the Capabilities and ResourceType + // parameters can be specified. ResourceTypes []string // The resources to import into your stack. diff --git a/service/cloudformation/api_op_CreateStack.go b/service/cloudformation/api_op_CreateStack.go index 0493a669e32..204fbbb7562 100644 --- a/service/cloudformation/api_op_CreateStack.go +++ b/service/cloudformation/api_op_CreateStack.go @@ -90,6 +90,7 @@ type CreateStackInput struct { // notified. For more information, see Using CloudFormation macros to perform // custom processing on templates (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html) // . + // Only one of the Capabilities and ResourceType parameters can be specified. Capabilities []types.Capability // A unique identifier for this CreateStack request. Specify this token if you @@ -148,7 +149,7 @@ type CreateStackInput struct { // grants permissions to all resource types. Identity and Access Management (IAM) // uses this parameter for CloudFormation-specific condition keys in IAM policies. // For more information, see Controlling Access with Identity and Access Management (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html) - // . + // . Only one of the Capabilities and ResourceType parameters can be specified. ResourceTypes []string // When set to true , newly created resources are deleted when the operation rolls diff --git a/service/cloudformation/api_op_DescribeStacks.go b/service/cloudformation/api_op_DescribeStacks.go index fa4ac44d8ad..8614189e374 100644 --- a/service/cloudformation/api_op_DescribeStacks.go +++ b/service/cloudformation/api_op_DescribeStacks.go @@ -23,7 +23,7 @@ import ( // Returns the description for the specified stack; if no stack name was // specified, then it returns the description for all the stacks created. If the -// stack doesn't exist, an ValidationError is returned. +// stack doesn't exist, a ValidationError is returned. func (c *Client) DescribeStacks(ctx context.Context, params *DescribeStacksInput, optFns ...func(*Options)) (*DescribeStacksOutput, error) { if params == nil { params = &DescribeStacksInput{} diff --git a/service/cloudformation/api_op_RegisterType.go b/service/cloudformation/api_op_RegisterType.go index a784891fa0b..c1a09264cec 100644 --- a/service/cloudformation/api_op_RegisterType.go +++ b/service/cloudformation/api_op_RegisterType.go @@ -92,7 +92,7 @@ type RegisterTypeInput struct { // The Amazon Resource Name (ARN) of the IAM role for CloudFormation to assume // when invoking the extension. For CloudFormation to assume the specified // execution role, the role must contain a trust relationship with the - // CloudFormation service principle ( resources.cloudformation.amazonaws.com ). For + // CloudFormation service principal ( resources.cloudformation.amazonaws.com ). For // more information about adding trust relationships, see Modifying a role trust // policy (https://docs.aws.amazon.com/IAM/latest/UserGuide/roles-managingrole-editing-console.html#roles-managingrole_edit-trust-policy) // in the Identity and Access Management User Guide. If your extension calls Amazon diff --git a/service/cloudformation/api_op_UpdateStack.go b/service/cloudformation/api_op_UpdateStack.go index 311570ba9f7..c07ab30dbf5 100644 --- a/service/cloudformation/api_op_UpdateStack.go +++ b/service/cloudformation/api_op_UpdateStack.go @@ -91,6 +91,7 @@ type UpdateStackInput struct { // notified. For more information, see Using CloudFormation Macros to Perform // Custom Processing on Templates (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-macros.html) // . + // Only one of the Capabilities and ResourceType parameters can be specified. Capabilities []types.Capability // A unique identifier for this UpdateStack request. Specify this token if you @@ -130,7 +131,7 @@ type UpdateStackInput struct { // Management (IAM) uses this parameter for CloudFormation-specific condition keys // in IAM policies. For more information, see Controlling Access with Identity and // Access Management (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-iam-template.html) - // . + // . Only one of the Capabilities and ResourceType parameters can be specified. ResourceTypes []string // When set to true , newly created resources are deleted when the operation rolls diff --git a/service/cloudformation/deserializers.go b/service/cloudformation/deserializers.go index 6238ca9d6ac..fc2aca81545 100644 --- a/service/cloudformation/deserializers.go +++ b/service/cloudformation/deserializers.go @@ -16583,6 +16583,19 @@ func awsAwsquery_deserializeDocumentStackSetOperationPreferences(v **types.Stack originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { + case strings.EqualFold("ConcurrencyMode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.ConcurrencyMode = types.ConcurrencyMode(xtv) + } + case strings.EqualFold("FailureToleranceCount", t.Name.Local): val, err := decoder.Value() if err != nil { diff --git a/service/cloudformation/endpoints_test.go b/service/cloudformation/endpoints_test.go index 74024e542bf..2c44931d1e0 100644 --- a/service/cloudformation/endpoints_test.go +++ b/service/cloudformation/endpoints_test.go @@ -1946,3 +1946,23 @@ func TestEndpointCase52(t *testing.T) { t.Errorf("expect %v error in %v", e, a) } } + +// Partition doesn't support DualStack +func TestEndpointCase53(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) + } +} diff --git a/service/cloudformation/serializers.go b/service/cloudformation/serializers.go index 94e3da96198..6cf7b10f776 100644 --- a/service/cloudformation/serializers.go +++ b/service/cloudformation/serializers.go @@ -4878,6 +4878,11 @@ func awsAwsquery_serializeDocumentStackSetOperationPreferences(v *types.StackSet object := value.Object() _ = object + if len(v.ConcurrencyMode) > 0 { + objectKey := object.Key("ConcurrencyMode") + objectKey.String(string(v.ConcurrencyMode)) + } + if v.FailureToleranceCount != nil { objectKey := object.Key("FailureToleranceCount") objectKey.Integer(*v.FailureToleranceCount) diff --git a/service/cloudformation/types/enums.go b/service/cloudformation/types/enums.go index c959df264d8..9adb2a1c125 100644 --- a/service/cloudformation/types/enums.go +++ b/service/cloudformation/types/enums.go @@ -238,6 +238,24 @@ func (ChangeType) Values() []ChangeType { } } +type ConcurrencyMode string + +// Enum values for ConcurrencyMode +const ( + ConcurrencyModeStrictFailureTolerance ConcurrencyMode = "STRICT_FAILURE_TOLERANCE" + ConcurrencyModeSoftFailureTolerance ConcurrencyMode = "SOFT_FAILURE_TOLERANCE" +) + +// Values returns all known values for ConcurrencyMode. Note that this can be +// expanded in the future, and 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 (ConcurrencyMode) Values() []ConcurrencyMode { + return []ConcurrencyMode{ + "STRICT_FAILURE_TOLERANCE", + "SOFT_FAILURE_TOLERANCE", + } +} + type DeprecatedStatus string // Enum values for DeprecatedStatus diff --git a/service/cloudformation/types/types.go b/service/cloudformation/types/types.go index a065c23ef88..faca447f7dd 100644 --- a/service/cloudformation/types/types.go +++ b/service/cloudformation/types/types.go @@ -1797,6 +1797,18 @@ type StackSetOperation struct { // . type StackSetOperationPreferences struct { + // Specifies how the concurrency level behaves during the operation execution. + // - STRICT_FAILURE_TOLERANCE : Dynamically lowers the concurrency level to + // ensure the number of failed accounts never exceeds the FailureToleranceCount + // +1. StackSets will set the actual concurrency of your deployment as the minimum + // value between the MaxConcurrentCount and the FailureToleranceCount +1. This is + // the default behavior. If failure tolerance or Maximum concurrent accounts are + // set to percentages, the behavior is similar. + // - SOFT_FAILURE_TOLERANCE : Always run at the concurrency level set by the user + // in the MaxConcurrentCount or MaxConcurrentPercentage , regardless of the + // number of failures. + ConcurrencyMode ConcurrencyMode + // The number of accounts, per Region, for which this operation can fail before // CloudFormation stops the operation in that Region. If the operation is stopped // in a Region, CloudFormation doesn't attempt the operation in any subsequent @@ -1814,13 +1826,14 @@ type StackSetOperationPreferences struct { FailureTolerancePercentage *int32 // The maximum number of accounts in which to perform this operation at one time. - // This is dependent on the value of FailureToleranceCount . MaxConcurrentCount is - // at most one more than the FailureToleranceCount . Note that this setting lets - // you specify the maximum for operations. For large deployments, under certain - // circumstances the actual number of accounts acted upon concurrently may be lower - // due to service throttling. Conditional: You must specify either - // MaxConcurrentCount or MaxConcurrentPercentage , but not both. By default, 1 is - // specified. + // This can depend on the value of FailureToleranceCount depending on your + // ConcurrencyMode . MaxConcurrentCount is at most one more than the + // FailureToleranceCount if you're using STRICT_FAILURE_TOLERANCE . Note that this + // setting lets you specify the maximum for operations. For large deployments, + // under certain circumstances the actual number of accounts acted upon + // concurrently may be lower due to service throttling. Conditional: You must + // specify either MaxConcurrentCount or MaxConcurrentPercentage , but not both. By + // default, 1 is specified. MaxConcurrentCount *int32 // The maximum percentage of accounts in which to perform this operation at one diff --git a/service/cloudtrail/api_op_CreateTrail.go b/service/cloudtrail/api_op_CreateTrail.go index e730dc8a1c4..bb2116b97ef 100644 --- a/service/cloudtrail/api_op_CreateTrail.go +++ b/service/cloudtrail/api_op_CreateTrail.go @@ -58,7 +58,8 @@ type CreateTrailInput struct { // Specifies a log group name using an Amazon Resource Name (ARN), a unique // identifier that represents the log group to which CloudTrail logs will be // delivered. You must use a log group that exists in your account. Not required - // unless you specify CloudWatchLogsRoleArn . + // unless you specify CloudWatchLogsRoleArn . Only the management account can + // configure a CloudWatch Logs log group for an organization trail. CloudWatchLogsLogGroupArn *string // Specifies the role for the CloudWatch Logs endpoint to assume to write to a diff --git a/service/cloudtrail/api_op_GetInsightSelectors.go b/service/cloudtrail/api_op_GetInsightSelectors.go index 35cb4b6e07c..3c84b05316e 100644 --- a/service/cloudtrail/api_op_GetInsightSelectors.go +++ b/service/cloudtrail/api_op_GetInsightSelectors.go @@ -17,11 +17,15 @@ import ( ) // Describes the settings for the Insights event selectors that you configured for -// your trail. GetInsightSelectors shows if CloudTrail Insights event logging is -// enabled on the trail, and if it is, which insight types are enabled. If you run -// GetInsightSelectors on a trail that does not have Insights events enabled, the -// operation throws the exception InsightNotEnabledException For more information, -// see Logging CloudTrail Insights Events for Trails (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-insights-events-with-cloudtrail.html) +// your trail or event data store. GetInsightSelectors shows if CloudTrail +// Insights event logging is enabled on the trail or event data store, and if it +// is, which Insights types are enabled. If you run GetInsightSelectors on a trail +// or event data store that does not have Insights events enabled, the operation +// throws the exception InsightNotEnabledException Specify either the +// EventDataStore parameter to get Insights event selectors for an event data +// store, or the TrailName parameter to the get Insights event selectors for a +// trail. You cannot specify these parameters together. For more information, see +// Logging CloudTrail Insights events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-insights-events-with-cloudtrail.html) // in the CloudTrail User Guide. func (c *Client) GetInsightSelectors(ctx context.Context, params *GetInsightSelectorsInput, optFns ...func(*Options)) (*GetInsightSelectorsOutput, error) { if params == nil { @@ -40,6 +44,11 @@ func (c *Client) GetInsightSelectors(ctx context.Context, params *GetInsightSele type GetInsightSelectorsInput struct { + // Specifies the ARN (or ID suffix of the ARN) of the event data store for which + // you want to get Insights selectors. You cannot use this parameter with the + // TrailName parameter. + EventDataStore *string + // Specifies the name of the trail or trail ARN. If you specify a trail name, the // string must meet the following requirements: // - Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), @@ -50,9 +59,8 @@ type GetInsightSelectorsInput struct { // and my--namespace are not valid. // - Not be in IP address format (for example, 192.168.5.4) // If you specify a trail ARN, it must be in the format: - // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail - // - // This member is required. + // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail You cannot use this + // parameter with the EventDataStore parameter. TrailName *string noSmithyDocumentSerde @@ -60,11 +68,17 @@ type GetInsightSelectorsInput struct { type GetInsightSelectorsOutput struct { - // A JSON string that contains the insight types you want to log on a trail. In - // this release, ApiErrorRateInsight and ApiCallRateInsight are supported as - // insight types. + // The ARN of the source event data store that enabled Insights events. + EventDataStoreArn *string + + // A JSON string that contains the Insight types you want to log on a trail or + // event data store. ApiErrorRateInsight and ApiCallRateInsight are supported as + // Insights types. InsightSelectors []types.InsightSelector + // The ARN of the destination event data store that logs Insights events. + InsightsDestination *string + // The Amazon Resource Name (ARN) of a trail for which you want to get Insights // selectors. TrailARN *string @@ -126,9 +140,6 @@ func (c *Client) addOperationGetInsightSelectorsMiddlewares(stack *middleware.St if err = addGetInsightSelectorsResolveEndpointMiddleware(stack, options); err != nil { return err } - if err = addOpGetInsightSelectorsValidationMiddleware(stack); err != nil { - return err - } if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetInsightSelectors(options.Region), middleware.Before); err != nil { return err } diff --git a/service/cloudtrail/api_op_LookupEvents.go b/service/cloudtrail/api_op_LookupEvents.go index 56641ffef74..2d64488f407 100644 --- a/service/cloudtrail/api_op_LookupEvents.go +++ b/service/cloudtrail/api_op_LookupEvents.go @@ -20,7 +20,10 @@ import ( // Looks up management events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-concepts.html#cloudtrail-concepts-management-events) // or CloudTrail Insights events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-concepts.html#cloudtrail-concepts-insights-events) // that are captured by CloudTrail. You can look up events that occurred in a -// Region within the last 90 days. Lookup supports the following attributes for +// Region within the last 90 days. LookupEvents returns recent Insights events for +// trails that enable Insights. To view Insights events for an event data store, +// you can run queries on your Insights event data store, and you can also view the +// Lake dashboard for Insights. Lookup supports the following attributes for // management events: // - Amazon Web Services access key // - Event ID diff --git a/service/cloudtrail/api_op_PutInsightSelectors.go b/service/cloudtrail/api_op_PutInsightSelectors.go index 841c7ce1a7f..9cd24684404 100644 --- a/service/cloudtrail/api_op_PutInsightSelectors.go +++ b/service/cloudtrail/api_op_PutInsightSelectors.go @@ -17,14 +17,26 @@ import ( ) // Lets you enable Insights event logging by specifying the Insights selectors -// that you want to enable on an existing trail. You also use PutInsightSelectors -// to turn off Insights event logging, by passing an empty list of insight types. -// The valid Insights event types in this release are ApiErrorRateInsight and -// ApiCallRateInsight . To log CloudTrail Insights events on API call volume, the -// trail must log write management events. To log CloudTrail Insights events on -// API error rate, the trail must log read or write management events. You can +// that you want to enable on an existing trail or event data store. You also use +// PutInsightSelectors to turn off Insights event logging, by passing an empty list +// of Insights types. The valid Insights event types are ApiErrorRateInsight and +// ApiCallRateInsight . To enable Insights on an event data store, you must specify +// the ARNs (or ID suffix of the ARNs) for the source event data store ( +// EventDataStore ) and the destination event data store ( InsightsDestination ). +// The source event data store logs management events and enables Insights. The +// destination event data store logs Insights events based upon the management +// event activity of the source event data store. The source and destination event +// data stores must belong to the same Amazon Web Services account. To log Insights +// events for a trail, you must specify the name ( TrailName ) of the CloudTrail +// trail for which you want to change or add Insights selectors. To log CloudTrail +// Insights events on API call volume, the trail or event data store must log write +// management events. To log CloudTrail Insights events on API error rate, the +// trail or event data store must log read or write management events. You can // call GetEventSelectors on a trail to check whether the trail logs management -// events. +// events. You can call GetEventDataStore on an event data store to check whether +// the event data store logs management events. For more information, see Logging +// CloudTrail Insights events (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/logging-insights-events-with-cloudtrail.html) +// in the CloudTrail User Guide. func (c *Client) PutInsightSelectors(ctx context.Context, params *PutInsightSelectorsInput, optFns ...func(*Options)) (*PutInsightSelectorsOutput, error) { if params == nil { params = &PutInsightSelectorsInput{} @@ -42,20 +54,31 @@ func (c *Client) PutInsightSelectors(ctx context.Context, params *PutInsightSele type PutInsightSelectorsInput struct { - // A JSON string that contains the insight types you want to log on a trail. - // ApiCallRateInsight and ApiErrorRateInsight are valid Insight types. The - // ApiCallRateInsight Insights type analyzes write-only management API calls that - // are aggregated per minute against a baseline API call volume. The + // A JSON string that contains the Insights types you want to log on a trail or + // event data store. ApiCallRateInsight and ApiErrorRateInsight are valid Insight + // types. The ApiCallRateInsight Insights type analyzes write-only management API + // calls that are aggregated per minute against a baseline API call volume. The // ApiErrorRateInsight Insights type analyzes management API calls that result in // error codes. The error is shown if the API call is unsuccessful. // // This member is required. InsightSelectors []types.InsightSelector + // The ARN (or ID suffix of the ARN) of the source event data store for which you + // want to change or add Insights selectors. To enable Insights on an event data + // store, you must provide both the EventDataStore and InsightsDestination + // parameters. You cannot use this parameter with the TrailName parameter. + EventDataStore *string + + // The ARN (or ID suffix of the ARN) of the destination event data store that logs + // Insights events. To enable Insights on an event data store, you must provide + // both the EventDataStore and InsightsDestination parameters. You cannot use this + // parameter with the TrailName parameter. + InsightsDestination *string + // The name of the CloudTrail trail for which you want to change or add Insights - // selectors. - // - // This member is required. + // selectors. You cannot use this parameter with the EventDataStore and + // InsightsDestination parameters. TrailName *string noSmithyDocumentSerde @@ -63,11 +86,18 @@ type PutInsightSelectorsInput struct { type PutInsightSelectorsOutput struct { + // The Amazon Resource Name (ARN) of the source event data store for which you + // want to change or add Insights selectors. + EventDataStoreArn *string + // A JSON string that contains the Insights event types that you want to log on a - // trail. The valid Insights types in this release are ApiErrorRateInsight and + // trail or event data store. The valid Insights types are ApiErrorRateInsight and // ApiCallRateInsight . InsightSelectors []types.InsightSelector + // The ARN of the destination event data store that logs Insights events. + InsightsDestination *string + // The Amazon Resource Name (ARN) of a trail for which you want to change or add // Insights selectors. TrailARN *string diff --git a/service/cloudtrail/api_op_RegisterOrganizationDelegatedAdmin.go b/service/cloudtrail/api_op_RegisterOrganizationDelegatedAdmin.go index dbf355d32b2..d2d69c3166d 100644 --- a/service/cloudtrail/api_op_RegisterOrganizationDelegatedAdmin.go +++ b/service/cloudtrail/api_op_RegisterOrganizationDelegatedAdmin.go @@ -16,7 +16,8 @@ import ( ) // Registers an organization’s member account as the CloudTrail delegated -// administrator. +// administrator (https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-delegated-administrator.html) +// . func (c *Client) RegisterOrganizationDelegatedAdmin(ctx context.Context, params *RegisterOrganizationDelegatedAdminInput, optFns ...func(*Options)) (*RegisterOrganizationDelegatedAdminOutput, error) { if params == nil { params = &RegisterOrganizationDelegatedAdminInput{} diff --git a/service/cloudtrail/api_op_UpdateEventDataStore.go b/service/cloudtrail/api_op_UpdateEventDataStore.go index f42777ab9ef..dac06d5ed33 100644 --- a/service/cloudtrail/api_op_UpdateEventDataStore.go +++ b/service/cloudtrail/api_op_UpdateEventDataStore.go @@ -22,9 +22,9 @@ import ( // parameter must be specified, or CloudTrail throws an error. RetentionPeriod is // in days, and valid values are integers between 90 and 2557. By default, // TerminationProtection is enabled. For event data stores for CloudTrail events, -// AdvancedEventSelectors includes or excludes management and data events in your -// event data store. For more information about AdvancedEventSelectors , see -// AdvancedEventSelectors (https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedEventSelector.html) +// AdvancedEventSelectors includes or excludes management, data, or Insights events +// in your event data store. For more information about AdvancedEventSelectors , +// see AdvancedEventSelectors (https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedEventSelector.html) // . For event data stores for Config configuration items, Audit Manager evidence, // or non-Amazon Web Services events, AdvancedEventSelectors includes events of // that type in your event data store. @@ -81,7 +81,10 @@ type UpdateEventDataStoreInput struct { Name *string // Specifies whether an event data store collects events logged for an - // organization in Organizations. + // organization in Organizations. Only the management account for the organization + // can convert an organization event data store to a non-organization event data + // store, or convert a non-organization event data store to an organization event + // data store. OrganizationEnabled *bool // The retention period of the event data store, in days. You can set a retention diff --git a/service/cloudtrail/api_op_UpdateTrail.go b/service/cloudtrail/api_op_UpdateTrail.go index e4b9f1e343e..36e0e76cd26 100644 --- a/service/cloudtrail/api_op_UpdateTrail.go +++ b/service/cloudtrail/api_op_UpdateTrail.go @@ -57,7 +57,8 @@ type UpdateTrailInput struct { // Specifies a log group name using an Amazon Resource Name (ARN), a unique // identifier that represents the log group to which CloudTrail logs are delivered. // You must use a log group that exists in your account. Not required unless you - // specify CloudWatchLogsRoleArn . + // specify CloudWatchLogsRoleArn . Only the management account can configure a + // CloudWatch Logs log group for an organization trail. CloudWatchLogsLogGroupArn *string // Specifies the role for the CloudWatch Logs endpoint to assume to write to a @@ -91,13 +92,15 @@ type UpdateTrailInput struct { // Specifies whether the trail is applied to all accounts in an organization in // Organizations, or only for the current Amazon Web Services account. The default // is false, and cannot be true unless the call is made on behalf of an Amazon Web - // Services account that is the management account or delegated administrator - // account for an organization in Organizations. If the trail is not an - // organization trail and this is set to true , the trail will be created in all - // Amazon Web Services accounts that belong to the organization. If the trail is an - // organization trail and this is set to false , the trail will remain in the - // current Amazon Web Services account but be deleted from all member accounts in - // the organization. + // Services account that is the management account for an organization in + // Organizations. If the trail is not an organization trail and this is set to true + // , the trail will be created in all Amazon Web Services accounts that belong to + // the organization. If the trail is an organization trail and this is set to false + // , the trail will remain in the current Amazon Web Services account but be + // deleted from all member accounts in the organization. Only the management + // account for the organization can convert an organization trail to a + // non-organization trail, or convert a non-organization trail to an organization + // trail. IsOrganizationTrail *bool // Specifies the KMS key ID to use to encrypt the logs delivered by CloudTrail. diff --git a/service/cloudtrail/deserializers.go b/service/cloudtrail/deserializers.go index b374af00080..7035d66c20c 100644 --- a/service/cloudtrail/deserializers.go +++ b/service/cloudtrail/deserializers.go @@ -2344,6 +2344,12 @@ func awsAwsjson11_deserializeOpErrorGetInsightSelectors(response *smithyhttp.Res case strings.EqualFold("InsightNotEnabledException", errorCode): return awsAwsjson11_deserializeErrorInsightNotEnabledException(response, errorBody) + case strings.EqualFold("InvalidParameterCombinationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterCombinationException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("InvalidTrailNameException", errorCode): return awsAwsjson11_deserializeErrorInvalidTrailNameException(response, errorBody) @@ -4270,6 +4276,12 @@ func awsAwsjson11_deserializeOpErrorPutInsightSelectors(response *smithyhttp.Res case strings.EqualFold("InvalidInsightSelectorsException", errorCode): return awsAwsjson11_deserializeErrorInvalidInsightSelectorsException(response, errorBody) + case strings.EqualFold("InvalidParameterCombinationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterCombinationException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("InvalidTrailNameException", errorCode): return awsAwsjson11_deserializeErrorInvalidTrailNameException(response, errorBody) @@ -6112,6 +6124,9 @@ func awsAwsjson11_deserializeOpErrorUpdateEventDataStore(response *smithyhttp.Re case strings.EqualFold("InvalidEventSelectorsException", errorCode): return awsAwsjson11_deserializeErrorInvalidEventSelectorsException(response, errorBody) + case strings.EqualFold("InvalidInsightSelectorsException", errorCode): + return awsAwsjson11_deserializeErrorInvalidInsightSelectorsException(response, errorBody) + case strings.EqualFold("InvalidKmsKeyIdException", errorCode): return awsAwsjson11_deserializeErrorInvalidKmsKeyIdException(response, errorBody) @@ -16154,6 +16169,24 @@ func awsAwsjson11_deserializeOpDocumentGetInsightSelectorsOutput(v **GetInsightS for key, value := range shape { switch key { + case "EventDataStoreArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventDataStoreArn to be of type string, got %T instead", value) + } + sv.EventDataStoreArn = ptr.String(jtv) + } + + case "InsightsDestination": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventDataStoreArn to be of type string, got %T instead", value) + } + sv.InsightsDestination = ptr.String(jtv) + } + case "InsightSelectors": if err := awsAwsjson11_deserializeDocumentInsightSelectors(&sv.InsightSelectors, value); err != nil { return err @@ -17033,6 +17066,24 @@ func awsAwsjson11_deserializeOpDocumentPutInsightSelectorsOutput(v **PutInsightS for key, value := range shape { switch key { + case "EventDataStoreArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventDataStoreArn to be of type string, got %T instead", value) + } + sv.EventDataStoreArn = ptr.String(jtv) + } + + case "InsightsDestination": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventDataStoreArn to be of type string, got %T instead", value) + } + sv.InsightsDestination = ptr.String(jtv) + } + case "InsightSelectors": if err := awsAwsjson11_deserializeDocumentInsightSelectors(&sv.InsightSelectors, value); err != nil { return err diff --git a/service/cloudtrail/endpoints.go b/service/cloudtrail/endpoints.go index 550abd99bcc..9f6d0a9bc27 100644 --- a/service/cloudtrail/endpoints.go +++ b/service/cloudtrail/endpoints.go @@ -430,7 +430,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { if _Region == "us-gov-east-1" { uriString := "https://cloudtrail.us-gov-east-1.amazonaws.com" diff --git a/service/cloudtrail/serializers.go b/service/cloudtrail/serializers.go index 0847a423277..fd41158e712 100644 --- a/service/cloudtrail/serializers.go +++ b/service/cloudtrail/serializers.go @@ -3293,6 +3293,11 @@ func awsAwsjson11_serializeOpDocumentGetInsightSelectorsInput(v *GetInsightSelec object := value.Object() defer object.Close() + if v.EventDataStore != nil { + ok := object.Key("EventDataStore") + ok.String(*v.EventDataStore) + } + if v.TrailName != nil { ok := object.Key("TrailName") ok.String(*v.TrailName) @@ -3606,6 +3611,16 @@ func awsAwsjson11_serializeOpDocumentPutInsightSelectorsInput(v *PutInsightSelec object := value.Object() defer object.Close() + if v.EventDataStore != nil { + ok := object.Key("EventDataStore") + ok.String(*v.EventDataStore) + } + + if v.InsightsDestination != nil { + ok := object.Key("InsightsDestination") + ok.String(*v.InsightsDestination) + } + if v.InsightSelectors != nil { ok := object.Key("InsightSelectors") if err := awsAwsjson11_serializeDocumentInsightSelectors(v.InsightSelectors, ok); err != nil { diff --git a/service/cloudtrail/types/errors.go b/service/cloudtrail/types/errors.go index 205f4747985..2646ba01309 100644 --- a/service/cloudtrail/types/errors.go +++ b/service/cloudtrail/types/errors.go @@ -307,12 +307,10 @@ func (e *CloudTrailAccessNotEnabledException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// This exception is thrown when an operation is called with a trail ARN that is -// not valid. The following is the format of a trail ARN. -// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail This exception is also -// thrown when you call AddTags or RemoveTags on a trail, event data store, or -// channel with a resource ARN that is not valid. The following is the format of an -// event data store ARN: +// This exception is thrown when an operation is called with an ARN that is not +// valid. The following is the format of a trail ARN: +// arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail The following is the +// format of an event data store ARN: // arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE // The following is the format of a channel ARN: // arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 @@ -705,8 +703,9 @@ func (e *InactiveQueryException) ErrorCode() string { } func (e *InactiveQueryException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// If you run GetInsightSelectors on a trail that does not have Insights events -// enabled, the operation throws the exception InsightNotEnabledException . +// If you run GetInsightSelectors on a trail or event data store that does not +// have Insights events enabled, the operation throws the exception +// InsightNotEnabledException . type InsightNotEnabledException struct { Message *string @@ -1114,10 +1113,19 @@ func (e *InvalidImportSourceException) ErrorCode() string { } func (e *InvalidImportSourceException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The formatting or syntax of the InsightSelectors JSON statement in your -// PutInsightSelectors or GetInsightSelectors request is not valid, or the -// specified insight type in the InsightSelectors statement is not a valid insight -// type. +// For PutInsightSelectors , this exception is thrown when the formatting or syntax +// of the InsightSelectors JSON statement is not valid, or the specified +// InsightType in the InsightSelectors statement is not valid. Valid values for +// InsightType are ApiCallRateInsight and ApiErrorRateInsight . To enable Insights +// on an event data store, the destination event data store specified by the +// InsightsDestination parameter must log Insights events and the source event data +// store specified by the EventDataStore parameter must log management events. For +// UpdateEventDataStore , this exception is thrown if Insights are enabled on the +// event data store and the updated advanced event selectors are not compatible +// with the configured InsightSelectors . If the InsightSelectors includes an +// InsightType of ApiCallRateInsight , the source event data store must log write +// management events. If the InsightSelectors includes an InsightType of +// ApiErrorRateInsight , the source event data store must log management events. type InvalidInsightSelectorsException struct { Message *string diff --git a/service/cloudtrail/types/types.go b/service/cloudtrail/types/types.go index 5043508ed01..d034bf6a3d1 100644 --- a/service/cloudtrail/types/types.go +++ b/service/cloudtrail/types/types.go @@ -48,13 +48,14 @@ type AdvancedFieldSelector struct { // - readOnly - Optional. Can be set to Equals a value of true or false . If you // do not add this field, CloudTrail logs both read and write events. A value of // true logs only read events. A value of false logs only write events. - // - eventSource - For filtering management events only. This can be set only to - // NotEquals kms.amazonaws.com . + // - eventSource - For filtering management events only. This can be set to + // NotEquals kms.amazonaws.com or NotEquals rdsdata.amazonaws.com . // - eventName - Can use any operator. You can use it to filter in or filter out // any data event logged to CloudTrail, such as PutBucket or GetSnapshotBlock . // You can have multiple values for this field, separated by commas. // - eventCategory - This is required and must be set to Equals . // - For CloudTrail event records, the value must be Management or Data . + // - For CloudTrail Insights event records, the value must be Insight . // - For Config configuration items, the value must be ConfigurationItem . // - For Audit Manager evidence, the value must be Evidence . // - For non-Amazon Web Services events, the value must be ActivityAuditLog . @@ -65,6 +66,7 @@ type AdvancedFieldSelector struct { // - AWS::Lambda::Function // - AWS::S3::Object // - AWS::CloudTrail::Channel + // - AWS::CodeWhisperer::Customization // - AWS::CodeWhisperer::Profile // - AWS::Cognito::IdentityPool // - AWS::DynamoDB::Stream @@ -74,15 +76,22 @@ type AdvancedFieldSelector struct { // - AWS::Glue::Table // - AWS::GuardDuty::Detector // - AWS::KendraRanking::ExecutionPlan + // - AWS::KinesisVideo::Stream // - AWS::ManagedBlockchain::Network // - AWS::ManagedBlockchain::Node // - AWS::MedicalImaging::Datastore + // - AWS::PCAConnectorAD::Connector + // - AWS::SageMaker::Endpoint // - AWS::SageMaker::ExperimentTrialComponent // - AWS::SageMaker::FeatureGroup + // - AWS::SNS::PlatformEndpoint + // - AWS::SNS::Topic // - AWS::S3::AccessPoint // - AWS::S3ObjectLambda::AccessPoint // - AWS::S3Outposts::Object // - AWS::SSMMessages::ControlChannel + // - AWS::Timestream::Database + // - AWS::Timestream::Table // - AWS::VerifiedPermissions::PolicyStore You can have only one resources.type // field per selector. To log data events on more than one resource type, add // another selector. @@ -106,6 +115,9 @@ type AdvancedFieldSelector struct { // , and the operator is set to Equals or NotEquals , the ARN must be in the // following format: // - arn::cloudtrail:::channel/ When resources.type equals + // AWS::CodeWhisperer::Customization , and the operator is set to Equals or + // NotEquals , the ARN must be in the following format: + // - arn::codewhisperer:::customization/ When resources.type equals // AWS::CodeWhisperer::Profile , and the operator is set to Equals or NotEquals , // the ARN must be in the following format: // - arn::codewhisperer:::profile/ When resources.type equals @@ -133,6 +145,9 @@ type AdvancedFieldSelector struct { // AWS::KendraRanking::ExecutionPlan , and the operator is set to Equals or // NotEquals , the ARN must be in the following format: // - arn::kendra-ranking:::rescore-execution-plan/ When resources.type equals + // AWS::KinesisVideo::Stream , and the operator is set to Equals or NotEquals , + // the ARN must be in the following format: + // - arn::kinesisvideo:::stream/ When resources.type equals // AWS::ManagedBlockchain::Network , and the operator is set to Equals or // NotEquals , the ARN must be in the following format: // - arn::managedblockchain:::networks/ When resources.type equals @@ -142,16 +157,28 @@ type AdvancedFieldSelector struct { // AWS::MedicalImaging::Datastore , and the operator is set to Equals or // NotEquals , the ARN must be in the following format: // - arn::medical-imaging:::datastore/ When resources.type equals + // AWS::PCAConnectorAD::Connector , and the operator is set to Equals or + // NotEquals , the ARN must be in the following format: + // - arn::pca-connector-ad:::connector/ When resources.type equals + // AWS::SageMaker::Endpoint , and the operator is set to Equals or NotEquals , + // the ARN must be in the following format: + // - arn::sagemaker:::endpoint/ When resources.type equals // AWS::SageMaker::ExperimentTrialComponent , and the operator is set to Equals // or NotEquals , the ARN must be in the following format: // - arn::sagemaker:::experiment-trial-component/ When resources.type equals // AWS::SageMaker::FeatureGroup , and the operator is set to Equals or NotEquals // , the ARN must be in the following format: // - arn::sagemaker:::feature-group/ When resources.type equals - // AWS::S3::AccessPoint , and the operator is set to Equals or NotEquals , the - // ARN must be in one of the following formats. To log events on all objects in an - // S3 access point, we recommend that you use only the access point ARN, don’t - // include the object path, and use the StartsWith or NotStartsWith operators. + // AWS::SNS::PlatformEndpoint , and the operator is set to Equals or NotEquals , + // the ARN must be in the following format: + // - arn::sns:::endpoint/// When resources.type equals AWS::SNS::Topic , and the + // operator is set to Equals or NotEquals , the ARN must be in the following + // format: + // - arn::sns::: When resources.type equals AWS::S3::AccessPoint , and the + // operator is set to Equals or NotEquals , the ARN must be in one of the + // following formats. To log events on all objects in an S3 access point, we + // recommend that you use only the access point ARN, don’t include the object path, + // and use the StartsWith or NotStartsWith operators. // - arn::s3:::accesspoint/ // - arn::s3:::accesspoint//object/ When resources.type equals // AWS::S3ObjectLambda::AccessPoint , and the operator is set to Equals or @@ -163,6 +190,12 @@ type AdvancedFieldSelector struct { // AWS::SSMMessages::ControlChannel , and the operator is set to Equals or // NotEquals , the ARN must be in the following format: // - arn::ssmmessages:::control-channel/ When resources.type equals + // AWS::Timestream::Database , and the operator is set to Equals or NotEquals , + // the ARN must be in the following format: + // - arn::timestream:::database/ When resources.type equals + // AWS::Timestream::Table , and the operator is set to Equals or NotEquals , the + // ARN must be in the following format: + // - arn::timestream:::database//table/ When resources.type equals // AWS::VerifiedPermissions::PolicyStore , and the operator is set to Equals or // NotEquals , the ARN must be in the following format: // - arn::verifiedpermissions:::policy-store/ @@ -261,6 +294,7 @@ type DataResource struct { // event selectors. For more information, see AdvancedFieldSelector (https://docs.aws.amazon.com/awscloudtrail/latest/APIReference/API_AdvancedFieldSelector.html) // . // - AWS::CloudTrail::Channel + // - AWS::CodeWhisperer::Customization // - AWS::CodeWhisperer::Profile // - AWS::Cognito::IdentityPool // - AWS::DynamoDB::Stream @@ -270,15 +304,22 @@ type DataResource struct { // - AWS::Glue::Table // - AWS::GuardDuty::Detector // - AWS::KendraRanking::ExecutionPlan + // - AWS::KinesisVideo::Stream // - AWS::ManagedBlockchain::Network // - AWS::ManagedBlockchain::Node // - AWS::MedicalImaging::Datastore + // - AWS::PCAConnectorAD::Connector + // - AWS::SageMaker::Endpoint // - AWS::SageMaker::ExperimentTrialComponent // - AWS::SageMaker::FeatureGroup + // - AWS::SNS::PlatformEndpoint + // - AWS::SNS::Topic // - AWS::S3::AccessPoint // - AWS::S3ObjectLambda::AccessPoint // - AWS::S3Outposts::Object // - AWS::SSMMessages::ControlChannel + // - AWS::Timestream::Database + // - AWS::Timestream::Table // - AWS::VerifiedPermissions::PolicyStore Type *string @@ -578,15 +619,16 @@ type IngestionStatus struct { noSmithyDocumentSerde } -// A JSON string that contains a list of Insights types that are logged on a trail. +// A JSON string that contains a list of Insights types that are logged on a trail +// or event data store. type InsightSelector struct { - // The type of Insights events to log on a trail. ApiCallRateInsight and - // ApiErrorRateInsight are valid Insight types. The ApiCallRateInsight Insights - // type analyzes write-only management API calls that are aggregated per minute - // against a baseline API call volume. The ApiErrorRateInsight Insights type - // analyzes management API calls that result in error codes. The error is shown if - // the API call is unsuccessful. + // The type of Insights events to log on a trail or event data store. + // ApiCallRateInsight and ApiErrorRateInsight are valid Insight types. The + // ApiCallRateInsight Insights type analyzes write-only management API calls that + // are aggregated per minute against a baseline API call volume. The + // ApiErrorRateInsight Insights type analyzes management API calls that result in + // error codes. The error is shown if the API call is unsuccessful. InsightType InsightType noSmithyDocumentSerde diff --git a/service/cloudtrail/validators.go b/service/cloudtrail/validators.go index 96eee335527..76a32400c82 100644 --- a/service/cloudtrail/validators.go +++ b/service/cloudtrail/validators.go @@ -290,26 +290,6 @@ func (m *validateOpGetImport) HandleInitialize(ctx context.Context, in middlewar return next.HandleInitialize(ctx, in) } -type validateOpGetInsightSelectors struct { -} - -func (*validateOpGetInsightSelectors) ID() string { - return "OperationInputValidation" -} - -func (m *validateOpGetInsightSelectors) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( - out middleware.InitializeOutput, metadata middleware.Metadata, err error, -) { - input, ok := in.Parameters.(*GetInsightSelectorsInput) - if !ok { - return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) - } - if err := validateOpGetInsightSelectorsInput(input); err != nil { - return out, metadata, err - } - return next.HandleInitialize(ctx, in) -} - type validateOpGetQueryResults struct { } @@ -826,10 +806,6 @@ func addOpGetImportValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetImport{}, middleware.After) } -func addOpGetInsightSelectorsValidationMiddleware(stack *middleware.Stack) error { - return stack.Initialize.Add(&validateOpGetInsightSelectors{}, middleware.After) -} - func addOpGetQueryResultsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetQueryResults{}, middleware.After) } @@ -1382,21 +1358,6 @@ func validateOpGetImportInput(v *GetImportInput) error { } } -func validateOpGetInsightSelectorsInput(v *GetInsightSelectorsInput) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "GetInsightSelectorsInput"} - if v.TrailName == nil { - invalidParams.Add(smithy.NewErrParamRequired("TrailName")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - func validateOpGetQueryResultsInput(v *GetQueryResultsInput) error { if v == nil { return nil @@ -1544,9 +1505,6 @@ func validateOpPutInsightSelectorsInput(v *PutInsightSelectorsInput) error { return nil } invalidParams := smithy.InvalidParamsError{Context: "PutInsightSelectorsInput"} - if v.TrailName == nil { - invalidParams.Add(smithy.NewErrParamRequired("TrailName")) - } if v.InsightSelectors == nil { invalidParams.Add(smithy.NewErrParamRequired("InsightSelectors")) } diff --git a/service/cloudwatchlogs/api_op_CreateDelivery.go b/service/cloudwatchlogs/api_op_CreateDelivery.go new file mode 100644 index 00000000000..127616b162f --- /dev/null +++ b/service/cloudwatchlogs/api_op_CreateDelivery.go @@ -0,0 +1,298 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a delivery. A delivery is a connection between a logical delivery +// source and a logical delivery destination that you have already created. Only +// some Amazon Web Services services support being configured as a delivery source +// using this operation. These services are listed as Supported [V2 Permissions] in +// the table at Enabling logging from Amazon Web Services services. (https://docs.aws.amazon.com/ AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html#AWS-vended-logs-permissions) +// A delivery destination can represent a log group in CloudWatch Logs, an Amazon +// S3 bucket, or a delivery stream in Kinesis Data Firehose. To configure logs +// delivery between a supported Amazon Web Services service and a destination, you +// must do the following: +// - Create a delivery source, which is a logical object that represents the +// resource that is actually sending the logs. For more information, see +// PutDeliverySource (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliverySource.html) +// . +// - Create a delivery destination, which is a logical object that represents +// the actual delivery destination. For more information, see +// PutDeliveryDestination (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestination.html) +// . +// - If you are delivering logs cross-account, you must use +// PutDeliveryDestinationPolicy (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestinationolicy.html) +// in the destination account to assign an IAM policy to the destination. This +// policy allows delivery to that destination. +// - Use CreateDelivery to create a delivery by pairing exactly one delivery +// source and one delivery destination. +// +// You can configure a single delivery source to send logs to multiple +// destinations by creating multiple deliveries. You can also create multiple +// deliveries to configure multiple delivery sources to send logs to the same +// delivery destination. You can't update an existing delivery. You can only create +// and delete deliveries. +func (c *Client) CreateDelivery(ctx context.Context, params *CreateDeliveryInput, optFns ...func(*Options)) (*CreateDeliveryOutput, error) { + if params == nil { + params = &CreateDeliveryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDelivery", params, optFns, c.addOperationCreateDeliveryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDeliveryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDeliveryInput struct { + + // The ARN of the delivery destination to use for this delivery. + // + // This member is required. + DeliveryDestinationArn *string + + // The name of the delivery source to use for this delivery. + // + // This member is required. + DeliverySourceName *string + + // An optional list of key-value pairs to associate with the resource. For more + // information about tagging, see Tagging Amazon Web Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateDeliveryOutput struct { + + // A structure that contains information about the delivery that you just created. + Delivery *types.Delivery + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDeliveryMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateDelivery{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateDelivery{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addCreateDeliveryResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateDeliveryValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDelivery(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateDelivery(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "logs", + OperationName: "CreateDelivery", + } +} + +type opCreateDeliveryResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opCreateDeliveryResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opCreateDeliveryResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "logs" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "logs" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("logs") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addCreateDeliveryResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opCreateDeliveryResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/cloudwatchlogs/api_op_DeleteDelivery.go b/service/cloudwatchlogs/api_op_DeleteDelivery.go new file mode 100644 index 00000000000..dabb0468ae4 --- /dev/null +++ b/service/cloudwatchlogs/api_op_DeleteDelivery.go @@ -0,0 +1,261 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes s delivery. A delivery is a connection between a logical delivery +// source and a logical delivery destination. Deleting a delivery only deletes the +// connection between the delivery source and delivery destination. It does not +// delete the delivery destination or the delivery source. +func (c *Client) DeleteDelivery(ctx context.Context, params *DeleteDeliveryInput, optFns ...func(*Options)) (*DeleteDeliveryOutput, error) { + if params == nil { + params = &DeleteDeliveryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDelivery", params, optFns, c.addOperationDeleteDeliveryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDeliveryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDeliveryInput struct { + + // The unique ID of the delivery to delete. You can find the ID of a delivery with + // the DescribeDeliveries (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeDeliveries.html) + // operation. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type DeleteDeliveryOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDeliveryMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteDelivery{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteDelivery{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addDeleteDeliveryResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteDeliveryValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDelivery(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDelivery(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "logs", + OperationName: "DeleteDelivery", + } +} + +type opDeleteDeliveryResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDeleteDeliveryResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDeleteDeliveryResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "logs" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "logs" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("logs") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDeleteDeliveryResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDeleteDeliveryResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/cloudwatchlogs/api_op_DeleteDeliveryDestination.go b/service/cloudwatchlogs/api_op_DeleteDeliveryDestination.go new file mode 100644 index 00000000000..b376d69c3bd --- /dev/null +++ b/service/cloudwatchlogs/api_op_DeleteDeliveryDestination.go @@ -0,0 +1,263 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a delivery destination. A delivery is a connection between a logical +// delivery source and a logical delivery destination. You can't delete a delivery +// destination if any current deliveries are associated with it. To find whether +// any deliveries are associated with this delivery destination, use the +// DescribeDeliveries (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeDeliveries.html) +// operation and check the deliveryDestinationArn field in the results. +func (c *Client) DeleteDeliveryDestination(ctx context.Context, params *DeleteDeliveryDestinationInput, optFns ...func(*Options)) (*DeleteDeliveryDestinationOutput, error) { + if params == nil { + params = &DeleteDeliveryDestinationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDeliveryDestination", params, optFns, c.addOperationDeleteDeliveryDestinationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDeliveryDestinationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDeliveryDestinationInput struct { + + // The name of the delivery destination that you want to delete. You can find a + // list of delivery destionation names by using the DescribeDeliveryDestinations (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeDeliveryDestinations.html) + // operation. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type DeleteDeliveryDestinationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDeliveryDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteDeliveryDestination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteDeliveryDestination{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addDeleteDeliveryDestinationResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteDeliveryDestinationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDeliveryDestination(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDeliveryDestination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "logs", + OperationName: "DeleteDeliveryDestination", + } +} + +type opDeleteDeliveryDestinationResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDeleteDeliveryDestinationResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDeleteDeliveryDestinationResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "logs" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "logs" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("logs") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDeleteDeliveryDestinationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDeleteDeliveryDestinationResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/cloudwatchlogs/api_op_DeleteDeliveryDestinationPolicy.go b/service/cloudwatchlogs/api_op_DeleteDeliveryDestinationPolicy.go new file mode 100644 index 00000000000..21b30f3d3e0 --- /dev/null +++ b/service/cloudwatchlogs/api_op_DeleteDeliveryDestinationPolicy.go @@ -0,0 +1,258 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a delivery destination policy. For more information about these +// policies, see PutDeliveryDestinationPolicy (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestinationPolicy.html) +// . +func (c *Client) DeleteDeliveryDestinationPolicy(ctx context.Context, params *DeleteDeliveryDestinationPolicyInput, optFns ...func(*Options)) (*DeleteDeliveryDestinationPolicyOutput, error) { + if params == nil { + params = &DeleteDeliveryDestinationPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDeliveryDestinationPolicy", params, optFns, c.addOperationDeleteDeliveryDestinationPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDeliveryDestinationPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDeliveryDestinationPolicyInput struct { + + // The name of the delivery destination that you want to delete the policy for. + // + // This member is required. + DeliveryDestinationName *string + + noSmithyDocumentSerde +} + +type DeleteDeliveryDestinationPolicyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDeliveryDestinationPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteDeliveryDestinationPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteDeliveryDestinationPolicy{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addDeleteDeliveryDestinationPolicyResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteDeliveryDestinationPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDeliveryDestinationPolicy(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDeliveryDestinationPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "logs", + OperationName: "DeleteDeliveryDestinationPolicy", + } +} + +type opDeleteDeliveryDestinationPolicyResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDeleteDeliveryDestinationPolicyResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDeleteDeliveryDestinationPolicyResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "logs" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "logs" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("logs") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDeleteDeliveryDestinationPolicyResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDeleteDeliveryDestinationPolicyResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/cloudwatchlogs/api_op_DeleteDeliverySource.go b/service/cloudwatchlogs/api_op_DeleteDeliverySource.go new file mode 100644 index 00000000000..2bd72fb2c89 --- /dev/null +++ b/service/cloudwatchlogs/api_op_DeleteDeliverySource.go @@ -0,0 +1,260 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a delivery source. A delivery is a connection between a logical +// delivery source and a logical delivery destination. You can't delete a delivery +// source if any current deliveries are associated with it. To find whether any +// deliveries are associated with this delivery source, use the DescribeDeliveries (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeDeliveries.html) +// operation and check the deliverySourceName field in the results. +func (c *Client) DeleteDeliverySource(ctx context.Context, params *DeleteDeliverySourceInput, optFns ...func(*Options)) (*DeleteDeliverySourceOutput, error) { + if params == nil { + params = &DeleteDeliverySourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDeliverySource", params, optFns, c.addOperationDeleteDeliverySourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDeliverySourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDeliverySourceInput struct { + + // The name of the delivery source that you want to delete. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type DeleteDeliverySourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDeliverySourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteDeliverySource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteDeliverySource{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addDeleteDeliverySourceResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteDeliverySourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDeliverySource(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDeliverySource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "logs", + OperationName: "DeleteDeliverySource", + } +} + +type opDeleteDeliverySourceResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDeleteDeliverySourceResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDeleteDeliverySourceResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "logs" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "logs" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("logs") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDeleteDeliverySourceResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDeleteDeliverySourceResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/cloudwatchlogs/api_op_DescribeDeliveries.go b/service/cloudwatchlogs/api_op_DescribeDeliveries.go new file mode 100644 index 00000000000..d212c0f0e70 --- /dev/null +++ b/service/cloudwatchlogs/api_op_DescribeDeliveries.go @@ -0,0 +1,354 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a list of the deliveries that have been created in the account. +func (c *Client) DescribeDeliveries(ctx context.Context, params *DescribeDeliveriesInput, optFns ...func(*Options)) (*DescribeDeliveriesOutput, error) { + if params == nil { + params = &DescribeDeliveriesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDeliveries", params, optFns, c.addOperationDescribeDeliveriesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDeliveriesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDeliveriesInput struct { + + // Optionally specify the maximum number of deliveries to return in the response. + Limit *int32 + + // The token for the next set of items to return. The token expires after 24 hours. + NextToken *string + + noSmithyDocumentSerde +} + +type DescribeDeliveriesOutput struct { + + // An array of structures. Each structure contains information about one delivery + // in the account. + Deliveries []types.Delivery + + // The token for the next set of items to return. The token expires after 24 hours. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDeliveriesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeDeliveries{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeDeliveries{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addDescribeDeliveriesResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDeliveries(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// DescribeDeliveriesAPIClient is a client that implements the DescribeDeliveries +// operation. +type DescribeDeliveriesAPIClient interface { + DescribeDeliveries(context.Context, *DescribeDeliveriesInput, ...func(*Options)) (*DescribeDeliveriesOutput, error) +} + +var _ DescribeDeliveriesAPIClient = (*Client)(nil) + +// DescribeDeliveriesPaginatorOptions is the paginator options for +// DescribeDeliveries +type DescribeDeliveriesPaginatorOptions struct { + // Optionally specify the maximum number of deliveries to return in the response. + 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 +} + +// DescribeDeliveriesPaginator is a paginator for DescribeDeliveries +type DescribeDeliveriesPaginator struct { + options DescribeDeliveriesPaginatorOptions + client DescribeDeliveriesAPIClient + params *DescribeDeliveriesInput + nextToken *string + firstPage bool +} + +// NewDescribeDeliveriesPaginator returns a new DescribeDeliveriesPaginator +func NewDescribeDeliveriesPaginator(client DescribeDeliveriesAPIClient, params *DescribeDeliveriesInput, optFns ...func(*DescribeDeliveriesPaginatorOptions)) *DescribeDeliveriesPaginator { + if params == nil { + params = &DescribeDeliveriesInput{} + } + + options := DescribeDeliveriesPaginatorOptions{} + if params.Limit != nil { + options.Limit = *params.Limit + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDeliveriesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDeliveriesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDeliveries page. +func (p *DescribeDeliveriesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDeliveriesOutput, 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.Limit = limit + + result, err := p.client.DescribeDeliveries(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_opDescribeDeliveries(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "logs", + OperationName: "DescribeDeliveries", + } +} + +type opDescribeDeliveriesResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDescribeDeliveriesResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDescribeDeliveriesResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "logs" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "logs" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("logs") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDescribeDeliveriesResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDescribeDeliveriesResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/cloudwatchlogs/api_op_DescribeDeliveryDestinations.go b/service/cloudwatchlogs/api_op_DescribeDeliveryDestinations.go new file mode 100644 index 00000000000..3f856692ada --- /dev/null +++ b/service/cloudwatchlogs/api_op_DescribeDeliveryDestinations.go @@ -0,0 +1,359 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a list of the delivery destinations that have been created in the +// account. +func (c *Client) DescribeDeliveryDestinations(ctx context.Context, params *DescribeDeliveryDestinationsInput, optFns ...func(*Options)) (*DescribeDeliveryDestinationsOutput, error) { + if params == nil { + params = &DescribeDeliveryDestinationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDeliveryDestinations", params, optFns, c.addOperationDescribeDeliveryDestinationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDeliveryDestinationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDeliveryDestinationsInput struct { + + // Optionally specify the maximum number of delivery destinations to return in the + // response. + Limit *int32 + + // The token for the next set of items to return. The token expires after 24 hours. + NextToken *string + + noSmithyDocumentSerde +} + +type DescribeDeliveryDestinationsOutput struct { + + // An array of structures. Each structure contains information about one delivery + // destination in the account. + DeliveryDestinations []types.DeliveryDestination + + // The token for the next set of items to return. The token expires after 24 hours. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDeliveryDestinationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeDeliveryDestinations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeDeliveryDestinations{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addDescribeDeliveryDestinationsResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDeliveryDestinations(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// DescribeDeliveryDestinationsAPIClient is a client that implements the +// DescribeDeliveryDestinations operation. +type DescribeDeliveryDestinationsAPIClient interface { + DescribeDeliveryDestinations(context.Context, *DescribeDeliveryDestinationsInput, ...func(*Options)) (*DescribeDeliveryDestinationsOutput, error) +} + +var _ DescribeDeliveryDestinationsAPIClient = (*Client)(nil) + +// DescribeDeliveryDestinationsPaginatorOptions is the paginator options for +// DescribeDeliveryDestinations +type DescribeDeliveryDestinationsPaginatorOptions struct { + // Optionally specify the maximum number of delivery destinations to return in the + // response. + 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 +} + +// DescribeDeliveryDestinationsPaginator is a paginator for +// DescribeDeliveryDestinations +type DescribeDeliveryDestinationsPaginator struct { + options DescribeDeliveryDestinationsPaginatorOptions + client DescribeDeliveryDestinationsAPIClient + params *DescribeDeliveryDestinationsInput + nextToken *string + firstPage bool +} + +// NewDescribeDeliveryDestinationsPaginator returns a new +// DescribeDeliveryDestinationsPaginator +func NewDescribeDeliveryDestinationsPaginator(client DescribeDeliveryDestinationsAPIClient, params *DescribeDeliveryDestinationsInput, optFns ...func(*DescribeDeliveryDestinationsPaginatorOptions)) *DescribeDeliveryDestinationsPaginator { + if params == nil { + params = &DescribeDeliveryDestinationsInput{} + } + + options := DescribeDeliveryDestinationsPaginatorOptions{} + if params.Limit != nil { + options.Limit = *params.Limit + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDeliveryDestinationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDeliveryDestinationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDeliveryDestinations page. +func (p *DescribeDeliveryDestinationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDeliveryDestinationsOutput, 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.Limit = limit + + result, err := p.client.DescribeDeliveryDestinations(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_opDescribeDeliveryDestinations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "logs", + OperationName: "DescribeDeliveryDestinations", + } +} + +type opDescribeDeliveryDestinationsResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDescribeDeliveryDestinationsResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDescribeDeliveryDestinationsResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "logs" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "logs" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("logs") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDescribeDeliveryDestinationsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDescribeDeliveryDestinationsResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/cloudwatchlogs/api_op_DescribeDeliverySources.go b/service/cloudwatchlogs/api_op_DescribeDeliverySources.go new file mode 100644 index 00000000000..a819251d75f --- /dev/null +++ b/service/cloudwatchlogs/api_op_DescribeDeliverySources.go @@ -0,0 +1,357 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a list of the delivery sources that have been created in the account. +func (c *Client) DescribeDeliverySources(ctx context.Context, params *DescribeDeliverySourcesInput, optFns ...func(*Options)) (*DescribeDeliverySourcesOutput, error) { + if params == nil { + params = &DescribeDeliverySourcesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeDeliverySources", params, optFns, c.addOperationDescribeDeliverySourcesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeDeliverySourcesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeDeliverySourcesInput struct { + + // Optionally specify the maximum number of delivery sources to return in the + // response. + Limit *int32 + + // The token for the next set of items to return. The token expires after 24 hours. + NextToken *string + + noSmithyDocumentSerde +} + +type DescribeDeliverySourcesOutput struct { + + // An array of structures. Each structure contains information about one delivery + // source in the account. + DeliverySources []types.DeliverySource + + // The token for the next set of items to return. The token expires after 24 hours. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeDeliverySourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeDeliverySources{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeDeliverySources{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addDescribeDeliverySourcesResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeDeliverySources(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +// DescribeDeliverySourcesAPIClient is a client that implements the +// DescribeDeliverySources operation. +type DescribeDeliverySourcesAPIClient interface { + DescribeDeliverySources(context.Context, *DescribeDeliverySourcesInput, ...func(*Options)) (*DescribeDeliverySourcesOutput, error) +} + +var _ DescribeDeliverySourcesAPIClient = (*Client)(nil) + +// DescribeDeliverySourcesPaginatorOptions is the paginator options for +// DescribeDeliverySources +type DescribeDeliverySourcesPaginatorOptions struct { + // Optionally specify the maximum number of delivery sources to return in the + // response. + 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 +} + +// DescribeDeliverySourcesPaginator is a paginator for DescribeDeliverySources +type DescribeDeliverySourcesPaginator struct { + options DescribeDeliverySourcesPaginatorOptions + client DescribeDeliverySourcesAPIClient + params *DescribeDeliverySourcesInput + nextToken *string + firstPage bool +} + +// NewDescribeDeliverySourcesPaginator returns a new +// DescribeDeliverySourcesPaginator +func NewDescribeDeliverySourcesPaginator(client DescribeDeliverySourcesAPIClient, params *DescribeDeliverySourcesInput, optFns ...func(*DescribeDeliverySourcesPaginatorOptions)) *DescribeDeliverySourcesPaginator { + if params == nil { + params = &DescribeDeliverySourcesInput{} + } + + options := DescribeDeliverySourcesPaginatorOptions{} + if params.Limit != nil { + options.Limit = *params.Limit + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeDeliverySourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeDeliverySourcesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeDeliverySources page. +func (p *DescribeDeliverySourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeDeliverySourcesOutput, 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.Limit = limit + + result, err := p.client.DescribeDeliverySources(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_opDescribeDeliverySources(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "logs", + OperationName: "DescribeDeliverySources", + } +} + +type opDescribeDeliverySourcesResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDescribeDeliverySourcesResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDescribeDeliverySourcesResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "logs" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "logs" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("logs") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDescribeDeliverySourcesResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDescribeDeliverySourcesResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/cloudwatchlogs/api_op_GetDelivery.go b/service/cloudwatchlogs/api_op_GetDelivery.go new file mode 100644 index 00000000000..de83f95be22 --- /dev/null +++ b/service/cloudwatchlogs/api_op_GetDelivery.go @@ -0,0 +1,265 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns complete information about one delivery. A delivery is a connection +// between a logical delivery source and a logical delivery destination You need to +// specify the delivery id in this operation. You can find the IDs of the +// deliveries in your account with the DescribeDeliveries (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeDeliveries.html) +// operation. +func (c *Client) GetDelivery(ctx context.Context, params *GetDeliveryInput, optFns ...func(*Options)) (*GetDeliveryOutput, error) { + if params == nil { + params = &GetDeliveryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDelivery", params, optFns, c.addOperationGetDeliveryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDeliveryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDeliveryInput struct { + + // The ID of the delivery that you want to retrieve. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type GetDeliveryOutput struct { + + // A structure that contains information about the delivery. + Delivery *types.Delivery + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetDeliveryMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetDelivery{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetDelivery{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addGetDeliveryResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpGetDeliveryValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDelivery(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetDelivery(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "logs", + OperationName: "GetDelivery", + } +} + +type opGetDeliveryResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opGetDeliveryResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opGetDeliveryResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "logs" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "logs" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("logs") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addGetDeliveryResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opGetDeliveryResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/cloudwatchlogs/api_op_GetDeliveryDestination.go b/service/cloudwatchlogs/api_op_GetDeliveryDestination.go new file mode 100644 index 00000000000..0c3a220cd5d --- /dev/null +++ b/service/cloudwatchlogs/api_op_GetDeliveryDestination.go @@ -0,0 +1,261 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves complete information about one delivery destination. +func (c *Client) GetDeliveryDestination(ctx context.Context, params *GetDeliveryDestinationInput, optFns ...func(*Options)) (*GetDeliveryDestinationOutput, error) { + if params == nil { + params = &GetDeliveryDestinationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDeliveryDestination", params, optFns, c.addOperationGetDeliveryDestinationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDeliveryDestinationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDeliveryDestinationInput struct { + + // The name of the delivery destination that you want to retrieve. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type GetDeliveryDestinationOutput struct { + + // A structure containing information about the delivery destination. + DeliveryDestination *types.DeliveryDestination + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetDeliveryDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetDeliveryDestination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetDeliveryDestination{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addGetDeliveryDestinationResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpGetDeliveryDestinationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDeliveryDestination(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetDeliveryDestination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "logs", + OperationName: "GetDeliveryDestination", + } +} + +type opGetDeliveryDestinationResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opGetDeliveryDestinationResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opGetDeliveryDestinationResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "logs" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "logs" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("logs") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addGetDeliveryDestinationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opGetDeliveryDestinationResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/cloudwatchlogs/api_op_GetDeliveryDestinationPolicy.go b/service/cloudwatchlogs/api_op_GetDeliveryDestinationPolicy.go new file mode 100644 index 00000000000..40dcc2be4a5 --- /dev/null +++ b/service/cloudwatchlogs/api_op_GetDeliveryDestinationPolicy.go @@ -0,0 +1,264 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the delivery destination policy assigned to the delivery destination +// that you specify. For more information about delivery destinations and their +// policies, see PutDeliveryDestinationPolicy (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestinationPolicy.html) +// . +func (c *Client) GetDeliveryDestinationPolicy(ctx context.Context, params *GetDeliveryDestinationPolicyInput, optFns ...func(*Options)) (*GetDeliveryDestinationPolicyOutput, error) { + if params == nil { + params = &GetDeliveryDestinationPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDeliveryDestinationPolicy", params, optFns, c.addOperationGetDeliveryDestinationPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDeliveryDestinationPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDeliveryDestinationPolicyInput struct { + + // The name of the delivery destination that you want to retrieve the policy of. + // + // This member is required. + DeliveryDestinationName *string + + noSmithyDocumentSerde +} + +type GetDeliveryDestinationPolicyOutput struct { + + // The IAM policy for this delivery destination. + Policy *types.Policy + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetDeliveryDestinationPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetDeliveryDestinationPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetDeliveryDestinationPolicy{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addGetDeliveryDestinationPolicyResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpGetDeliveryDestinationPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDeliveryDestinationPolicy(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetDeliveryDestinationPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "logs", + OperationName: "GetDeliveryDestinationPolicy", + } +} + +type opGetDeliveryDestinationPolicyResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opGetDeliveryDestinationPolicyResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opGetDeliveryDestinationPolicyResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "logs" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "logs" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("logs") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addGetDeliveryDestinationPolicyResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opGetDeliveryDestinationPolicyResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/cloudwatchlogs/api_op_GetDeliverySource.go b/service/cloudwatchlogs/api_op_GetDeliverySource.go new file mode 100644 index 00000000000..efc2a476fcc --- /dev/null +++ b/service/cloudwatchlogs/api_op_GetDeliverySource.go @@ -0,0 +1,261 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves complete information about one delivery source. +func (c *Client) GetDeliverySource(ctx context.Context, params *GetDeliverySourceInput, optFns ...func(*Options)) (*GetDeliverySourceOutput, error) { + if params == nil { + params = &GetDeliverySourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDeliverySource", params, optFns, c.addOperationGetDeliverySourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDeliverySourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDeliverySourceInput struct { + + // The name of the delivery source that you want to retrieve. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type GetDeliverySourceOutput struct { + + // A structure containing information about the delivery source. + DeliverySource *types.DeliverySource + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetDeliverySourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetDeliverySource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetDeliverySource{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addGetDeliverySourceResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpGetDeliverySourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDeliverySource(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetDeliverySource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "logs", + OperationName: "GetDeliverySource", + } +} + +type opGetDeliverySourceResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opGetDeliverySourceResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opGetDeliverySourceResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "logs" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "logs" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("logs") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addGetDeliverySourceResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opGetDeliverySourceResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/cloudwatchlogs/api_op_GetQueryResults.go b/service/cloudwatchlogs/api_op_GetQueryResults.go index 3c20732df4b..dc902ddceef 100644 --- a/service/cloudwatchlogs/api_op_GetQueryResults.go +++ b/service/cloudwatchlogs/api_op_GetQueryResults.go @@ -21,6 +21,8 @@ import ( // log record. You can use the value of @ptr in a GetLogRecord (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetLogRecord.html) // operation to get the full log record. GetQueryResults does not start running a // query. To run a query, use StartQuery (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html) +// . For more information about how long results of previous queries are available, +// see CloudWatch Logs quotas (https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/cloudwatch_limits_cwl.html) // . If the value of the Status field in the output is Running , this operation // returns only partial results. If you see a value of Scheduled or Running for // the status, you can retry the operation later to see the final results. If you diff --git a/service/cloudwatchlogs/api_op_PutDeliveryDestination.go b/service/cloudwatchlogs/api_op_PutDeliveryDestination.go new file mode 100644 index 00000000000..c50825ba442 --- /dev/null +++ b/service/cloudwatchlogs/api_op_PutDeliveryDestination.go @@ -0,0 +1,304 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates or updates a logical delivery destination. A delivery destination is an +// Amazon Web Services resource that represents an Amazon Web Services service that +// logs can be sent to. CloudWatch Logs, Amazon S3, and Kinesis Data Firehose are +// supported as logs delivery destinations. To configure logs delivery between a +// supported Amazon Web Services service and a destination, you must do the +// following: +// - Create a delivery source, which is a logical object that represents the +// resource that is actually sending the logs. For more information, see +// PutDeliverySource (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliverySource.html) +// . +// - Use PutDeliveryDestination to create a delivery destination, which is a +// logical object that represents the actual delivery destination. +// - If you are delivering logs cross-account, you must use +// PutDeliveryDestinationPolicy (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestinationolicy.html) +// in the destination account to assign an IAM policy to the destination. This +// policy allows delivery to that destination. +// - Use CreateDelivery to create a delivery by pairing exactly one delivery +// source and one delivery destination. For more information, see CreateDelivery (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateDelivery.html) +// . +// +// You can configure a single delivery source to send logs to multiple +// destinations by creating multiple deliveries. You can also create multiple +// deliveries to configure multiple delivery sources to send logs to the same +// delivery destination. Only some Amazon Web Services services support being +// configured as a delivery source. These services are listed as Supported [V2 +// Permissions] in the table at Enabling logging from Amazon Web Services services. (https://docs.aws.amazon.com/ AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html#AWS-vended-logs-permissions) +// If you use this operation to update an existing delivery destination, all the +// current delivery destination parameters are overwritten with the new parameter +// values that you specify. +func (c *Client) PutDeliveryDestination(ctx context.Context, params *PutDeliveryDestinationInput, optFns ...func(*Options)) (*PutDeliveryDestinationOutput, error) { + if params == nil { + params = &PutDeliveryDestinationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutDeliveryDestination", params, optFns, c.addOperationPutDeliveryDestinationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutDeliveryDestinationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutDeliveryDestinationInput struct { + + // A structure that contains the ARN of the Amazon Web Services resource that will + // receive the logs. + // + // This member is required. + DeliveryDestinationConfiguration *types.DeliveryDestinationConfiguration + + // A name for this delivery destination. This name must be unique for all delivery + // destinations in your account. + // + // This member is required. + Name *string + + // The format for the logs that this delivery destination will receive. + OutputFormat types.OutputFormat + + // An optional list of key-value pairs to associate with the resource. For more + // information about tagging, see Tagging Amazon Web Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) + Tags map[string]string + + noSmithyDocumentSerde +} + +type PutDeliveryDestinationOutput struct { + + // A structure containing information about the delivery destination that you just + // created or updated. + DeliveryDestination *types.DeliveryDestination + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutDeliveryDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutDeliveryDestination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutDeliveryDestination{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addPutDeliveryDestinationResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpPutDeliveryDestinationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutDeliveryDestination(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutDeliveryDestination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "logs", + OperationName: "PutDeliveryDestination", + } +} + +type opPutDeliveryDestinationResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opPutDeliveryDestinationResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opPutDeliveryDestinationResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "logs" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "logs" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("logs") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addPutDeliveryDestinationResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opPutDeliveryDestinationResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/cloudwatchlogs/api_op_PutDeliveryDestinationPolicy.go b/service/cloudwatchlogs/api_op_PutDeliveryDestinationPolicy.go new file mode 100644 index 00000000000..0aaf89b06dc --- /dev/null +++ b/service/cloudwatchlogs/api_op_PutDeliveryDestinationPolicy.go @@ -0,0 +1,290 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates and assigns an IAM policy that grants permissions to CloudWatch Logs to +// deliver logs cross-account to a specified destination in this account. To +// configure the delivery of logs from an Amazon Web Services service in another +// account to a logs delivery destination in the current account, you must do the +// following: +// - Create a delivery source, which is a logical object that represents the +// resource that is actually sending the logs. For more information, see +// PutDeliverySource (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliverySource.html) +// . +// - Create a delivery destination, which is a logical object that represents +// the actual delivery destination. For more information, see +// PutDeliveryDestination (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestination.html) +// . +// - Use this operation in the destination account to assign an IAM policy to +// the destination. This policy allows delivery to that destination. +// - Create a delivery by pairing exactly one delivery source and one delivery +// destination. For more information, see CreateDelivery (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateDelivery.html) +// . +// +// Only some Amazon Web Services services support being configured as a delivery +// source. These services are listed as Supported [V2 Permissions] in the table at +// Enabling logging from Amazon Web Services services. (https://docs.aws.amazon.com/ AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html#AWS-vended-logs-permissions) +// The contents of the policy must include two statements. One statement enables +// general logs delivery, and the other allows delivery to the chosen destination. +// See the examples for the needed policies. +func (c *Client) PutDeliveryDestinationPolicy(ctx context.Context, params *PutDeliveryDestinationPolicyInput, optFns ...func(*Options)) (*PutDeliveryDestinationPolicyOutput, error) { + if params == nil { + params = &PutDeliveryDestinationPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutDeliveryDestinationPolicy", params, optFns, c.addOperationPutDeliveryDestinationPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutDeliveryDestinationPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutDeliveryDestinationPolicyInput struct { + + // The name of the delivery destination to assign this policy to. + // + // This member is required. + DeliveryDestinationName *string + + // The contents of the policy. + // + // This member is required. + DeliveryDestinationPolicy *string + + noSmithyDocumentSerde +} + +type PutDeliveryDestinationPolicyOutput struct { + + // The contents of the policy that you just created. + Policy *types.Policy + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutDeliveryDestinationPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutDeliveryDestinationPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutDeliveryDestinationPolicy{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addPutDeliveryDestinationPolicyResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpPutDeliveryDestinationPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutDeliveryDestinationPolicy(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutDeliveryDestinationPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "logs", + OperationName: "PutDeliveryDestinationPolicy", + } +} + +type opPutDeliveryDestinationPolicyResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opPutDeliveryDestinationPolicyResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opPutDeliveryDestinationPolicyResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "logs" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "logs" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("logs") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addPutDeliveryDestinationPolicyResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opPutDeliveryDestinationPolicyResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/cloudwatchlogs/api_op_PutDeliverySource.go b/service/cloudwatchlogs/api_op_PutDeliverySource.go new file mode 100644 index 00000000000..1225a48e8ff --- /dev/null +++ b/service/cloudwatchlogs/api_op_PutDeliverySource.go @@ -0,0 +1,308 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates or updates a logical delivery source. A delivery source represents an +// Amazon Web Services resource that sends logs to an logs delivery destination. +// The destination can be CloudWatch Logs, Amazon S3, or Kinesis Data Firehose. To +// configure logs delivery between a delivery destination and an Amazon Web +// Services service that is supported as a delivery source, you must do the +// following: +// - Use PutDeliverySource to create a delivery source, which is a logical object +// that represents the resource that is actually sending the logs. +// - Use PutDeliveryDestination to create a delivery destination, which is a +// logical object that represents the actual delivery destination. For more +// information, see PutDeliveryDestination (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestination.html) +// . +// - If you are delivering logs cross-account, you must use +// PutDeliveryDestinationPolicy (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestinationolicy.html) +// in the destination account to assign an IAM policy to the destination. This +// policy allows delivery to that destination. +// - Use CreateDelivery to create a delivery by pairing exactly one delivery +// source and one delivery destination. For more information, see CreateDelivery (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateDelivery.html) +// . +// +// You can configure a single delivery source to send logs to multiple +// destinations by creating multiple deliveries. You can also create multiple +// deliveries to configure multiple delivery sources to send logs to the same +// delivery destination. Only some Amazon Web Services services support being +// configured as a delivery source. These services are listed as Supported [V2 +// Permissions] in the table at Enabling logging from Amazon Web Services services. (https://docs.aws.amazon.com/ AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html#AWS-vended-logs-permissions) +// If you use this operation to update an existing delivery source, all the current +// delivery source parameters are overwritten with the new parameter values that +// you specify. +func (c *Client) PutDeliverySource(ctx context.Context, params *PutDeliverySourceInput, optFns ...func(*Options)) (*PutDeliverySourceOutput, error) { + if params == nil { + params = &PutDeliverySourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutDeliverySource", params, optFns, c.addOperationPutDeliverySourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutDeliverySourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutDeliverySourceInput struct { + + // Defines the type of log that the source is sending. For valid values for this + // parameter, see the documentation for the source service. + // + // This member is required. + LogType *string + + // A name for this delivery source. This name must be unique for all delivery + // sources in your account. + // + // This member is required. + Name *string + + // The ARN of the Amazon Web Services resource that is generating and sending + // logs. For example, + // arn:aws:workmail:us-east-1:123456789012:organization/m-1234EXAMPLEabcd1234abcd1234abcd1234 + // + // This member is required. + ResourceArn *string + + // An optional list of key-value pairs to associate with the resource. For more + // information about tagging, see Tagging Amazon Web Services resources (https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) + Tags map[string]string + + noSmithyDocumentSerde +} + +type PutDeliverySourceOutput struct { + + // A structure containing information about the delivery source that was just + // created or updated. + DeliverySource *types.DeliverySource + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutDeliverySourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutDeliverySource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutDeliverySource{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addPutDeliverySourceResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpPutDeliverySourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutDeliverySource(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutDeliverySource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "logs", + OperationName: "PutDeliverySource", + } +} + +type opPutDeliverySourceResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opPutDeliverySourceResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opPutDeliverySourceResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "logs" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "logs" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("logs") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addPutDeliverySourceResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opPutDeliverySourceResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/cloudwatchlogs/deserializers.go b/service/cloudwatchlogs/deserializers.go index d6a8b7ffd04..0d85fb47eed 100644 --- a/service/cloudwatchlogs/deserializers.go +++ b/service/cloudwatchlogs/deserializers.go @@ -216,6 +216,135 @@ func awsAwsjson11_deserializeOpErrorCancelExportTask(response *smithyhttp.Respon } } +type awsAwsjson11_deserializeOpCreateDelivery struct { +} + +func (*awsAwsjson11_deserializeOpCreateDelivery) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateDelivery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateDelivery(response, &metadata) + } + output := &CreateDeliveryOutput{} + 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_deserializeOpDocumentCreateDeliveryOutput(&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_deserializeOpErrorCreateDelivery(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpCreateExportTask struct { } @@ -737,14 +866,14 @@ func awsAwsjson11_deserializeOpErrorDeleteDataProtectionPolicy(response *smithyh } } -type awsAwsjson11_deserializeOpDeleteDestination struct { +type awsAwsjson11_deserializeOpDeleteDelivery struct { } -func (*awsAwsjson11_deserializeOpDeleteDestination) ID() string { +func (*awsAwsjson11_deserializeOpDeleteDelivery) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteDelivery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -758,9 +887,9 @@ func (m *awsAwsjson11_deserializeOpDeleteDestination) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteDestination(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteDelivery(response, &metadata) } - output := &DeleteDestinationOutput{} + output := &DeleteDeliveryOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -772,7 +901,7 @@ func (m *awsAwsjson11_deserializeOpDeleteDestination) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteDelivery(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -813,18 +942,24 @@ func awsAwsjson11_deserializeOpErrorDeleteDestination(response *smithyhttp.Respo } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("OperationAbortedException", errorCode): - return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -835,14 +970,14 @@ func awsAwsjson11_deserializeOpErrorDeleteDestination(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpDeleteLogGroup struct { +type awsAwsjson11_deserializeOpDeleteDeliveryDestination struct { } -func (*awsAwsjson11_deserializeOpDeleteLogGroup) ID() string { +func (*awsAwsjson11_deserializeOpDeleteDeliveryDestination) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteLogGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteDeliveryDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -856,9 +991,9 @@ func (m *awsAwsjson11_deserializeOpDeleteLogGroup) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteLogGroup(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteDeliveryDestination(response, &metadata) } - output := &DeleteLogGroupOutput{} + output := &DeleteDeliveryDestinationOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -870,7 +1005,7 @@ func (m *awsAwsjson11_deserializeOpDeleteLogGroup) HandleDeserialize(ctx context return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteLogGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteDeliveryDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -911,18 +1046,24 @@ func awsAwsjson11_deserializeOpErrorDeleteLogGroup(response *smithyhttp.Response } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("OperationAbortedException", errorCode): - return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -933,14 +1074,14 @@ func awsAwsjson11_deserializeOpErrorDeleteLogGroup(response *smithyhttp.Response } } -type awsAwsjson11_deserializeOpDeleteLogStream struct { +type awsAwsjson11_deserializeOpDeleteDeliveryDestinationPolicy struct { } -func (*awsAwsjson11_deserializeOpDeleteLogStream) ID() string { +func (*awsAwsjson11_deserializeOpDeleteDeliveryDestinationPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteLogStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteDeliveryDestinationPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -954,9 +1095,9 @@ func (m *awsAwsjson11_deserializeOpDeleteLogStream) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteLogStream(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteDeliveryDestinationPolicy(response, &metadata) } - output := &DeleteLogStreamOutput{} + output := &DeleteDeliveryDestinationPolicyOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -968,7 +1109,7 @@ func (m *awsAwsjson11_deserializeOpDeleteLogStream) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteLogStream(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteDeliveryDestinationPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1009,11 +1150,8 @@ func awsAwsjson11_deserializeOpErrorDeleteLogStream(response *smithyhttp.Respons } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("OperationAbortedException", errorCode): - return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1021,6 +1159,9 @@ func awsAwsjson11_deserializeOpErrorDeleteLogStream(response *smithyhttp.Respons case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1031,14 +1172,14 @@ func awsAwsjson11_deserializeOpErrorDeleteLogStream(response *smithyhttp.Respons } } -type awsAwsjson11_deserializeOpDeleteMetricFilter struct { +type awsAwsjson11_deserializeOpDeleteDeliverySource struct { } -func (*awsAwsjson11_deserializeOpDeleteMetricFilter) ID() string { +func (*awsAwsjson11_deserializeOpDeleteDeliverySource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteMetricFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteDeliverySource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1052,9 +1193,9 @@ func (m *awsAwsjson11_deserializeOpDeleteMetricFilter) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteMetricFilter(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteDeliverySource(response, &metadata) } - output := &DeleteMetricFilterOutput{} + output := &DeleteDeliverySourceOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1066,7 +1207,7 @@ func (m *awsAwsjson11_deserializeOpDeleteMetricFilter) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteMetricFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteDeliverySource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1107,18 +1248,24 @@ func awsAwsjson11_deserializeOpErrorDeleteMetricFilter(response *smithyhttp.Resp } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("OperationAbortedException", errorCode): - return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1129,14 +1276,14 @@ func awsAwsjson11_deserializeOpErrorDeleteMetricFilter(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpDeleteQueryDefinition struct { +type awsAwsjson11_deserializeOpDeleteDestination struct { } -func (*awsAwsjson11_deserializeOpDeleteQueryDefinition) ID() string { +func (*awsAwsjson11_deserializeOpDeleteDestination) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteQueryDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1150,43 +1297,21 @@ func (m *awsAwsjson11_deserializeOpDeleteQueryDefinition) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteQueryDefinition(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteDestination(response, &metadata) } - output := &DeleteQueryDefinitionOutput{} + output := &DeleteDestinationOutput{} 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_deserializeOpDocumentDeleteQueryDefinitionOutput(&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(), + 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 } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteQueryDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1230,6 +1355,9 @@ func awsAwsjson11_deserializeOpErrorDeleteQueryDefinition(response *smithyhttp.R case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1246,14 +1374,14 @@ func awsAwsjson11_deserializeOpErrorDeleteQueryDefinition(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpDeleteResourcePolicy struct { +type awsAwsjson11_deserializeOpDeleteLogGroup struct { } -func (*awsAwsjson11_deserializeOpDeleteResourcePolicy) ID() string { +func (*awsAwsjson11_deserializeOpDeleteLogGroup) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteLogGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1267,9 +1395,9 @@ func (m *awsAwsjson11_deserializeOpDeleteResourcePolicy) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteLogGroup(response, &metadata) } - output := &DeleteResourcePolicyOutput{} + output := &DeleteLogGroupOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1281,7 +1409,7 @@ func (m *awsAwsjson11_deserializeOpDeleteResourcePolicy) HandleDeserialize(ctx c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteLogGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1325,6 +1453,9 @@ func awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Re case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1341,14 +1472,14 @@ func awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Re } } -type awsAwsjson11_deserializeOpDeleteRetentionPolicy struct { +type awsAwsjson11_deserializeOpDeleteLogStream struct { } -func (*awsAwsjson11_deserializeOpDeleteRetentionPolicy) ID() string { +func (*awsAwsjson11_deserializeOpDeleteLogStream) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteRetentionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteLogStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1362,9 +1493,9 @@ func (m *awsAwsjson11_deserializeOpDeleteRetentionPolicy) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteRetentionPolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteLogStream(response, &metadata) } - output := &DeleteRetentionPolicyOutput{} + output := &DeleteLogStreamOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1376,7 +1507,7 @@ func (m *awsAwsjson11_deserializeOpDeleteRetentionPolicy) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteRetentionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteLogStream(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1439,14 +1570,14 @@ func awsAwsjson11_deserializeOpErrorDeleteRetentionPolicy(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpDeleteSubscriptionFilter struct { +type awsAwsjson11_deserializeOpDeleteMetricFilter struct { } -func (*awsAwsjson11_deserializeOpDeleteSubscriptionFilter) ID() string { +func (*awsAwsjson11_deserializeOpDeleteMetricFilter) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDeleteSubscriptionFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteMetricFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1460,9 +1591,9 @@ func (m *awsAwsjson11_deserializeOpDeleteSubscriptionFilter) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDeleteSubscriptionFilter(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteMetricFilter(response, &metadata) } - output := &DeleteSubscriptionFilterOutput{} + output := &DeleteMetricFilterOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -1474,7 +1605,7 @@ func (m *awsAwsjson11_deserializeOpDeleteSubscriptionFilter) HandleDeserialize(c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDeleteSubscriptionFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteMetricFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1537,14 +1668,14 @@ func awsAwsjson11_deserializeOpErrorDeleteSubscriptionFilter(response *smithyhtt } } -type awsAwsjson11_deserializeOpDescribeAccountPolicies struct { +type awsAwsjson11_deserializeOpDeleteQueryDefinition struct { } -func (*awsAwsjson11_deserializeOpDescribeAccountPolicies) ID() string { +func (*awsAwsjson11_deserializeOpDeleteQueryDefinition) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeAccountPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteQueryDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1558,9 +1689,9 @@ func (m *awsAwsjson11_deserializeOpDescribeAccountPolicies) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeAccountPolicies(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteQueryDefinition(response, &metadata) } - output := &DescribeAccountPoliciesOutput{} + output := &DeleteQueryDefinitionOutput{} out.Result = output var buff [1024]byte @@ -1580,7 +1711,7 @@ func (m *awsAwsjson11_deserializeOpDescribeAccountPolicies) HandleDeserialize(ct return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeAccountPoliciesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDeleteQueryDefinitionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1594,7 +1725,7 @@ func (m *awsAwsjson11_deserializeOpDescribeAccountPolicies) HandleDeserialize(ct return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeAccountPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteQueryDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1638,9 +1769,6 @@ func awsAwsjson11_deserializeOpErrorDescribeAccountPolicies(response *smithyhttp case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("OperationAbortedException", errorCode): - return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1657,14 +1785,14 @@ func awsAwsjson11_deserializeOpErrorDescribeAccountPolicies(response *smithyhttp } } -type awsAwsjson11_deserializeOpDescribeDestinations struct { +type awsAwsjson11_deserializeOpDeleteResourcePolicy struct { } -func (*awsAwsjson11_deserializeOpDescribeDestinations) ID() string { +func (*awsAwsjson11_deserializeOpDeleteResourcePolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeDestinations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1678,43 +1806,21 @@ func (m *awsAwsjson11_deserializeOpDescribeDestinations) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeDestinations(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response, &metadata) } - output := &DescribeDestinationsOutput{} + output := &DeleteResourcePolicyOutput{} out.Result = output - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentDescribeDestinationsOutput(&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(), + 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 } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeDestinations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1758,6 +1864,9 @@ func awsAwsjson11_deserializeOpErrorDescribeDestinations(response *smithyhttp.Re case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) @@ -1771,14 +1880,14 @@ func awsAwsjson11_deserializeOpErrorDescribeDestinations(response *smithyhttp.Re } } -type awsAwsjson11_deserializeOpDescribeExportTasks struct { +type awsAwsjson11_deserializeOpDeleteRetentionPolicy struct { } -func (*awsAwsjson11_deserializeOpDescribeExportTasks) ID() string { +func (*awsAwsjson11_deserializeOpDeleteRetentionPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeExportTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteRetentionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1792,43 +1901,21 @@ func (m *awsAwsjson11_deserializeOpDescribeExportTasks) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeExportTasks(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteRetentionPolicy(response, &metadata) } - output := &DescribeExportTasksOutput{} + output := &DeleteRetentionPolicyOutput{} 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_deserializeOpDocumentDescribeExportTasksOutput(&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(), + 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 } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeExportTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteRetentionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1872,6 +1959,12 @@ func awsAwsjson11_deserializeOpErrorDescribeExportTasks(response *smithyhttp.Res case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) @@ -1885,14 +1978,14 @@ func awsAwsjson11_deserializeOpErrorDescribeExportTasks(response *smithyhttp.Res } } -type awsAwsjson11_deserializeOpDescribeLogGroups struct { +type awsAwsjson11_deserializeOpDeleteSubscriptionFilter struct { } -func (*awsAwsjson11_deserializeOpDescribeLogGroups) ID() string { +func (*awsAwsjson11_deserializeOpDeleteSubscriptionFilter) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeLogGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDeleteSubscriptionFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1906,43 +1999,21 @@ func (m *awsAwsjson11_deserializeOpDescribeLogGroups) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeLogGroups(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteSubscriptionFilter(response, &metadata) } - output := &DescribeLogGroupsOutput{} + output := &DeleteSubscriptionFilterOutput{} 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_deserializeOpDocumentDescribeLogGroupsOutput(&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(), + 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 } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeLogGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDeleteSubscriptionFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1986,6 +2057,12 @@ func awsAwsjson11_deserializeOpErrorDescribeLogGroups(response *smithyhttp.Respo case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) @@ -1999,14 +2076,14 @@ func awsAwsjson11_deserializeOpErrorDescribeLogGroups(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpDescribeLogStreams struct { +type awsAwsjson11_deserializeOpDescribeAccountPolicies struct { } -func (*awsAwsjson11_deserializeOpDescribeLogStreams) ID() string { +func (*awsAwsjson11_deserializeOpDescribeAccountPolicies) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeLogStreams) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeAccountPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2020,9 +2097,9 @@ func (m *awsAwsjson11_deserializeOpDescribeLogStreams) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeLogStreams(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeAccountPolicies(response, &metadata) } - output := &DescribeLogStreamsOutput{} + output := &DescribeAccountPoliciesOutput{} out.Result = output var buff [1024]byte @@ -2042,7 +2119,7 @@ func (m *awsAwsjson11_deserializeOpDescribeLogStreams) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeLogStreamsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeAccountPoliciesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2056,7 +2133,7 @@ func (m *awsAwsjson11_deserializeOpDescribeLogStreams) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeLogStreams(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeAccountPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2100,6 +2177,9 @@ func awsAwsjson11_deserializeOpErrorDescribeLogStreams(response *smithyhttp.Resp case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -2116,14 +2196,14 @@ func awsAwsjson11_deserializeOpErrorDescribeLogStreams(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpDescribeMetricFilters struct { +type awsAwsjson11_deserializeOpDescribeDeliveries struct { } -func (*awsAwsjson11_deserializeOpDescribeMetricFilters) ID() string { +func (*awsAwsjson11_deserializeOpDescribeDeliveries) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeMetricFilters) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeDeliveries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2137,9 +2217,9 @@ func (m *awsAwsjson11_deserializeOpDescribeMetricFilters) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeMetricFilters(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeDeliveries(response, &metadata) } - output := &DescribeMetricFiltersOutput{} + output := &DescribeDeliveriesOutput{} out.Result = output var buff [1024]byte @@ -2159,7 +2239,7 @@ func (m *awsAwsjson11_deserializeOpDescribeMetricFilters) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeMetricFiltersOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeDeliveriesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2173,7 +2253,7 @@ func (m *awsAwsjson11_deserializeOpDescribeMetricFilters) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeMetricFilters(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeDeliveries(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2214,15 +2294,18 @@ func awsAwsjson11_deserializeOpErrorDescribeMetricFilters(response *smithyhttp.R } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2233,14 +2316,14 @@ func awsAwsjson11_deserializeOpErrorDescribeMetricFilters(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpDescribeQueries struct { +type awsAwsjson11_deserializeOpDescribeDeliveryDestinations struct { } -func (*awsAwsjson11_deserializeOpDescribeQueries) ID() string { +func (*awsAwsjson11_deserializeOpDescribeDeliveryDestinations) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeQueries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeDeliveryDestinations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2254,9 +2337,9 @@ func (m *awsAwsjson11_deserializeOpDescribeQueries) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeQueries(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeDeliveryDestinations(response, &metadata) } - output := &DescribeQueriesOutput{} + output := &DescribeDeliveryDestinationsOutput{} out.Result = output var buff [1024]byte @@ -2276,7 +2359,7 @@ func (m *awsAwsjson11_deserializeOpDescribeQueries) HandleDeserialize(ctx contex return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeQueriesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeDeliveryDestinationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2290,7 +2373,7 @@ func (m *awsAwsjson11_deserializeOpDescribeQueries) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeQueries(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeDeliveryDestinations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2331,15 +2414,18 @@ func awsAwsjson11_deserializeOpErrorDescribeQueries(response *smithyhttp.Respons } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2350,14 +2436,14 @@ func awsAwsjson11_deserializeOpErrorDescribeQueries(response *smithyhttp.Respons } } -type awsAwsjson11_deserializeOpDescribeQueryDefinitions struct { +type awsAwsjson11_deserializeOpDescribeDeliverySources struct { } -func (*awsAwsjson11_deserializeOpDescribeQueryDefinitions) ID() string { +func (*awsAwsjson11_deserializeOpDescribeDeliverySources) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeQueryDefinitions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeDeliverySources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2371,9 +2457,9 @@ func (m *awsAwsjson11_deserializeOpDescribeQueryDefinitions) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeQueryDefinitions(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeDeliverySources(response, &metadata) } - output := &DescribeQueryDefinitionsOutput{} + output := &DescribeDeliverySourcesOutput{} out.Result = output var buff [1024]byte @@ -2393,7 +2479,7 @@ func (m *awsAwsjson11_deserializeOpDescribeQueryDefinitions) HandleDeserialize(c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeQueryDefinitionsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeDeliverySourcesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2407,7 +2493,7 @@ func (m *awsAwsjson11_deserializeOpDescribeQueryDefinitions) HandleDeserialize(c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeQueryDefinitions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeDeliverySources(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2448,12 +2534,18 @@ func awsAwsjson11_deserializeOpErrorDescribeQueryDefinitions(response *smithyhtt } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2464,14 +2556,14 @@ func awsAwsjson11_deserializeOpErrorDescribeQueryDefinitions(response *smithyhtt } } -type awsAwsjson11_deserializeOpDescribeResourcePolicies struct { +type awsAwsjson11_deserializeOpDescribeDestinations struct { } -func (*awsAwsjson11_deserializeOpDescribeResourcePolicies) ID() string { +func (*awsAwsjson11_deserializeOpDescribeDestinations) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeResourcePolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeDestinations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2485,9 +2577,9 @@ func (m *awsAwsjson11_deserializeOpDescribeResourcePolicies) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeResourcePolicies(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeDestinations(response, &metadata) } - output := &DescribeResourcePoliciesOutput{} + output := &DescribeDestinationsOutput{} out.Result = output var buff [1024]byte @@ -2507,7 +2599,7 @@ func (m *awsAwsjson11_deserializeOpDescribeResourcePolicies) HandleDeserialize(c return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeResourcePoliciesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeDestinationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2521,7 +2613,7 @@ func (m *awsAwsjson11_deserializeOpDescribeResourcePolicies) HandleDeserialize(c return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeResourcePolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeDestinations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2578,14 +2670,14 @@ func awsAwsjson11_deserializeOpErrorDescribeResourcePolicies(response *smithyhtt } } -type awsAwsjson11_deserializeOpDescribeSubscriptionFilters struct { +type awsAwsjson11_deserializeOpDescribeExportTasks struct { } -func (*awsAwsjson11_deserializeOpDescribeSubscriptionFilters) ID() string { +func (*awsAwsjson11_deserializeOpDescribeExportTasks) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeSubscriptionFilters) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeExportTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2599,9 +2691,9 @@ func (m *awsAwsjson11_deserializeOpDescribeSubscriptionFilters) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeSubscriptionFilters(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeExportTasks(response, &metadata) } - output := &DescribeSubscriptionFiltersOutput{} + output := &DescribeExportTasksOutput{} out.Result = output var buff [1024]byte @@ -2621,7 +2713,7 @@ func (m *awsAwsjson11_deserializeOpDescribeSubscriptionFilters) HandleDeserializ return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeSubscriptionFiltersOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeExportTasksOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2635,7 +2727,7 @@ func (m *awsAwsjson11_deserializeOpDescribeSubscriptionFilters) HandleDeserializ return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeSubscriptionFilters(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeExportTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2679,9 +2771,6 @@ func awsAwsjson11_deserializeOpErrorDescribeSubscriptionFilters(response *smithy case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) @@ -2695,14 +2784,14 @@ func awsAwsjson11_deserializeOpErrorDescribeSubscriptionFilters(response *smithy } } -type awsAwsjson11_deserializeOpDisassociateKmsKey struct { +type awsAwsjson11_deserializeOpDescribeLogGroups struct { } -func (*awsAwsjson11_deserializeOpDisassociateKmsKey) ID() string { +func (*awsAwsjson11_deserializeOpDescribeLogGroups) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDisassociateKmsKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeLogGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2716,25 +2805,47 @@ func (m *awsAwsjson11_deserializeOpDisassociateKmsKey) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDisassociateKmsKey(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeLogGroups(response, &metadata) } - output := &DisassociateKmsKeyOutput{} + output := &DescribeLogGroupsOutput{} 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 -} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) -func awsAwsjson11_deserializeOpErrorDisassociateKmsKey(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } + 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_deserializeOpDocumentDescribeLogGroupsOutput(&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_deserializeOpErrorDescribeLogGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } errorBody := bytes.NewReader(errorBuffer.Bytes()) errorCode := "UnknownError" @@ -2774,12 +2885,6 @@ func awsAwsjson11_deserializeOpErrorDisassociateKmsKey(response *smithyhttp.Resp case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("OperationAbortedException", errorCode): - return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) @@ -2793,14 +2898,14 @@ func awsAwsjson11_deserializeOpErrorDisassociateKmsKey(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpFilterLogEvents struct { +type awsAwsjson11_deserializeOpDescribeLogStreams struct { } -func (*awsAwsjson11_deserializeOpFilterLogEvents) ID() string { +func (*awsAwsjson11_deserializeOpDescribeLogStreams) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpFilterLogEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeLogStreams) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2814,9 +2919,9 @@ func (m *awsAwsjson11_deserializeOpFilterLogEvents) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorFilterLogEvents(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeLogStreams(response, &metadata) } - output := &FilterLogEventsOutput{} + output := &DescribeLogStreamsOutput{} out.Result = output var buff [1024]byte @@ -2836,7 +2941,7 @@ func (m *awsAwsjson11_deserializeOpFilterLogEvents) HandleDeserialize(ctx contex return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentFilterLogEventsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeLogStreamsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2850,7 +2955,7 @@ func (m *awsAwsjson11_deserializeOpFilterLogEvents) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsjson11_deserializeOpErrorFilterLogEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeLogStreams(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2910,14 +3015,14 @@ func awsAwsjson11_deserializeOpErrorFilterLogEvents(response *smithyhttp.Respons } } -type awsAwsjson11_deserializeOpGetDataProtectionPolicy struct { +type awsAwsjson11_deserializeOpDescribeMetricFilters struct { } -func (*awsAwsjson11_deserializeOpGetDataProtectionPolicy) ID() string { +func (*awsAwsjson11_deserializeOpDescribeMetricFilters) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetDataProtectionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeMetricFilters) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2931,9 +3036,9 @@ func (m *awsAwsjson11_deserializeOpGetDataProtectionPolicy) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetDataProtectionPolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeMetricFilters(response, &metadata) } - output := &GetDataProtectionPolicyOutput{} + output := &DescribeMetricFiltersOutput{} out.Result = output var buff [1024]byte @@ -2953,7 +3058,7 @@ func (m *awsAwsjson11_deserializeOpGetDataProtectionPolicy) HandleDeserialize(ct return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetDataProtectionPolicyOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeMetricFiltersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2967,7 +3072,7 @@ func (m *awsAwsjson11_deserializeOpGetDataProtectionPolicy) HandleDeserialize(ct return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetDataProtectionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeMetricFilters(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3011,9 +3116,6 @@ func awsAwsjson11_deserializeOpErrorGetDataProtectionPolicy(response *smithyhttp case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("OperationAbortedException", errorCode): - return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -3030,14 +3132,14 @@ func awsAwsjson11_deserializeOpErrorGetDataProtectionPolicy(response *smithyhttp } } -type awsAwsjson11_deserializeOpGetLogEvents struct { +type awsAwsjson11_deserializeOpDescribeQueries struct { } -func (*awsAwsjson11_deserializeOpGetLogEvents) ID() string { +func (*awsAwsjson11_deserializeOpDescribeQueries) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetLogEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeQueries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3051,9 +3153,9 @@ func (m *awsAwsjson11_deserializeOpGetLogEvents) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetLogEvents(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeQueries(response, &metadata) } - output := &GetLogEventsOutput{} + output := &DescribeQueriesOutput{} out.Result = output var buff [1024]byte @@ -3073,7 +3175,7 @@ func (m *awsAwsjson11_deserializeOpGetLogEvents) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetLogEventsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeQueriesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3087,7 +3189,7 @@ func (m *awsAwsjson11_deserializeOpGetLogEvents) HandleDeserialize(ctx context.C return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetLogEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeQueries(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3147,14 +3249,14 @@ func awsAwsjson11_deserializeOpErrorGetLogEvents(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpGetLogGroupFields struct { +type awsAwsjson11_deserializeOpDescribeQueryDefinitions struct { } -func (*awsAwsjson11_deserializeOpGetLogGroupFields) ID() string { +func (*awsAwsjson11_deserializeOpDescribeQueryDefinitions) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetLogGroupFields) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeQueryDefinitions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3168,9 +3270,9 @@ func (m *awsAwsjson11_deserializeOpGetLogGroupFields) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetLogGroupFields(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeQueryDefinitions(response, &metadata) } - output := &GetLogGroupFieldsOutput{} + output := &DescribeQueryDefinitionsOutput{} out.Result = output var buff [1024]byte @@ -3190,7 +3292,7 @@ func (m *awsAwsjson11_deserializeOpGetLogGroupFields) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetLogGroupFieldsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeQueryDefinitionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3204,7 +3306,7 @@ func (m *awsAwsjson11_deserializeOpGetLogGroupFields) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetLogGroupFields(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeQueryDefinitions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3248,12 +3350,6 @@ func awsAwsjson11_deserializeOpErrorGetLogGroupFields(response *smithyhttp.Respo case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) @@ -3267,14 +3363,14 @@ func awsAwsjson11_deserializeOpErrorGetLogGroupFields(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpGetLogRecord struct { +type awsAwsjson11_deserializeOpDescribeResourcePolicies struct { } -func (*awsAwsjson11_deserializeOpGetLogRecord) ID() string { +func (*awsAwsjson11_deserializeOpDescribeResourcePolicies) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetLogRecord) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeResourcePolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3288,9 +3384,9 @@ func (m *awsAwsjson11_deserializeOpGetLogRecord) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetLogRecord(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeResourcePolicies(response, &metadata) } - output := &GetLogRecordOutput{} + output := &DescribeResourcePoliciesOutput{} out.Result = output var buff [1024]byte @@ -3310,7 +3406,7 @@ func (m *awsAwsjson11_deserializeOpGetLogRecord) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetLogRecordOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeResourcePoliciesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3324,7 +3420,7 @@ func (m *awsAwsjson11_deserializeOpGetLogRecord) HandleDeserialize(ctx context.C return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetLogRecord(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeResourcePolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3368,12 +3464,6 @@ func awsAwsjson11_deserializeOpErrorGetLogRecord(response *smithyhttp.Response, case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) @@ -3387,14 +3477,14 @@ func awsAwsjson11_deserializeOpErrorGetLogRecord(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpGetQueryResults struct { +type awsAwsjson11_deserializeOpDescribeSubscriptionFilters struct { } -func (*awsAwsjson11_deserializeOpGetQueryResults) ID() string { +func (*awsAwsjson11_deserializeOpDescribeSubscriptionFilters) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetQueryResults) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeSubscriptionFilters) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3408,9 +3498,9 @@ func (m *awsAwsjson11_deserializeOpGetQueryResults) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetQueryResults(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeSubscriptionFilters(response, &metadata) } - output := &GetQueryResultsOutput{} + output := &DescribeSubscriptionFiltersOutput{} out.Result = output var buff [1024]byte @@ -3430,7 +3520,7 @@ func (m *awsAwsjson11_deserializeOpGetQueryResults) HandleDeserialize(ctx contex return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetQueryResultsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeSubscriptionFiltersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3444,7 +3534,7 @@ func (m *awsAwsjson11_deserializeOpGetQueryResults) HandleDeserialize(ctx contex return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetQueryResults(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeSubscriptionFilters(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3504,14 +3594,14 @@ func awsAwsjson11_deserializeOpErrorGetQueryResults(response *smithyhttp.Respons } } -type awsAwsjson11_deserializeOpListTagsForResource struct { +type awsAwsjson11_deserializeOpDisassociateKmsKey struct { } -func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { +func (*awsAwsjson11_deserializeOpDisassociateKmsKey) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDisassociateKmsKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3525,43 +3615,21 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDisassociateKmsKey(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &DisassociateKmsKeyOutput{} out.Result = output - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(response.Body, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return out, metadata, err - } - - err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + 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 } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDisassociateKmsKey(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3605,6 +3673,9 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -3621,14 +3692,14 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -type awsAwsjson11_deserializeOpListTagsLogGroup struct { +type awsAwsjson11_deserializeOpFilterLogEvents struct { } -func (*awsAwsjson11_deserializeOpListTagsLogGroup) ID() string { +func (*awsAwsjson11_deserializeOpFilterLogEvents) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListTagsLogGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpFilterLogEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3642,9 +3713,9 @@ func (m *awsAwsjson11_deserializeOpListTagsLogGroup) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListTagsLogGroup(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorFilterLogEvents(response, &metadata) } - output := &ListTagsLogGroupOutput{} + output := &FilterLogEventsOutput{} out.Result = output var buff [1024]byte @@ -3664,7 +3735,7 @@ func (m *awsAwsjson11_deserializeOpListTagsLogGroup) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListTagsLogGroupOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentFilterLogEventsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3678,7 +3749,7 @@ func (m *awsAwsjson11_deserializeOpListTagsLogGroup) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListTagsLogGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorFilterLogEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3719,6 +3790,9 @@ func awsAwsjson11_deserializeOpErrorListTagsLogGroup(response *smithyhttp.Respon } switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -3735,14 +3809,14 @@ func awsAwsjson11_deserializeOpErrorListTagsLogGroup(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpPutAccountPolicy struct { +type awsAwsjson11_deserializeOpGetDataProtectionPolicy struct { } -func (*awsAwsjson11_deserializeOpPutAccountPolicy) ID() string { +func (*awsAwsjson11_deserializeOpGetDataProtectionPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutAccountPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetDataProtectionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3756,9 +3830,9 @@ func (m *awsAwsjson11_deserializeOpPutAccountPolicy) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutAccountPolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetDataProtectionPolicy(response, &metadata) } - output := &PutAccountPolicyOutput{} + output := &GetDataProtectionPolicyOutput{} out.Result = output var buff [1024]byte @@ -3778,7 +3852,7 @@ func (m *awsAwsjson11_deserializeOpPutAccountPolicy) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutAccountPolicyOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetDataProtectionPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3792,7 +3866,7 @@ func (m *awsAwsjson11_deserializeOpPutAccountPolicy) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutAccountPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetDataProtectionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3836,12 +3910,12 @@ func awsAwsjson11_deserializeOpErrorPutAccountPolicy(response *smithyhttp.Respon case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("OperationAbortedException", errorCode): return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) @@ -3855,14 +3929,14 @@ func awsAwsjson11_deserializeOpErrorPutAccountPolicy(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpPutDataProtectionPolicy struct { +type awsAwsjson11_deserializeOpGetDelivery struct { } -func (*awsAwsjson11_deserializeOpPutDataProtectionPolicy) ID() string { +func (*awsAwsjson11_deserializeOpGetDelivery) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutDataProtectionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetDelivery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3876,9 +3950,9 @@ func (m *awsAwsjson11_deserializeOpPutDataProtectionPolicy) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutDataProtectionPolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetDelivery(response, &metadata) } - output := &PutDataProtectionPolicyOutput{} + output := &GetDeliveryOutput{} out.Result = output var buff [1024]byte @@ -3898,7 +3972,7 @@ func (m *awsAwsjson11_deserializeOpPutDataProtectionPolicy) HandleDeserialize(ct return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutDataProtectionPolicyOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetDeliveryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3912,7 +3986,7 @@ func (m *awsAwsjson11_deserializeOpPutDataProtectionPolicy) HandleDeserialize(ct return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutDataProtectionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetDelivery(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3953,21 +4027,21 @@ func awsAwsjson11_deserializeOpErrorPutDataProtectionPolicy(response *smithyhttp } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("OperationAbortedException", errorCode): - return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3978,14 +4052,14 @@ func awsAwsjson11_deserializeOpErrorPutDataProtectionPolicy(response *smithyhttp } } -type awsAwsjson11_deserializeOpPutDestination struct { +type awsAwsjson11_deserializeOpGetDeliveryDestination struct { } -func (*awsAwsjson11_deserializeOpPutDestination) ID() string { +func (*awsAwsjson11_deserializeOpGetDeliveryDestination) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetDeliveryDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3999,9 +4073,9 @@ func (m *awsAwsjson11_deserializeOpPutDestination) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutDestination(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetDeliveryDestination(response, &metadata) } - output := &PutDestinationOutput{} + output := &GetDeliveryDestinationOutput{} out.Result = output var buff [1024]byte @@ -4021,7 +4095,7 @@ func (m *awsAwsjson11_deserializeOpPutDestination) HandleDeserialize(ctx context return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutDestinationOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetDeliveryDestinationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4035,7 +4109,7 @@ func (m *awsAwsjson11_deserializeOpPutDestination) HandleDeserialize(ctx context return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetDeliveryDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4076,15 +4150,21 @@ func awsAwsjson11_deserializeOpErrorPutDestination(response *smithyhttp.Response } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("OperationAbortedException", errorCode): - return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4095,14 +4175,14 @@ func awsAwsjson11_deserializeOpErrorPutDestination(response *smithyhttp.Response } } -type awsAwsjson11_deserializeOpPutDestinationPolicy struct { +type awsAwsjson11_deserializeOpGetDeliveryDestinationPolicy struct { } -func (*awsAwsjson11_deserializeOpPutDestinationPolicy) ID() string { +func (*awsAwsjson11_deserializeOpGetDeliveryDestinationPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutDestinationPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetDeliveryDestinationPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4116,21 +4196,43 @@ func (m *awsAwsjson11_deserializeOpPutDestinationPolicy) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutDestinationPolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetDeliveryDestinationPolicy(response, &metadata) } - output := &PutDestinationPolicyOutput{} + output := &GetDeliveryDestinationPolicyOutput{} 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), + 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_deserializeOpDocumentGetDeliveryDestinationPolicyOutput(&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_deserializeOpErrorPutDestinationPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetDeliveryDestinationPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4171,15 +4273,15 @@ func awsAwsjson11_deserializeOpErrorPutDestinationPolicy(response *smithyhttp.Re } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("OperationAbortedException", errorCode): - return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4190,14 +4292,14 @@ func awsAwsjson11_deserializeOpErrorPutDestinationPolicy(response *smithyhttp.Re } } -type awsAwsjson11_deserializeOpPutLogEvents struct { +type awsAwsjson11_deserializeOpGetDeliverySource struct { } -func (*awsAwsjson11_deserializeOpPutLogEvents) ID() string { +func (*awsAwsjson11_deserializeOpGetDeliverySource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutLogEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetDeliverySource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4211,9 +4313,9 @@ func (m *awsAwsjson11_deserializeOpPutLogEvents) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutLogEvents(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetDeliverySource(response, &metadata) } - output := &PutLogEventsOutput{} + output := &GetDeliverySourceOutput{} out.Result = output var buff [1024]byte @@ -4233,7 +4335,7 @@ func (m *awsAwsjson11_deserializeOpPutLogEvents) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutLogEventsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetDeliverySourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4247,7 +4349,7 @@ func (m *awsAwsjson11_deserializeOpPutLogEvents) HandleDeserialize(ctx context.C return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutLogEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetDeliverySource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4288,23 +4390,20 @@ func awsAwsjson11_deserializeOpErrorPutLogEvents(response *smithyhttp.Response, } switch { - case strings.EqualFold("DataAlreadyAcceptedException", errorCode): - return awsAwsjson11_deserializeErrorDataAlreadyAcceptedException(response, errorBody) - - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("InvalidSequenceTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidSequenceTokenException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("UnrecognizedClientException", errorCode): - return awsAwsjson11_deserializeErrorUnrecognizedClientException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -4316,14 +4415,14 @@ func awsAwsjson11_deserializeOpErrorPutLogEvents(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpPutMetricFilter struct { +type awsAwsjson11_deserializeOpGetLogEvents struct { } -func (*awsAwsjson11_deserializeOpPutMetricFilter) ID() string { +func (*awsAwsjson11_deserializeOpGetLogEvents) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutMetricFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetLogEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4337,21 +4436,43 @@ func (m *awsAwsjson11_deserializeOpPutMetricFilter) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutMetricFilter(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetLogEvents(response, &metadata) } - output := &PutMetricFilterOutput{} + output := &GetLogEventsOutput{} 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), + 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_deserializeOpDocumentGetLogEventsOutput(&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_deserializeOpErrorPutMetricFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetLogEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4395,12 +4516,6 @@ func awsAwsjson11_deserializeOpErrorPutMetricFilter(response *smithyhttp.Respons case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("OperationAbortedException", errorCode): - return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -4417,14 +4532,14 @@ func awsAwsjson11_deserializeOpErrorPutMetricFilter(response *smithyhttp.Respons } } -type awsAwsjson11_deserializeOpPutQueryDefinition struct { +type awsAwsjson11_deserializeOpGetLogGroupFields struct { } -func (*awsAwsjson11_deserializeOpPutQueryDefinition) ID() string { +func (*awsAwsjson11_deserializeOpGetLogGroupFields) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutQueryDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetLogGroupFields) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4438,9 +4553,9 @@ func (m *awsAwsjson11_deserializeOpPutQueryDefinition) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutQueryDefinition(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetLogGroupFields(response, &metadata) } - output := &PutQueryDefinitionOutput{} + output := &GetLogGroupFieldsOutput{} out.Result = output var buff [1024]byte @@ -4460,7 +4575,7 @@ func (m *awsAwsjson11_deserializeOpPutQueryDefinition) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutQueryDefinitionOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetLogGroupFieldsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4474,7 +4589,7 @@ func (m *awsAwsjson11_deserializeOpPutQueryDefinition) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutQueryDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetLogGroupFields(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4537,14 +4652,14 @@ func awsAwsjson11_deserializeOpErrorPutQueryDefinition(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpPutResourcePolicy struct { +type awsAwsjson11_deserializeOpGetLogRecord struct { } -func (*awsAwsjson11_deserializeOpPutResourcePolicy) ID() string { +func (*awsAwsjson11_deserializeOpGetLogRecord) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetLogRecord) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4558,9 +4673,9 @@ func (m *awsAwsjson11_deserializeOpPutResourcePolicy) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutResourcePolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetLogRecord(response, &metadata) } - output := &PutResourcePolicyOutput{} + output := &GetLogRecordOutput{} out.Result = output var buff [1024]byte @@ -4580,7 +4695,7 @@ func (m *awsAwsjson11_deserializeOpPutResourcePolicy) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutResourcePolicyOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetLogRecordOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4594,7 +4709,7 @@ func (m *awsAwsjson11_deserializeOpPutResourcePolicy) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetLogRecord(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4641,6 +4756,9 @@ func awsAwsjson11_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Respo case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) @@ -4654,14 +4772,14 @@ func awsAwsjson11_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpPutRetentionPolicy struct { +type awsAwsjson11_deserializeOpGetQueryResults struct { } -func (*awsAwsjson11_deserializeOpPutRetentionPolicy) ID() string { +func (*awsAwsjson11_deserializeOpGetQueryResults) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutRetentionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetQueryResults) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4675,21 +4793,43 @@ func (m *awsAwsjson11_deserializeOpPutRetentionPolicy) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutRetentionPolicy(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetQueryResults(response, &metadata) } - output := &PutRetentionPolicyOutput{} + output := &GetQueryResultsOutput{} 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), + 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_deserializeOpDocumentGetQueryResultsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutRetentionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetQueryResults(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4733,9 +4873,6 @@ func awsAwsjson11_deserializeOpErrorPutRetentionPolicy(response *smithyhttp.Resp case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("OperationAbortedException", errorCode): - return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -4752,14 +4889,14 @@ func awsAwsjson11_deserializeOpErrorPutRetentionPolicy(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpPutSubscriptionFilter struct { +type awsAwsjson11_deserializeOpListTagsForResource struct { } -func (*awsAwsjson11_deserializeOpPutSubscriptionFilter) ID() string { +func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutSubscriptionFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4773,21 +4910,43 @@ func (m *awsAwsjson11_deserializeOpPutSubscriptionFilter) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutSubscriptionFilter(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &PutSubscriptionFilterOutput{} + output := &ListTagsForResourceOutput{} 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), + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } + return out, metadata, err } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutSubscriptionFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4831,12 +4990,6 @@ func awsAwsjson11_deserializeOpErrorPutSubscriptionFilter(response *smithyhttp.R case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("OperationAbortedException", errorCode): - return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -4853,14 +5006,14 @@ func awsAwsjson11_deserializeOpErrorPutSubscriptionFilter(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpStartQuery struct { +type awsAwsjson11_deserializeOpListTagsLogGroup struct { } -func (*awsAwsjson11_deserializeOpStartQuery) ID() string { +func (*awsAwsjson11_deserializeOpListTagsLogGroup) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStartQuery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListTagsLogGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4874,9 +5027,9 @@ func (m *awsAwsjson11_deserializeOpStartQuery) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStartQuery(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListTagsLogGroup(response, &metadata) } - output := &StartQueryOutput{} + output := &ListTagsLogGroupOutput{} out.Result = output var buff [1024]byte @@ -4896,7 +5049,7 @@ func (m *awsAwsjson11_deserializeOpStartQuery) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentStartQueryOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListTagsLogGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4910,7 +5063,7 @@ func (m *awsAwsjson11_deserializeOpStartQuery) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStartQuery(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListTagsLogGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4951,15 +5104,6 @@ func awsAwsjson11_deserializeOpErrorStartQuery(response *smithyhttp.Response, me } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("MalformedQueryException", errorCode): - return awsAwsjson11_deserializeErrorMalformedQueryException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -4976,14 +5120,14 @@ func awsAwsjson11_deserializeOpErrorStartQuery(response *smithyhttp.Response, me } } -type awsAwsjson11_deserializeOpStopQuery struct { +type awsAwsjson11_deserializeOpPutAccountPolicy struct { } -func (*awsAwsjson11_deserializeOpStopQuery) ID() string { +func (*awsAwsjson11_deserializeOpPutAccountPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStopQuery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutAccountPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4997,9 +5141,9 @@ func (m *awsAwsjson11_deserializeOpStopQuery) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStopQuery(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutAccountPolicy(response, &metadata) } - output := &StopQueryOutput{} + output := &PutAccountPolicyOutput{} out.Result = output var buff [1024]byte @@ -5019,7 +5163,7 @@ func (m *awsAwsjson11_deserializeOpStopQuery) HandleDeserialize(ctx context.Cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentStopQueryOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentPutAccountPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5033,7 +5177,7 @@ func (m *awsAwsjson11_deserializeOpStopQuery) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStopQuery(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutAccountPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5077,8 +5221,11 @@ func awsAwsjson11_deserializeOpErrorStopQuery(response *smithyhttp.Response, met case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) @@ -5093,14 +5240,14 @@ func awsAwsjson11_deserializeOpErrorStopQuery(response *smithyhttp.Response, met } } -type awsAwsjson11_deserializeOpTagLogGroup struct { +type awsAwsjson11_deserializeOpPutDataProtectionPolicy struct { } -func (*awsAwsjson11_deserializeOpTagLogGroup) ID() string { +func (*awsAwsjson11_deserializeOpPutDataProtectionPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpTagLogGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutDataProtectionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5114,21 +5261,43 @@ func (m *awsAwsjson11_deserializeOpTagLogGroup) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorTagLogGroup(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutDataProtectionPolicy(response, &metadata) } - output := &TagLogGroupOutput{} + output := &PutDataProtectionPolicyOutput{} 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), + 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_deserializeOpDocumentPutDataProtectionPolicyOutput(&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_deserializeOpErrorTagLogGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutDataProtectionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5172,9 +5341,18 @@ func awsAwsjson11_deserializeOpErrorTagLogGroup(response *smithyhttp.Response, m case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5185,14 +5363,14 @@ func awsAwsjson11_deserializeOpErrorTagLogGroup(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpTagResource struct { +type awsAwsjson11_deserializeOpPutDeliveryDestination struct { } -func (*awsAwsjson11_deserializeOpTagResource) ID() string { +func (*awsAwsjson11_deserializeOpPutDeliveryDestination) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutDeliveryDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5206,21 +5384,43 @@ func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutDeliveryDestination(response, &metadata) } - output := &TagResourceOutput{} + output := &PutDeliveryDestinationOutput{} 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), + 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_deserializeOpDocumentPutDeliveryDestinationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } + return out, metadata, err } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutDeliveryDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5261,17 +5461,23 @@ func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, m } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("TooManyTagsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -5283,14 +5489,14 @@ func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsAwsjson11_deserializeOpTestMetricFilter struct { +type awsAwsjson11_deserializeOpPutDeliveryDestinationPolicy struct { } -func (*awsAwsjson11_deserializeOpTestMetricFilter) ID() string { +func (*awsAwsjson11_deserializeOpPutDeliveryDestinationPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpTestMetricFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutDeliveryDestinationPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5304,9 +5510,9 @@ func (m *awsAwsjson11_deserializeOpTestMetricFilter) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorTestMetricFilter(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutDeliveryDestinationPolicy(response, &metadata) } - output := &TestMetricFilterOutput{} + output := &PutDeliveryDestinationPolicyOutput{} out.Result = output var buff [1024]byte @@ -5326,7 +5532,7 @@ func (m *awsAwsjson11_deserializeOpTestMetricFilter) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentTestMetricFilterOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentPutDeliveryDestinationPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5340,7 +5546,7 @@ func (m *awsAwsjson11_deserializeOpTestMetricFilter) HandleDeserialize(ctx conte return out, metadata, err } -func awsAwsjson11_deserializeOpErrorTestMetricFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutDeliveryDestinationPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5381,12 +5587,18 @@ func awsAwsjson11_deserializeOpErrorTestMetricFilter(response *smithyhttp.Respon } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5397,14 +5609,14 @@ func awsAwsjson11_deserializeOpErrorTestMetricFilter(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpUntagLogGroup struct { +type awsAwsjson11_deserializeOpPutDeliverySource struct { } -func (*awsAwsjson11_deserializeOpUntagLogGroup) ID() string { +func (*awsAwsjson11_deserializeOpPutDeliverySource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUntagLogGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutDeliverySource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5418,21 +5630,43 @@ func (m *awsAwsjson11_deserializeOpUntagLogGroup) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUntagLogGroup(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutDeliverySource(response, &metadata) } - output := &UntagLogGroupOutput{} + output := &PutDeliverySourceOutput{} 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), + 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_deserializeOpDocumentPutDeliverySourceOutput(&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_deserializeOpErrorUntagLogGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutDeliverySource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5473,9 +5707,24 @@ func awsAwsjson11_deserializeOpErrorUntagLogGroup(response *smithyhttp.Response, } switch { + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson11_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -5486,14 +5735,14 @@ func awsAwsjson11_deserializeOpErrorUntagLogGroup(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpUntagResource struct { +type awsAwsjson11_deserializeOpPutDestination struct { } -func (*awsAwsjson11_deserializeOpUntagResource) ID() string { +func (*awsAwsjson11_deserializeOpPutDestination) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5507,21 +5756,43 @@ func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutDestination(response, &metadata) } - output := &UntagResourceOutput{} + output := &PutDestinationOutput{} 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), + 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_deserializeOpDocumentPutDestinationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), } + return out, metadata, err } return out, metadata, err } -func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5565,8 +5836,8 @@ func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) @@ -5581,15 +5852,64 @@ func awsAwsjson11_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -func awsAwsjson11_deserializeErrorDataAlreadyAcceptedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +type awsAwsjson11_deserializeOpPutDestinationPolicy struct { +} + +func (*awsAwsjson11_deserializeOpPutDestinationPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutDestinationPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorPutDestinationPolicy(response, &metadata) + } + output := &PutDestinationPolicyOutput{} + 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_deserializeOpErrorPutDestinationPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -5599,28 +5919,64 @@ func awsAwsjson11_deserializeErrorDataAlreadyAcceptedException(response *smithyh return err } - output := &types.DataAlreadyAcceptedException{} - err := awsAwsjson11_deserializeDocumentDataAlreadyAcceptedException(&output, shape) - - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) - return output +type awsAwsjson11_deserializeOpPutLogEvents struct { } -func awsAwsjson11_deserializeErrorInvalidOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func (*awsAwsjson11_deserializeOpPutLogEvents) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutLogEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorPutLogEvents(response, &metadata) + } + output := &PutLogEventsOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -5631,12 +5987,10 @@ func awsAwsjson11_deserializeErrorInvalidOperationException(response *smithyhttp Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.InvalidOperationException{} - err := awsAwsjson11_deserializeDocumentInvalidOperationException(&output, shape) - + err = awsAwsjson11_deserializeOpDocumentPutLogEventsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5644,22 +5998,35 @@ func awsAwsjson11_deserializeErrorInvalidOperationException(response *smithyhttp Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson11_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeOpErrorPutLogEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -5669,32 +6036,101 @@ func awsAwsjson11_deserializeErrorInvalidParameterException(response *smithyhttp return err } - output := &types.InvalidParameterException{} - err := awsAwsjson11_deserializeDocumentInvalidParameterException(&output, shape) + 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("DataAlreadyAcceptedException", errorCode): + return awsAwsjson11_deserializeErrorDataAlreadyAcceptedException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidSequenceTokenException", errorCode): + return awsAwsjson11_deserializeErrorInvalidSequenceTokenException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("UnrecognizedClientException", errorCode): + return awsAwsjson11_deserializeErrorUnrecognizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} +type awsAwsjson11_deserializeOpPutMetricFilter struct { +} + +func (*awsAwsjson11_deserializeOpPutMetricFilter) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutMetricFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorPutMetricFilter(response, &metadata) + } + output := &PutMetricFilterOutput{} + 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 err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson11_deserializeErrorInvalidSequenceTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeOpErrorPutMetricFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -5704,28 +6140,70 @@ func awsAwsjson11_deserializeErrorInvalidSequenceTokenException(response *smithy return err } - output := &types.InvalidSequenceTokenException{} - err := awsAwsjson11_deserializeDocumentInvalidSequenceTokenException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) - return output +type awsAwsjson11_deserializeOpPutQueryDefinition struct { } -func awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func (*awsAwsjson11_deserializeOpPutQueryDefinition) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutQueryDefinition) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorPutQueryDefinition(response, &metadata) + } + output := &PutQueryDefinitionOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -5736,12 +6214,10 @@ func awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Re Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.LimitExceededException{} - err := awsAwsjson11_deserializeDocumentLimitExceededException(&output, shape) - + err = awsAwsjson11_deserializeOpDocumentPutQueryDefinitionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5749,34 +6225,34 @@ func awsAwsjson11_deserializeErrorLimitExceededException(response *smithyhttp.Re Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson11_deserializeErrorMalformedQueryException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeOpErrorPutQueryDefinition(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot 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.MalformedQueryException{} - err := awsAwsjson11_deserializeDocumentMalformedQueryException(&output, shape) - + jsonCode, message, err := restjson.GetErrorInfo(decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5788,49 +6264,66 @@ func awsAwsjson11_deserializeErrorMalformedQueryException(response *smithyhttp.R } errorBody.Seek(0, io.SeekStart) - return output -} + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } -func awsAwsjson11_deserializeErrorOperationAbortedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - output := &types.OperationAbortedException{} - err := awsAwsjson11_deserializeDocumentOperationAbortedException(&output, shape) +type awsAwsjson11_deserializeOpPutResourcePolicy struct { +} + +func (*awsAwsjson11_deserializeOpPutResourcePolicy) ID() string { + return "OperationDeserializer" +} +func (m *awsAwsjson11_deserializeOpPutResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output -} + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorPutResourcePolicy(response, &metadata) + } + output := &PutResourcePolicyOutput{} + out.Result = output -func awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(response.Body, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -5841,12 +6334,10 @@ func awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response *smith Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - output := &types.ResourceAlreadyExistsException{} - err := awsAwsjson11_deserializeDocumentResourceAlreadyExistsException(&output, shape) - + err = awsAwsjson11_deserializeOpDocumentPutResourcePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5854,22 +6345,35 @@ func awsAwsjson11_deserializeErrorResourceAlreadyExistsException(response *smith Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return err + return out, metadata, err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson11_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + 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() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -5879,67 +6383,92 @@ func awsAwsjson11_deserializeErrorResourceNotFoundException(response *smithyhttp return err } - output := &types.ResourceNotFoundException{} - err := awsAwsjson11_deserializeDocumentResourceNotFoundException(&output, shape) + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } - return err + return genericError + } +} - errorBody.Seek(0, io.SeekStart) - return output +type awsAwsjson11_deserializeOpPutRetentionPolicy struct { } -func awsAwsjson11_deserializeErrorServiceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) +func (*awsAwsjson11_deserializeOpPutRetentionPolicy) ID() string { + return "OperationDeserializer" +} - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err +func (m *awsAwsjson11_deserializeOpPutRetentionPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err } - output := &types.ServiceUnavailableException{} - err := awsAwsjson11_deserializeDocumentServiceUnavailableException(&output, shape) + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorPutRetentionPolicy(response, &metadata) + } + output := &PutRetentionPolicyOutput{} + 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 err } - errorBody.Seek(0, io.SeekStart) - return output + return out, metadata, err } -func awsAwsjson11_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeOpErrorPutRetentionPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + 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() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ @@ -5949,59 +6478,1946 @@ func awsAwsjson11_deserializeErrorTooManyTagsException(response *smithyhttp.Resp return err } - output := &types.TooManyTagsException{} - err := awsAwsjson11_deserializeDocumentTooManyTagsException(&output, shape) + 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("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpPutSubscriptionFilter struct { +} + +func (*awsAwsjson11_deserializeOpPutSubscriptionFilter) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutSubscriptionFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorPutSubscriptionFilter(response, &metadata) + } + output := &PutSubscriptionFilterOutput{} + 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_deserializeOpErrorPutSubscriptionFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpStartQuery struct { +} + +func (*awsAwsjson11_deserializeOpStartQuery) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpStartQuery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorStartQuery(response, &metadata) + } + output := &StartQueryOutput{} + 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_deserializeOpDocumentStartQueryOutput(&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_deserializeOpErrorStartQuery(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("MalformedQueryException", errorCode): + return awsAwsjson11_deserializeErrorMalformedQueryException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpStopQuery struct { +} + +func (*awsAwsjson11_deserializeOpStopQuery) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpStopQuery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorStopQuery(response, &metadata) + } + output := &StopQueryOutput{} + 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_deserializeOpDocumentStopQueryOutput(&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_deserializeOpErrorStopQuery(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpTagLogGroup struct { +} + +func (*awsAwsjson11_deserializeOpTagLogGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpTagLogGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorTagLogGroup(response, &metadata) + } + output := &TagLogGroupOutput{} + 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_deserializeOpErrorTagLogGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpTagResource struct { +} + +func (*awsAwsjson11_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + 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_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("TooManyTagsException", errorCode): + return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpTestMetricFilter struct { +} + +func (*awsAwsjson11_deserializeOpTestMetricFilter) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpTestMetricFilter) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorTestMetricFilter(response, &metadata) + } + output := &TestMetricFilterOutput{} + 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_deserializeOpDocumentTestMetricFilterOutput(&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_deserializeOpErrorTestMetricFilter(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUntagLogGroup struct { +} + +func (*awsAwsjson11_deserializeOpUntagLogGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUntagLogGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUntagLogGroup(response, &metadata) + } + output := &UntagLogGroupOutput{} + 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_deserializeOpErrorUntagLogGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUntagResource struct { +} + +func (*awsAwsjson11_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + 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_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsjson11_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.AccessDeniedException{} + err := awsAwsjson11_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ConflictException{} + err := awsAwsjson11_deserializeDocumentConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorDataAlreadyAcceptedException(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.DataAlreadyAcceptedException{} + err := awsAwsjson11_deserializeDocumentDataAlreadyAcceptedException(&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_deserializeErrorInvalidOperationException(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.InvalidOperationException{} + err := awsAwsjson11_deserializeDocumentInvalidOperationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorInvalidParameterException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.InvalidParameterException{} + err := awsAwsjson11_deserializeDocumentInvalidParameterException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorInvalidSequenceTokenException(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.InvalidSequenceTokenException{} + err := awsAwsjson11_deserializeDocumentInvalidSequenceTokenException(&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_deserializeErrorMalformedQueryException(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.MalformedQueryException{} + err := awsAwsjson11_deserializeDocumentMalformedQueryException(&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_deserializeErrorOperationAbortedException(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.OperationAbortedException{} + err := awsAwsjson11_deserializeDocumentOperationAbortedException(&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_deserializeErrorResourceAlreadyExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ResourceAlreadyExistsException{} + err := awsAwsjson11_deserializeDocumentResourceAlreadyExistsException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ResourceNotFoundException{} + err := awsAwsjson11_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ServiceQuotaExceededException{} + err := awsAwsjson11_deserializeDocumentServiceQuotaExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorServiceUnavailableException(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.ServiceUnavailableException{} + err := awsAwsjson11_deserializeDocumentServiceUnavailableException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ThrottlingException{} + err := awsAwsjson11_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorTooManyTagsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.TooManyTagsException{} + err := awsAwsjson11_deserializeDocumentTooManyTagsException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorUnrecognizedClientException(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.UnrecognizedClientException{} + err := awsAwsjson11_deserializeDocumentUnrecognizedClientException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ValidationException{} + err := awsAwsjson11_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + return output +} + +func awsAwsjson11_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAccountPolicies(v *[]types.AccountPolicy, 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.AccountPolicy + if *v == nil { + cv = []types.AccountPolicy{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AccountPolicy + destAddr := &col + if err := awsAwsjson11_deserializeDocumentAccountPolicy(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentAccountPolicy(v **types.AccountPolicy, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccountPolicy + if *v == nil { + sv = &types.AccountPolicy{} + } 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 AccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "lastUpdatedTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LastUpdatedTime = ptr.Int64(i64) + } + + case "policyDocument": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountPolicyDocument to be of type string, got %T instead", value) + } + sv.PolicyDocument = ptr.String(jtv) + } + + case "policyName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value) + } + sv.PolicyName = ptr.String(jtv) + } + + case "policyType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyType to be of type string, got %T instead", value) + } + sv.PolicyType = types.PolicyType(jtv) + } + + case "scope": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Scope to be of type string, got %T instead", value) + } + sv.Scope = types.Scope(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDataAlreadyAcceptedException(v **types.DataAlreadyAcceptedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DataAlreadyAcceptedException + if *v == nil { + sv = &types.DataAlreadyAcceptedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "expectedSequenceToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SequenceToken to be of type string, got %T instead", value) + } + sv.ExpectedSequenceToken = ptr.String(jtv) + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDeliveries(v *[]types.Delivery, 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.Delivery + if *v == nil { + cv = []types.Delivery{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Delivery + destAddr := &col + if err := awsAwsjson11_deserializeDocumentDelivery(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentDelivery(v **types.Delivery, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Delivery + if *v == nil { + sv = &types.Delivery{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "deliveryDestinationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.DeliveryDestinationArn = ptr.String(jtv) + } + + case "deliveryDestinationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeliveryDestinationType to be of type string, got %T instead", value) + } + sv.DeliveryDestinationType = types.DeliveryDestinationType(jtv) + } + + case "deliverySourceName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeliverySourceName to be of type string, got %T instead", value) + } + sv.DeliverySourceName = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeliveryId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "tags": + if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDeliveryDestination(v **types.DeliveryDestination, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.DeliveryDestination + if *v == nil { + sv = &types.DeliveryDestination{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "deliveryDestinationConfiguration": + if err := awsAwsjson11_deserializeDocumentDeliveryDestinationConfiguration(&sv.DeliveryDestinationConfiguration, value); err != nil { + return err + } + + case "deliveryDestinationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeliveryDestinationType to be of type string, got %T instead", value) + } + sv.DeliveryDestinationType = types.DeliveryDestinationType(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeliveryDestinationName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "outputFormat": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OutputFormat to be of type string, got %T instead", value) + } + sv.OutputFormat = types.OutputFormat(jtv) + } + + case "tags": + if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), } - return err } - - errorBody.Seek(0, io.SeekStart) - return output + *v = sv + return nil } -func awsAwsjson11_deserializeErrorUnrecognizedClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) +func awsAwsjson11_deserializeDocumentDeliveryDestinationConfiguration(v **types.DeliveryDestinationConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - 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 + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - output := &types.UnrecognizedClientException{} - err := awsAwsjson11_deserializeDocumentUnrecognizedClientException(&output, shape) + var sv *types.DeliveryDestinationConfiguration + if *v == nil { + sv = &types.DeliveryDestinationConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "destinationResourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.DestinationResourceArn = ptr.String(jtv) + } + + default: + _, _ = key, value - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), } - return err } - - errorBody.Seek(0, io.SeekStart) - return output + *v = sv + return nil } -func awsAwsjson11_deserializeDocumentAccountPolicies(v *[]types.AccountPolicy, value interface{}) error { +func awsAwsjson11_deserializeDocumentDeliveryDestinations(v *[]types.DeliveryDestination, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6014,17 +8430,17 @@ func awsAwsjson11_deserializeDocumentAccountPolicies(v *[]types.AccountPolicy, v return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AccountPolicy + var cv []types.DeliveryDestination if *v == nil { - cv = []types.AccountPolicy{} + cv = []types.DeliveryDestination{} } else { cv = *v } for _, value := range shape { - var col types.AccountPolicy + var col types.DeliveryDestination destAddr := &col - if err := awsAwsjson11_deserializeDocumentAccountPolicy(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentDeliveryDestination(&destAddr, value); err != nil { return err } col = *destAddr @@ -6035,7 +8451,7 @@ func awsAwsjson11_deserializeDocumentAccountPolicies(v *[]types.AccountPolicy, v return nil } -func awsAwsjson11_deserializeDocumentAccountPolicy(v **types.AccountPolicy, value interface{}) error { +func awsAwsjson11_deserializeDocumentDeliverySource(v **types.DeliverySource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6048,71 +8464,59 @@ func awsAwsjson11_deserializeDocumentAccountPolicy(v **types.AccountPolicy, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AccountPolicy + var sv *types.DeliverySource if *v == nil { - sv = &types.AccountPolicy{} + sv = &types.DeliverySource{} } else { sv = *v } for key, value := range shape { switch key { - case "accountId": + case "arn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } - sv.AccountId = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } - case "lastUpdatedTime": + case "logType": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + return fmt.Errorf("expected LogType to be of type string, got %T instead", value) } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.LastUpdatedTime = ptr.Int64(i64) + sv.LogType = ptr.String(jtv) } - case "policyDocument": + case "name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AccountPolicyDocument to be of type string, got %T instead", value) + return fmt.Errorf("expected DeliverySourceName to be of type string, got %T instead", value) } - sv.PolicyDocument = ptr.String(jtv) + sv.Name = ptr.String(jtv) } - case "policyName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value) - } - sv.PolicyName = ptr.String(jtv) + case "resourceArns": + if err := awsAwsjson11_deserializeDocumentResourceArns(&sv.ResourceArns, value); err != nil { + return err } - case "policyType": + case "service": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PolicyType to be of type string, got %T instead", value) + return fmt.Errorf("expected Service to be of type string, got %T instead", value) } - sv.PolicyType = types.PolicyType(jtv) + sv.Service = ptr.String(jtv) } - case "scope": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Scope to be of type string, got %T instead", value) - } - sv.Scope = types.Scope(jtv) + case "tags": + if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err } default: @@ -6124,7 +8528,7 @@ func awsAwsjson11_deserializeDocumentAccountPolicy(v **types.AccountPolicy, valu return nil } -func awsAwsjson11_deserializeDocumentDataAlreadyAcceptedException(v **types.DataAlreadyAcceptedException, value interface{}) error { +func awsAwsjson11_deserializeDocumentDeliverySources(v *[]types.DeliverySource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6132,44 +8536,29 @@ func awsAwsjson11_deserializeDocumentDataAlreadyAcceptedException(v **types.Data return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DataAlreadyAcceptedException + var cv []types.DeliverySource if *v == nil { - sv = &types.DataAlreadyAcceptedException{} + cv = []types.DeliverySource{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "expectedSequenceToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SequenceToken to be of type string, got %T instead", value) - } - sv.ExpectedSequenceToken = ptr.String(jtv) - } - - case "message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Message to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.DeliverySource + destAddr := &col + if err := awsAwsjson11_deserializeDocumentDeliverySource(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } @@ -7944,6 +10333,46 @@ func awsAwsjson11_deserializeDocumentOutputLogEvents(v *[]types.OutputLogEvent, return nil } +func awsAwsjson11_deserializeDocumentPolicy(v **types.Policy, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Policy + if *v == nil { + sv = &types.Policy{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "deliveryDestinationPolicy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeliveryDestinationPolicy to be of type string, got %T instead", value) + } + sv.DeliveryDestinationPolicy = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentQueryCompileError(v **types.QueryCompileError, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8545,6 +10974,42 @@ func awsAwsjson11_deserializeDocumentResourceAlreadyExistsException(v **types.Re return nil } +func awsAwsjson11_deserializeDocumentResourceArns(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8809,11 +11274,45 @@ func awsAwsjson11_deserializeDocumentSearchedLogStream(v **types.SearchedLogStre } } - *v = sv + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentSearchedLogStreams(v *[]types.SearchedLogStream, 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.SearchedLogStream + if *v == nil { + cv = []types.SearchedLogStream{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SearchedLogStream + destAddr := &col + if err := awsAwsjson11_deserializeDocumentSearchedLogStream(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv return nil } -func awsAwsjson11_deserializeDocumentSearchedLogStreams(v *[]types.SearchedLogStream, value interface{}) error { +func awsAwsjson11_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8821,29 +11320,35 @@ func awsAwsjson11_deserializeDocumentSearchedLogStreams(v *[]types.SearchedLogSt return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.SearchedLogStream + var sv *types.ServiceQuotaExceededException if *v == nil { - cv = []types.SearchedLogStream{} + sv = &types.ServiceQuotaExceededException{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.SearchedLogStream - destAddr := &col - if err := awsAwsjson11_deserializeDocumentSearchedLogStream(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } @@ -9055,6 +11560,46 @@ func awsAwsjson11_deserializeDocumentTags(v *map[string]string, value interface{ return nil } +func awsAwsjson11_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9144,6 +11689,82 @@ func awsAwsjson11_deserializeDocumentUnrecognizedClientException(v **types.Unrec return nil } +func awsAwsjson11_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentCreateDeliveryOutput(v **CreateDeliveryOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateDeliveryOutput + if *v == nil { + sv = &CreateDeliveryOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "delivery": + if err := awsAwsjson11_deserializeDocumentDelivery(&sv.Delivery, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentCreateExportTaskOutput(v **CreateExportTaskOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9157,22 +11778,143 @@ func awsAwsjson11_deserializeOpDocumentCreateExportTaskOutput(v **CreateExportTa return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateExportTaskOutput + var sv *CreateExportTaskOutput + if *v == nil { + sv = &CreateExportTaskOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "taskId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExportTaskId to be of type string, got %T instead", value) + } + sv.TaskId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDeleteQueryDefinitionOutput(v **DeleteQueryDefinitionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteQueryDefinitionOutput + if *v == nil { + sv = &DeleteQueryDefinitionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "success": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Success to be of type *bool, got %T instead", value) + } + sv.Success = jtv + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDescribeAccountPoliciesOutput(v **DescribeAccountPoliciesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeAccountPoliciesOutput + if *v == nil { + sv = &DescribeAccountPoliciesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accountPolicies": + if err := awsAwsjson11_deserializeDocumentAccountPolicies(&sv.AccountPolicies, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDescribeDeliveriesOutput(v **DescribeDeliveriesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeDeliveriesOutput if *v == nil { - sv = &CreateExportTaskOutput{} + sv = &DescribeDeliveriesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "taskId": + case "deliveries": + if err := awsAwsjson11_deserializeDocumentDeliveries(&sv.Deliveries, value); err != nil { + return err + } + + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ExportTaskId to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.TaskId = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } default: @@ -9184,7 +11926,7 @@ func awsAwsjson11_deserializeOpDocumentCreateExportTaskOutput(v **CreateExportTa return nil } -func awsAwsjson11_deserializeOpDocumentDeleteQueryDefinitionOutput(v **DeleteQueryDefinitionOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentDescribeDeliveryDestinationsOutput(v **DescribeDeliveryDestinationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9197,22 +11939,27 @@ func awsAwsjson11_deserializeOpDocumentDeleteQueryDefinitionOutput(v **DeleteQue return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteQueryDefinitionOutput + var sv *DescribeDeliveryDestinationsOutput if *v == nil { - sv = &DeleteQueryDefinitionOutput{} + sv = &DescribeDeliveryDestinationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "success": + case "deliveryDestinations": + if err := awsAwsjson11_deserializeDocumentDeliveryDestinations(&sv.DeliveryDestinations, value); err != nil { + return err + } + + case "nextToken": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Success to be of type *bool, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.Success = jtv + sv.NextToken = ptr.String(jtv) } default: @@ -9224,7 +11971,7 @@ func awsAwsjson11_deserializeOpDocumentDeleteQueryDefinitionOutput(v **DeleteQue return nil } -func awsAwsjson11_deserializeOpDocumentDescribeAccountPoliciesOutput(v **DescribeAccountPoliciesOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentDescribeDeliverySourcesOutput(v **DescribeDeliverySourcesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -9237,20 +11984,29 @@ func awsAwsjson11_deserializeOpDocumentDescribeAccountPoliciesOutput(v **Describ return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeAccountPoliciesOutput + var sv *DescribeDeliverySourcesOutput if *v == nil { - sv = &DescribeAccountPoliciesOutput{} + sv = &DescribeDeliverySourcesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "accountPolicies": - if err := awsAwsjson11_deserializeDocumentAccountPolicies(&sv.AccountPolicies, value); err != nil { + case "deliverySources": + if err := awsAwsjson11_deserializeDocumentDeliverySources(&sv.DeliverySources, 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 @@ -9777,6 +12533,150 @@ func awsAwsjson11_deserializeOpDocumentGetDataProtectionPolicyOutput(v **GetData return nil } +func awsAwsjson11_deserializeOpDocumentGetDeliveryDestinationOutput(v **GetDeliveryDestinationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetDeliveryDestinationOutput + if *v == nil { + sv = &GetDeliveryDestinationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "deliveryDestination": + if err := awsAwsjson11_deserializeDocumentDeliveryDestination(&sv.DeliveryDestination, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetDeliveryDestinationPolicyOutput(v **GetDeliveryDestinationPolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetDeliveryDestinationPolicyOutput + if *v == nil { + sv = &GetDeliveryDestinationPolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "policy": + if err := awsAwsjson11_deserializeDocumentPolicy(&sv.Policy, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetDeliveryOutput(v **GetDeliveryOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetDeliveryOutput + if *v == nil { + sv = &GetDeliveryOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "delivery": + if err := awsAwsjson11_deserializeDocumentDelivery(&sv.Delivery, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetDeliverySourceOutput(v **GetDeliverySourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetDeliverySourceOutput + if *v == nil { + sv = &GetDeliverySourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "deliverySource": + if err := awsAwsjson11_deserializeDocumentDeliverySource(&sv.DeliverySource, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentGetLogEventsOutput(v **GetLogEventsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10132,6 +13032,114 @@ func awsAwsjson11_deserializeOpDocumentPutDataProtectionPolicyOutput(v **PutData return nil } +func awsAwsjson11_deserializeOpDocumentPutDeliveryDestinationOutput(v **PutDeliveryDestinationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutDeliveryDestinationOutput + if *v == nil { + sv = &PutDeliveryDestinationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "deliveryDestination": + if err := awsAwsjson11_deserializeDocumentDeliveryDestination(&sv.DeliveryDestination, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentPutDeliveryDestinationPolicyOutput(v **PutDeliveryDestinationPolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutDeliveryDestinationPolicyOutput + if *v == nil { + sv = &PutDeliveryDestinationPolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "policy": + if err := awsAwsjson11_deserializeDocumentPolicy(&sv.Policy, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentPutDeliverySourceOutput(v **PutDeliverySourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutDeliverySourceOutput + if *v == nil { + sv = &PutDeliverySourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "deliverySource": + if err := awsAwsjson11_deserializeDocumentDeliverySource(&sv.DeliverySource, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentPutDestinationOutput(v **PutDestinationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/cloudwatchlogs/endpoints.go b/service/cloudwatchlogs/endpoints.go index 36d96c37be2..b80c023e0e5 100644 --- a/service/cloudwatchlogs/endpoints.go +++ b/service/cloudwatchlogs/endpoints.go @@ -430,7 +430,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { if _Region == "us-gov-east-1" { uriString := "https://logs.us-gov-east-1.amazonaws.com" diff --git a/service/cloudwatchlogs/generated.json b/service/cloudwatchlogs/generated.json index 4ca5b4bf985..4f07579806c 100644 --- a/service/cloudwatchlogs/generated.json +++ b/service/cloudwatchlogs/generated.json @@ -11,11 +11,16 @@ "api_client_test.go", "api_op_AssociateKmsKey.go", "api_op_CancelExportTask.go", + "api_op_CreateDelivery.go", "api_op_CreateExportTask.go", "api_op_CreateLogGroup.go", "api_op_CreateLogStream.go", "api_op_DeleteAccountPolicy.go", "api_op_DeleteDataProtectionPolicy.go", + "api_op_DeleteDelivery.go", + "api_op_DeleteDeliveryDestination.go", + "api_op_DeleteDeliveryDestinationPolicy.go", + "api_op_DeleteDeliverySource.go", "api_op_DeleteDestination.go", "api_op_DeleteLogGroup.go", "api_op_DeleteLogStream.go", @@ -25,6 +30,9 @@ "api_op_DeleteRetentionPolicy.go", "api_op_DeleteSubscriptionFilter.go", "api_op_DescribeAccountPolicies.go", + "api_op_DescribeDeliveries.go", + "api_op_DescribeDeliveryDestinations.go", + "api_op_DescribeDeliverySources.go", "api_op_DescribeDestinations.go", "api_op_DescribeExportTasks.go", "api_op_DescribeLogGroups.go", @@ -37,6 +45,10 @@ "api_op_DisassociateKmsKey.go", "api_op_FilterLogEvents.go", "api_op_GetDataProtectionPolicy.go", + "api_op_GetDelivery.go", + "api_op_GetDeliveryDestination.go", + "api_op_GetDeliveryDestinationPolicy.go", + "api_op_GetDeliverySource.go", "api_op_GetLogEvents.go", "api_op_GetLogGroupFields.go", "api_op_GetLogRecord.go", @@ -45,6 +57,9 @@ "api_op_ListTagsLogGroup.go", "api_op_PutAccountPolicy.go", "api_op_PutDataProtectionPolicy.go", + "api_op_PutDeliveryDestination.go", + "api_op_PutDeliveryDestinationPolicy.go", + "api_op_PutDeliverySource.go", "api_op_PutDestination.go", "api_op_PutDestinationPolicy.go", "api_op_PutLogEvents.go", diff --git a/service/cloudwatchlogs/serializers.go b/service/cloudwatchlogs/serializers.go index eb03ad071f4..15270d9d133 100644 --- a/service/cloudwatchlogs/serializers.go +++ b/service/cloudwatchlogs/serializers.go @@ -126,6 +126,61 @@ func (m *awsAwsjson11_serializeOpCancelExportTask) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpCreateDelivery struct { +} + +func (*awsAwsjson11_serializeOpCreateDelivery) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateDelivery) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDeliveryInput) + _ = 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("Logs_20140328.CreateDelivery") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateDeliveryInput(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_serializeOpCreateExportTask struct { } @@ -401,14 +456,14 @@ func (m *awsAwsjson11_serializeOpDeleteDataProtectionPolicy) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDeleteDestination struct { +type awsAwsjson11_serializeOpDeleteDelivery struct { } -func (*awsAwsjson11_serializeOpDeleteDestination) ID() string { +func (*awsAwsjson11_serializeOpDeleteDelivery) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDeleteDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeleteDelivery) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -416,7 +471,7 @@ func (m *awsAwsjson11_serializeOpDeleteDestination) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteDestinationInput) + input, ok := in.Parameters.(*DeleteDeliveryInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -437,10 +492,10 @@ func (m *awsAwsjson11_serializeOpDeleteDestination) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteDestination") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteDelivery") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeleteDestinationInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeleteDeliveryInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -456,14 +511,14 @@ func (m *awsAwsjson11_serializeOpDeleteDestination) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDeleteLogGroup struct { +type awsAwsjson11_serializeOpDeleteDeliveryDestination struct { } -func (*awsAwsjson11_serializeOpDeleteLogGroup) ID() string { +func (*awsAwsjson11_serializeOpDeleteDeliveryDestination) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDeleteLogGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeleteDeliveryDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -471,7 +526,7 @@ func (m *awsAwsjson11_serializeOpDeleteLogGroup) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteLogGroupInput) + input, ok := in.Parameters.(*DeleteDeliveryDestinationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -492,10 +547,10 @@ func (m *awsAwsjson11_serializeOpDeleteLogGroup) HandleSerialize(ctx context.Con return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteLogGroup") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteDeliveryDestination") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeleteLogGroupInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeleteDeliveryDestinationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -511,14 +566,14 @@ func (m *awsAwsjson11_serializeOpDeleteLogGroup) HandleSerialize(ctx context.Con return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDeleteLogStream struct { +type awsAwsjson11_serializeOpDeleteDeliveryDestinationPolicy struct { } -func (*awsAwsjson11_serializeOpDeleteLogStream) ID() string { +func (*awsAwsjson11_serializeOpDeleteDeliveryDestinationPolicy) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDeleteLogStream) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeleteDeliveryDestinationPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -526,7 +581,7 @@ func (m *awsAwsjson11_serializeOpDeleteLogStream) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteLogStreamInput) + input, ok := in.Parameters.(*DeleteDeliveryDestinationPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -547,10 +602,10 @@ func (m *awsAwsjson11_serializeOpDeleteLogStream) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteLogStream") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteDeliveryDestinationPolicy") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeleteLogStreamInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeleteDeliveryDestinationPolicyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -566,14 +621,14 @@ func (m *awsAwsjson11_serializeOpDeleteLogStream) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDeleteMetricFilter struct { +type awsAwsjson11_serializeOpDeleteDeliverySource struct { } -func (*awsAwsjson11_serializeOpDeleteMetricFilter) ID() string { +func (*awsAwsjson11_serializeOpDeleteDeliverySource) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDeleteMetricFilter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeleteDeliverySource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -581,7 +636,7 @@ func (m *awsAwsjson11_serializeOpDeleteMetricFilter) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteMetricFilterInput) + input, ok := in.Parameters.(*DeleteDeliverySourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -602,10 +657,10 @@ func (m *awsAwsjson11_serializeOpDeleteMetricFilter) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteMetricFilter") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteDeliverySource") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeleteMetricFilterInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeleteDeliverySourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -621,14 +676,14 @@ func (m *awsAwsjson11_serializeOpDeleteMetricFilter) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDeleteQueryDefinition struct { +type awsAwsjson11_serializeOpDeleteDestination struct { } -func (*awsAwsjson11_serializeOpDeleteQueryDefinition) ID() string { +func (*awsAwsjson11_serializeOpDeleteDestination) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDeleteQueryDefinition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeleteDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -636,7 +691,7 @@ func (m *awsAwsjson11_serializeOpDeleteQueryDefinition) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteQueryDefinitionInput) + input, ok := in.Parameters.(*DeleteDestinationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -657,10 +712,10 @@ func (m *awsAwsjson11_serializeOpDeleteQueryDefinition) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteQueryDefinition") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteDestination") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeleteQueryDefinitionInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeleteDestinationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -676,14 +731,14 @@ func (m *awsAwsjson11_serializeOpDeleteQueryDefinition) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDeleteResourcePolicy struct { +type awsAwsjson11_serializeOpDeleteLogGroup struct { } -func (*awsAwsjson11_serializeOpDeleteResourcePolicy) ID() string { +func (*awsAwsjson11_serializeOpDeleteLogGroup) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDeleteResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeleteLogGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -691,7 +746,7 @@ func (m *awsAwsjson11_serializeOpDeleteResourcePolicy) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteResourcePolicyInput) + input, ok := in.Parameters.(*DeleteLogGroupInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -712,10 +767,10 @@ func (m *awsAwsjson11_serializeOpDeleteResourcePolicy) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteResourcePolicy") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteLogGroup") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeleteResourcePolicyInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeleteLogGroupInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -731,14 +786,14 @@ func (m *awsAwsjson11_serializeOpDeleteResourcePolicy) HandleSerialize(ctx conte return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDeleteRetentionPolicy struct { +type awsAwsjson11_serializeOpDeleteLogStream struct { } -func (*awsAwsjson11_serializeOpDeleteRetentionPolicy) ID() string { +func (*awsAwsjson11_serializeOpDeleteLogStream) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDeleteRetentionPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeleteLogStream) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -746,7 +801,7 @@ func (m *awsAwsjson11_serializeOpDeleteRetentionPolicy) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteRetentionPolicyInput) + input, ok := in.Parameters.(*DeleteLogStreamInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -767,10 +822,10 @@ func (m *awsAwsjson11_serializeOpDeleteRetentionPolicy) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteRetentionPolicy") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteLogStream") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeleteRetentionPolicyInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeleteLogStreamInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -786,14 +841,14 @@ func (m *awsAwsjson11_serializeOpDeleteRetentionPolicy) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDeleteSubscriptionFilter struct { +type awsAwsjson11_serializeOpDeleteMetricFilter struct { } -func (*awsAwsjson11_serializeOpDeleteSubscriptionFilter) ID() string { +func (*awsAwsjson11_serializeOpDeleteMetricFilter) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDeleteSubscriptionFilter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeleteMetricFilter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -801,7 +856,7 @@ func (m *awsAwsjson11_serializeOpDeleteSubscriptionFilter) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DeleteSubscriptionFilterInput) + input, ok := in.Parameters.(*DeleteMetricFilterInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -822,10 +877,10 @@ func (m *awsAwsjson11_serializeOpDeleteSubscriptionFilter) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteSubscriptionFilter") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteMetricFilter") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDeleteSubscriptionFilterInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeleteMetricFilterInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -841,14 +896,14 @@ func (m *awsAwsjson11_serializeOpDeleteSubscriptionFilter) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDescribeAccountPolicies struct { +type awsAwsjson11_serializeOpDeleteQueryDefinition struct { } -func (*awsAwsjson11_serializeOpDescribeAccountPolicies) ID() string { +func (*awsAwsjson11_serializeOpDeleteQueryDefinition) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDescribeAccountPolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeleteQueryDefinition) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -856,7 +911,7 @@ func (m *awsAwsjson11_serializeOpDescribeAccountPolicies) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeAccountPoliciesInput) + input, ok := in.Parameters.(*DeleteQueryDefinitionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -877,10 +932,10 @@ func (m *awsAwsjson11_serializeOpDescribeAccountPolicies) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeAccountPolicies") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteQueryDefinition") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeAccountPoliciesInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeleteQueryDefinitionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -896,14 +951,14 @@ func (m *awsAwsjson11_serializeOpDescribeAccountPolicies) HandleSerialize(ctx co return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDescribeDestinations struct { +type awsAwsjson11_serializeOpDeleteResourcePolicy struct { } -func (*awsAwsjson11_serializeOpDescribeDestinations) ID() string { +func (*awsAwsjson11_serializeOpDeleteResourcePolicy) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDescribeDestinations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeleteResourcePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -911,7 +966,7 @@ func (m *awsAwsjson11_serializeOpDescribeDestinations) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeDestinationsInput) + input, ok := in.Parameters.(*DeleteResourcePolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -932,10 +987,10 @@ func (m *awsAwsjson11_serializeOpDescribeDestinations) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeDestinations") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteResourcePolicy") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeDestinationsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeleteResourcePolicyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -951,14 +1006,14 @@ func (m *awsAwsjson11_serializeOpDescribeDestinations) HandleSerialize(ctx conte return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDescribeExportTasks struct { +type awsAwsjson11_serializeOpDeleteRetentionPolicy struct { } -func (*awsAwsjson11_serializeOpDescribeExportTasks) ID() string { +func (*awsAwsjson11_serializeOpDeleteRetentionPolicy) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDescribeExportTasks) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeleteRetentionPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -966,7 +1021,7 @@ func (m *awsAwsjson11_serializeOpDescribeExportTasks) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeExportTasksInput) + input, ok := in.Parameters.(*DeleteRetentionPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -987,10 +1042,10 @@ func (m *awsAwsjson11_serializeOpDescribeExportTasks) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeExportTasks") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteRetentionPolicy") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeExportTasksInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeleteRetentionPolicyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1006,14 +1061,14 @@ func (m *awsAwsjson11_serializeOpDescribeExportTasks) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDescribeLogGroups struct { +type awsAwsjson11_serializeOpDeleteSubscriptionFilter struct { } -func (*awsAwsjson11_serializeOpDescribeLogGroups) ID() string { +func (*awsAwsjson11_serializeOpDeleteSubscriptionFilter) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDescribeLogGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDeleteSubscriptionFilter) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1021,7 +1076,7 @@ func (m *awsAwsjson11_serializeOpDescribeLogGroups) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeLogGroupsInput) + input, ok := in.Parameters.(*DeleteSubscriptionFilterInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1042,10 +1097,10 @@ func (m *awsAwsjson11_serializeOpDescribeLogGroups) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeLogGroups") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteSubscriptionFilter") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeLogGroupsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDeleteSubscriptionFilterInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1061,14 +1116,14 @@ func (m *awsAwsjson11_serializeOpDescribeLogGroups) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDescribeLogStreams struct { +type awsAwsjson11_serializeOpDescribeAccountPolicies struct { } -func (*awsAwsjson11_serializeOpDescribeLogStreams) ID() string { +func (*awsAwsjson11_serializeOpDescribeAccountPolicies) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDescribeLogStreams) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDescribeAccountPolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1076,7 +1131,7 @@ func (m *awsAwsjson11_serializeOpDescribeLogStreams) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeLogStreamsInput) + input, ok := in.Parameters.(*DescribeAccountPoliciesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1097,10 +1152,10 @@ func (m *awsAwsjson11_serializeOpDescribeLogStreams) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeLogStreams") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeAccountPolicies") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeLogStreamsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDescribeAccountPoliciesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1116,14 +1171,14 @@ func (m *awsAwsjson11_serializeOpDescribeLogStreams) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDescribeMetricFilters struct { +type awsAwsjson11_serializeOpDescribeDeliveries struct { } -func (*awsAwsjson11_serializeOpDescribeMetricFilters) ID() string { +func (*awsAwsjson11_serializeOpDescribeDeliveries) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDescribeMetricFilters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDescribeDeliveries) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1131,7 +1186,7 @@ func (m *awsAwsjson11_serializeOpDescribeMetricFilters) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeMetricFiltersInput) + input, ok := in.Parameters.(*DescribeDeliveriesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1152,10 +1207,10 @@ func (m *awsAwsjson11_serializeOpDescribeMetricFilters) HandleSerialize(ctx cont return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeMetricFilters") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeDeliveries") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeMetricFiltersInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDescribeDeliveriesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1171,14 +1226,14 @@ func (m *awsAwsjson11_serializeOpDescribeMetricFilters) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDescribeQueries struct { +type awsAwsjson11_serializeOpDescribeDeliveryDestinations struct { } -func (*awsAwsjson11_serializeOpDescribeQueries) ID() string { +func (*awsAwsjson11_serializeOpDescribeDeliveryDestinations) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDescribeQueries) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDescribeDeliveryDestinations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1186,7 +1241,7 @@ func (m *awsAwsjson11_serializeOpDescribeQueries) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeQueriesInput) + input, ok := in.Parameters.(*DescribeDeliveryDestinationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1207,10 +1262,10 @@ func (m *awsAwsjson11_serializeOpDescribeQueries) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeQueries") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeDeliveryDestinations") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeQueriesInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDescribeDeliveryDestinationsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1226,14 +1281,14 @@ func (m *awsAwsjson11_serializeOpDescribeQueries) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDescribeQueryDefinitions struct { +type awsAwsjson11_serializeOpDescribeDeliverySources struct { } -func (*awsAwsjson11_serializeOpDescribeQueryDefinitions) ID() string { +func (*awsAwsjson11_serializeOpDescribeDeliverySources) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDescribeQueryDefinitions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDescribeDeliverySources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1241,7 +1296,7 @@ func (m *awsAwsjson11_serializeOpDescribeQueryDefinitions) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeQueryDefinitionsInput) + input, ok := in.Parameters.(*DescribeDeliverySourcesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1262,10 +1317,10 @@ func (m *awsAwsjson11_serializeOpDescribeQueryDefinitions) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeQueryDefinitions") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeDeliverySources") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeQueryDefinitionsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDescribeDeliverySourcesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1281,14 +1336,14 @@ func (m *awsAwsjson11_serializeOpDescribeQueryDefinitions) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDescribeResourcePolicies struct { +type awsAwsjson11_serializeOpDescribeDestinations struct { } -func (*awsAwsjson11_serializeOpDescribeResourcePolicies) ID() string { +func (*awsAwsjson11_serializeOpDescribeDestinations) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDescribeResourcePolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDescribeDestinations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1296,7 +1351,7 @@ func (m *awsAwsjson11_serializeOpDescribeResourcePolicies) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeResourcePoliciesInput) + input, ok := in.Parameters.(*DescribeDestinationsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1317,10 +1372,10 @@ func (m *awsAwsjson11_serializeOpDescribeResourcePolicies) HandleSerialize(ctx c return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeResourcePolicies") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeDestinations") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeResourcePoliciesInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDescribeDestinationsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1336,14 +1391,14 @@ func (m *awsAwsjson11_serializeOpDescribeResourcePolicies) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDescribeSubscriptionFilters struct { +type awsAwsjson11_serializeOpDescribeExportTasks struct { } -func (*awsAwsjson11_serializeOpDescribeSubscriptionFilters) ID() string { +func (*awsAwsjson11_serializeOpDescribeExportTasks) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDescribeSubscriptionFilters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDescribeExportTasks) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1351,7 +1406,7 @@ func (m *awsAwsjson11_serializeOpDescribeSubscriptionFilters) HandleSerialize(ct return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DescribeSubscriptionFiltersInput) + input, ok := in.Parameters.(*DescribeExportTasksInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1372,10 +1427,10 @@ func (m *awsAwsjson11_serializeOpDescribeSubscriptionFilters) HandleSerialize(ct return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeSubscriptionFilters") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeExportTasks") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDescribeSubscriptionFiltersInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDescribeExportTasksInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1391,14 +1446,14 @@ func (m *awsAwsjson11_serializeOpDescribeSubscriptionFilters) HandleSerialize(ct return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpDisassociateKmsKey struct { +type awsAwsjson11_serializeOpDescribeLogGroups struct { } -func (*awsAwsjson11_serializeOpDisassociateKmsKey) ID() string { +func (*awsAwsjson11_serializeOpDescribeLogGroups) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpDisassociateKmsKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDescribeLogGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1406,7 +1461,7 @@ func (m *awsAwsjson11_serializeOpDisassociateKmsKey) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*DisassociateKmsKeyInput) + input, ok := in.Parameters.(*DescribeLogGroupsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1427,10 +1482,10 @@ func (m *awsAwsjson11_serializeOpDisassociateKmsKey) HandleSerialize(ctx context return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DisassociateKmsKey") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeLogGroups") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentDisassociateKmsKeyInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDescribeLogGroupsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1446,14 +1501,14 @@ func (m *awsAwsjson11_serializeOpDisassociateKmsKey) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpFilterLogEvents struct { +type awsAwsjson11_serializeOpDescribeLogStreams struct { } -func (*awsAwsjson11_serializeOpFilterLogEvents) ID() string { +func (*awsAwsjson11_serializeOpDescribeLogStreams) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpFilterLogEvents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDescribeLogStreams) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1461,7 +1516,7 @@ func (m *awsAwsjson11_serializeOpFilterLogEvents) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*FilterLogEventsInput) + input, ok := in.Parameters.(*DescribeLogStreamsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1482,10 +1537,10 @@ func (m *awsAwsjson11_serializeOpFilterLogEvents) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.FilterLogEvents") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeLogStreams") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentFilterLogEventsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentDescribeLogStreamsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1501,14 +1556,14 @@ func (m *awsAwsjson11_serializeOpFilterLogEvents) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpGetDataProtectionPolicy struct { +type awsAwsjson11_serializeOpDescribeMetricFilters struct { } -func (*awsAwsjson11_serializeOpGetDataProtectionPolicy) ID() string { +func (*awsAwsjson11_serializeOpDescribeMetricFilters) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpGetDataProtectionPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpDescribeMetricFilters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1516,7 +1571,7 @@ func (m *awsAwsjson11_serializeOpGetDataProtectionPolicy) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetDataProtectionPolicyInput) + input, ok := in.Parameters.(*DescribeMetricFiltersInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1537,10 +1592,615 @@ func (m *awsAwsjson11_serializeOpGetDataProtectionPolicy) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.GetDataProtectionPolicy") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeMetricFilters") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribeMetricFiltersInput(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_serializeOpDescribeQueries struct { +} + +func (*awsAwsjson11_serializeOpDescribeQueries) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDescribeQueries) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeQueriesInput) + _ = 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("Logs_20140328.DescribeQueries") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribeQueriesInput(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_serializeOpDescribeQueryDefinitions struct { +} + +func (*awsAwsjson11_serializeOpDescribeQueryDefinitions) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDescribeQueryDefinitions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeQueryDefinitionsInput) + _ = 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("Logs_20140328.DescribeQueryDefinitions") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribeQueryDefinitionsInput(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_serializeOpDescribeResourcePolicies struct { +} + +func (*awsAwsjson11_serializeOpDescribeResourcePolicies) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDescribeResourcePolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeResourcePoliciesInput) + _ = 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("Logs_20140328.DescribeResourcePolicies") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribeResourcePoliciesInput(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_serializeOpDescribeSubscriptionFilters struct { +} + +func (*awsAwsjson11_serializeOpDescribeSubscriptionFilters) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDescribeSubscriptionFilters) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeSubscriptionFiltersInput) + _ = 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("Logs_20140328.DescribeSubscriptionFilters") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribeSubscriptionFiltersInput(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_serializeOpDisassociateKmsKey struct { +} + +func (*awsAwsjson11_serializeOpDisassociateKmsKey) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDisassociateKmsKey) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DisassociateKmsKeyInput) + _ = 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("Logs_20140328.DisassociateKmsKey") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDisassociateKmsKeyInput(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_serializeOpFilterLogEvents struct { +} + +func (*awsAwsjson11_serializeOpFilterLogEvents) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpFilterLogEvents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*FilterLogEventsInput) + _ = 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("Logs_20140328.FilterLogEvents") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentFilterLogEventsInput(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_serializeOpGetDataProtectionPolicy struct { +} + +func (*awsAwsjson11_serializeOpGetDataProtectionPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetDataProtectionPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetDataProtectionPolicyInput) + _ = 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("Logs_20140328.GetDataProtectionPolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetDataProtectionPolicyInput(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_serializeOpGetDelivery struct { +} + +func (*awsAwsjson11_serializeOpGetDelivery) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetDelivery) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetDeliveryInput) + _ = 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("Logs_20140328.GetDelivery") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetDeliveryInput(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_serializeOpGetDeliveryDestination struct { +} + +func (*awsAwsjson11_serializeOpGetDeliveryDestination) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetDeliveryDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetDeliveryDestinationInput) + _ = 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("Logs_20140328.GetDeliveryDestination") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetDeliveryDestinationInput(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_serializeOpGetDeliveryDestinationPolicy struct { +} + +func (*awsAwsjson11_serializeOpGetDeliveryDestinationPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetDeliveryDestinationPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetDeliveryDestinationPolicyInput) + _ = 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("Logs_20140328.GetDeliveryDestinationPolicy") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetDataProtectionPolicyInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentGetDeliveryDestinationPolicyInput(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_serializeOpGetDeliverySource struct { +} + +func (*awsAwsjson11_serializeOpGetDeliverySource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetDeliverySource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetDeliverySourceInput) + _ = 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("Logs_20140328.GetDeliverySource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetDeliverySourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1681,7 +2341,172 @@ func (m *awsAwsjson11_serializeOpGetLogRecord) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetLogRecordInput) + input, ok := in.Parameters.(*GetLogRecordInput) + _ = 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("Logs_20140328.GetLogRecord") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetLogRecordInput(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_serializeOpGetQueryResults struct { +} + +func (*awsAwsjson11_serializeOpGetQueryResults) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetQueryResults) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetQueryResultsInput) + _ = 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("Logs_20140328.GetQueryResults") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetQueryResultsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListTagsForResource struct { +} + +func (*awsAwsjson11_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.ListTagsForResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListTagsLogGroup struct { +} + +func (*awsAwsjson11_serializeOpListTagsLogGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListTagsLogGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsLogGroupInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1702,10 +2527,10 @@ func (m *awsAwsjson11_serializeOpGetLogRecord) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.GetLogRecord") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.ListTagsLogGroup") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetLogRecordInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentListTagsLogGroupInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1721,14 +2546,14 @@ func (m *awsAwsjson11_serializeOpGetLogRecord) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpGetQueryResults struct { +type awsAwsjson11_serializeOpPutAccountPolicy struct { } -func (*awsAwsjson11_serializeOpGetQueryResults) ID() string { +func (*awsAwsjson11_serializeOpPutAccountPolicy) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpGetQueryResults) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpPutAccountPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1736,7 +2561,7 @@ func (m *awsAwsjson11_serializeOpGetQueryResults) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetQueryResultsInput) + input, ok := in.Parameters.(*PutAccountPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1757,10 +2582,10 @@ func (m *awsAwsjson11_serializeOpGetQueryResults) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.GetQueryResults") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.PutAccountPolicy") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentGetQueryResultsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentPutAccountPolicyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1776,14 +2601,14 @@ func (m *awsAwsjson11_serializeOpGetQueryResults) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListTagsForResource struct { +type awsAwsjson11_serializeOpPutDataProtectionPolicy struct { } -func (*awsAwsjson11_serializeOpListTagsForResource) ID() string { +func (*awsAwsjson11_serializeOpPutDataProtectionPolicy) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpPutDataProtectionPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1791,7 +2616,7 @@ func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListTagsForResourceInput) + input, ok := in.Parameters.(*PutDataProtectionPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1812,10 +2637,10 @@ func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.ListTagsForResource") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.PutDataProtectionPolicy") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentPutDataProtectionPolicyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1831,14 +2656,14 @@ func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListTagsLogGroup struct { +type awsAwsjson11_serializeOpPutDeliveryDestination struct { } -func (*awsAwsjson11_serializeOpListTagsLogGroup) ID() string { +func (*awsAwsjson11_serializeOpPutDeliveryDestination) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListTagsLogGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpPutDeliveryDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1846,7 +2671,7 @@ func (m *awsAwsjson11_serializeOpListTagsLogGroup) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListTagsLogGroupInput) + input, ok := in.Parameters.(*PutDeliveryDestinationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1867,10 +2692,10 @@ func (m *awsAwsjson11_serializeOpListTagsLogGroup) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.ListTagsLogGroup") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.PutDeliveryDestination") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListTagsLogGroupInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentPutDeliveryDestinationInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1886,14 +2711,14 @@ func (m *awsAwsjson11_serializeOpListTagsLogGroup) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpPutAccountPolicy struct { +type awsAwsjson11_serializeOpPutDeliveryDestinationPolicy struct { } -func (*awsAwsjson11_serializeOpPutAccountPolicy) ID() string { +func (*awsAwsjson11_serializeOpPutDeliveryDestinationPolicy) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpPutAccountPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpPutDeliveryDestinationPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1901,7 +2726,7 @@ func (m *awsAwsjson11_serializeOpPutAccountPolicy) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*PutAccountPolicyInput) + input, ok := in.Parameters.(*PutDeliveryDestinationPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1922,10 +2747,10 @@ func (m *awsAwsjson11_serializeOpPutAccountPolicy) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.PutAccountPolicy") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.PutDeliveryDestinationPolicy") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentPutAccountPolicyInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentPutDeliveryDestinationPolicyInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -1941,14 +2766,14 @@ func (m *awsAwsjson11_serializeOpPutAccountPolicy) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpPutDataProtectionPolicy struct { +type awsAwsjson11_serializeOpPutDeliverySource struct { } -func (*awsAwsjson11_serializeOpPutDataProtectionPolicy) ID() string { +func (*awsAwsjson11_serializeOpPutDeliverySource) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpPutDataProtectionPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpPutDeliverySource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -1956,7 +2781,7 @@ func (m *awsAwsjson11_serializeOpPutDataProtectionPolicy) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*PutDataProtectionPolicyInput) + input, ok := in.Parameters.(*PutDeliverySourceInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -1977,10 +2802,10 @@ func (m *awsAwsjson11_serializeOpPutDataProtectionPolicy) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.PutDataProtectionPolicy") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.PutDeliverySource") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentPutDataProtectionPolicyInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentPutDeliverySourceInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2831,6 +3656,18 @@ func awsAwsjson11_serializeDocumentAccountIds(v []string, value smithyjson.Value return nil } +func awsAwsjson11_serializeDocumentDeliveryDestinationConfiguration(v *types.DeliveryDestinationConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DestinationResourceArn != nil { + ok := object.Key("destinationResourceArn") + ok.String(*v.DestinationResourceArn) + } + + return nil +} + func awsAwsjson11_serializeDocumentDimensions(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3048,6 +3885,30 @@ func awsAwsjson11_serializeOpDocumentCancelExportTaskInput(v *CancelExportTaskIn return nil } +func awsAwsjson11_serializeOpDocumentCreateDeliveryInput(v *CreateDeliveryInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DeliveryDestinationArn != nil { + ok := object.Key("deliveryDestinationArn") + ok.String(*v.DeliveryDestinationArn) + } + + if v.DeliverySourceName != nil { + ok := object.Key("deliverySourceName") + ok.String(*v.DeliverySourceName) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentCreateExportTaskInput(v *CreateExportTaskInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3160,6 +4021,54 @@ func awsAwsjson11_serializeOpDocumentDeleteDataProtectionPolicyInput(v *DeleteDa return nil } +func awsAwsjson11_serializeOpDocumentDeleteDeliveryDestinationInput(v *DeleteDeliveryDestinationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentDeleteDeliveryDestinationPolicyInput(v *DeleteDeliveryDestinationPolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DeliveryDestinationName != nil { + ok := object.Key("deliveryDestinationName") + ok.String(*v.DeliveryDestinationName) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentDeleteDeliveryInput(v *DeleteDeliveryInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentDeleteDeliverySourceInput(v *DeleteDeliverySourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteDestinationInput(v *DeleteDestinationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3295,6 +4204,57 @@ func awsAwsjson11_serializeOpDocumentDescribeAccountPoliciesInput(v *DescribeAcc return nil } +func awsAwsjson11_serializeOpDocumentDescribeDeliveriesInput(v *DescribeDeliveriesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Limit != nil { + ok := object.Key("limit") + ok.Integer(*v.Limit) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentDescribeDeliveryDestinationsInput(v *DescribeDeliveryDestinationsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Limit != nil { + ok := object.Key("limit") + ok.Integer(*v.Limit) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentDescribeDeliverySourcesInput(v *DescribeDeliverySourcesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Limit != nil { + ok := object.Key("limit") + ok.Integer(*v.Limit) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDescribeDestinationsInput(v *DescribeDestinationsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3648,6 +4608,54 @@ func awsAwsjson11_serializeOpDocumentGetDataProtectionPolicyInput(v *GetDataProt return nil } +func awsAwsjson11_serializeOpDocumentGetDeliveryDestinationInput(v *GetDeliveryDestinationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetDeliveryDestinationPolicyInput(v *GetDeliveryDestinationPolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DeliveryDestinationName != nil { + ok := object.Key("deliveryDestinationName") + ok.String(*v.DeliveryDestinationName) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetDeliveryInput(v *GetDeliveryInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentGetDeliverySourceInput(v *GetDeliverySourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentGetLogEventsInput(v *GetLogEventsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3819,6 +4827,83 @@ func awsAwsjson11_serializeOpDocumentPutDataProtectionPolicyInput(v *PutDataProt return nil } +func awsAwsjson11_serializeOpDocumentPutDeliveryDestinationInput(v *PutDeliveryDestinationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DeliveryDestinationConfiguration != nil { + ok := object.Key("deliveryDestinationConfiguration") + if err := awsAwsjson11_serializeDocumentDeliveryDestinationConfiguration(v.DeliveryDestinationConfiguration, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if len(v.OutputFormat) > 0 { + ok := object.Key("outputFormat") + ok.String(string(v.OutputFormat)) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentPutDeliveryDestinationPolicyInput(v *PutDeliveryDestinationPolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DeliveryDestinationName != nil { + ok := object.Key("deliveryDestinationName") + ok.String(*v.DeliveryDestinationName) + } + + if v.DeliveryDestinationPolicy != nil { + ok := object.Key("deliveryDestinationPolicy") + ok.String(*v.DeliveryDestinationPolicy) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentPutDeliverySourceInput(v *PutDeliverySourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LogType != nil { + ok := object.Key("logType") + ok.String(*v.LogType) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.ResourceArn != nil { + ok := object.Key("resourceArn") + ok.String(*v.ResourceArn) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsAwsjson11_serializeDocumentTags(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentPutDestinationInput(v *PutDestinationInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/cloudwatchlogs/types/enums.go b/service/cloudwatchlogs/types/enums.go index a2168f23d3d..30119a2152d 100644 --- a/service/cloudwatchlogs/types/enums.go +++ b/service/cloudwatchlogs/types/enums.go @@ -24,6 +24,26 @@ func (DataProtectionStatus) Values() []DataProtectionStatus { } } +type DeliveryDestinationType string + +// Enum values for DeliveryDestinationType +const ( + DeliveryDestinationTypeS3 DeliveryDestinationType = "S3" + DeliveryDestinationTypeCwl DeliveryDestinationType = "CWL" + DeliveryDestinationTypeFh DeliveryDestinationType = "FH" +) + +// Values returns all known values for DeliveryDestinationType. Note that this can +// be expanded in the future, and 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 (DeliveryDestinationType) Values() []DeliveryDestinationType { + return []DeliveryDestinationType{ + "S3", + "CWL", + "FH", + } +} + type Distribution string // Enum values for Distribution @@ -102,6 +122,30 @@ func (OrderBy) Values() []OrderBy { } } +type OutputFormat string + +// Enum values for OutputFormat +const ( + OutputFormatJson OutputFormat = "json" + OutputFormatPlain OutputFormat = "plain" + OutputFormatW3c OutputFormat = "w3c" + OutputFormatRaw OutputFormat = "raw" + OutputFormatParquet OutputFormat = "parquet" +) + +// Values returns all known values for OutputFormat. Note that this can be +// expanded in the future, and 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 (OutputFormat) Values() []OutputFormat { + return []OutputFormat{ + "json", + "plain", + "w3c", + "raw", + "parquet", + } +} + type PolicyType string // Enum values for PolicyType diff --git a/service/cloudwatchlogs/types/errors.go b/service/cloudwatchlogs/types/errors.go index e2a02af3673..eb000d5d93e 100644 --- a/service/cloudwatchlogs/types/errors.go +++ b/service/cloudwatchlogs/types/errors.go @@ -7,6 +7,58 @@ import ( smithy "github.com/aws/smithy-go" ) +// You don't have sufficient permissions to perform this action. +type AccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// This operation attempted to create a resource that already exists. +type ConflictException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ConflictException" + } + return *e.ErrorCodeOverride +} +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The event was already logged. PutLogEvents actions are now always accepted and // never return DataAlreadyAcceptedException regardless of whether a given batch // of log events has already been accepted. @@ -256,6 +308,32 @@ func (e *ResourceNotFoundException) ErrorCode() string { } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// This request exceeds a service quota. +type ServiceQuotaExceededException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ServiceQuotaExceededException" + } + return *e.ErrorCodeOverride +} +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The service cannot complete the request. type ServiceUnavailableException struct { Message *string @@ -282,6 +360,32 @@ func (e *ServiceUnavailableException) ErrorCode() string { } func (e *ServiceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } +// The request was throttled because of quota limits. +type ThrottlingException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ThrottlingException" + } + return *e.ErrorCodeOverride +} +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // A resource can have no more than 50 tags. type TooManyTagsException struct { Message *string @@ -336,3 +440,29 @@ func (e *UnrecognizedClientException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *UnrecognizedClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// One of the parameters for the request is not valid. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ValidationException" + } + return *e.ErrorCodeOverride +} +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/cloudwatchlogs/types/types.go b/service/cloudwatchlogs/types/types.go index 93015cd7c11..bf8bc9a0441 100644 --- a/service/cloudwatchlogs/types/types.go +++ b/service/cloudwatchlogs/types/types.go @@ -31,6 +31,154 @@ type AccountPolicy struct { noSmithyDocumentSerde } +// This structure contains information about one delivery in your account. A +// delivery is a connection between a logical delivery source and a logical +// delivery destination. For more information, see CreateDelivery (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateDelivery.html) +// . You can't update an existing delivery. You can only create and delete +// deliveries. +type Delivery struct { + + // The Amazon Resource Name (ARN) that uniquely identifies this delivery. + Arn *string + + // The ARN of the delivery destination that is associated with this delivery. + DeliveryDestinationArn *string + + // Displays whether the delivery destination associated with this delivery is + // CloudWatch Logs, Amazon S3, or Kinesis Data Firehose. + DeliveryDestinationType DeliveryDestinationType + + // The name of the delivery source that is associated with this delivery. + DeliverySourceName *string + + // The unique ID that identifies this delivery in your account. + Id *string + + // The tags that have been assigned to this delivery. + Tags map[string]string + + noSmithyDocumentSerde +} + +// This structure contains information about one delivery destination in your +// account. A delivery destination is an Amazon Web Services resource that +// represents an shared id="AWS"/> service that logs can be sent to. CloudWatch +// Logs, Amazon S3, are supported as Kinesis Data Firehose delivery destinations. +// To configure logs delivery between a supported Amazon Web Services service and a +// destination, you must do the following: +// - Create a delivery source, which is a logical object that represents the +// resource that is actually sending the logs. For more information, see +// PutDeliverySource (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliverySource.html) +// . +// - Create a delivery destination, which is a logical object that represents +// the actual delivery destination. +// - If you are delivering logs cross-account, you must use +// PutDeliveryDestinationPolicy (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestinationolicy.html) +// in the destination account to assign an IAM policy to the destination. This +// policy allows delivery to that destination. +// - Create a delivery by pairing exactly one delivery source and one delivery +// destination. For more information, see CreateDelivery (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateDelivery.html) +// . +// +// You can configure a single delivery source to send logs to multiple +// destinations by creating multiple deliveries. You can also create multiple +// deliveries to configure multiple delivery sources to send logs to the same +// delivery destination. +type DeliveryDestination struct { + + // The Amazon Resource Name (ARN) that uniquely identifies this delivery + // destination. + Arn *string + + // A structure that contains the ARN of the Amazon Web Services resource that will + // receive the logs. + DeliveryDestinationConfiguration *DeliveryDestinationConfiguration + + // Displays whether this delivery destination is CloudWatch Logs, Amazon S3, or + // Kinesis Data Firehose. + DeliveryDestinationType DeliveryDestinationType + + // The name of this delivery destination. + Name *string + + // The format of the logs that are sent to this delivery destination. + OutputFormat OutputFormat + + // The tags that have been assigned to this delivery destination. + Tags map[string]string + + noSmithyDocumentSerde +} + +// A structure that contains information about one logs delivery destination. +type DeliveryDestinationConfiguration struct { + + // The ARN of the Amazon Web Services destination that this delivery destination + // represents. That Amazon Web Services destination can be a log group in + // CloudWatch Logs, an Amazon S3 bucket, or a delivery stream in Kinesis Data + // Firehose. + // + // This member is required. + DestinationResourceArn *string + + noSmithyDocumentSerde +} + +// This structure contains information about one delivery source in your account. +// A delivery source is an Amazon Web Services resource that sends logs to an +// Amazon Web Services destination. The destination can be CloudWatch Logs, Amazon +// S3, or Kinesis Data Firehose. Only some Amazon Web Services services support +// being configured as a delivery source. These services are listed as Supported +// [V2 Permissions] in the table at Enabling logging from Amazon Web Services +// services. (https://docs.aws.amazon.com/ AmazonCloudWatch/latest/logs/AWS-logs-and-resource-policy.html#AWS-vended-logs-permissions) +// To configure logs delivery between a supported Amazon Web Services service and a +// destination, you must do the following: +// - Create a delivery source, which is a logical object that represents the +// resource that is actually sending the logs. For more information, see +// PutDeliverySource (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliverySource.html) +// . +// - Create a delivery destination, which is a logical object that represents +// the actual delivery destination. For more information, see +// PutDeliveryDestination (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestination.html) +// . +// - If you are delivering logs cross-account, you must use +// PutDeliveryDestinationPolicy (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDeliveryDestinationolicy.html) +// in the destination account to assign an IAM policy to the destination. This +// policy allows delivery to that destination. +// - Create a delivery by pairing exactly one delivery source and one delivery +// destination. For more information, see CreateDelivery (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_CreateDelivery.html) +// . +// +// You can configure a single delivery source to send logs to multiple +// destinations by creating multiple deliveries. You can also create multiple +// deliveries to configure multiple delivery sources to send logs to the same +// delivery destination. +type DeliverySource struct { + + // The Amazon Resource Name (ARN) that uniquely identifies this delivery source. + Arn *string + + // The type of log that the source is sending. For valid values for this + // parameter, see the documentation for the source service. + LogType *string + + // The unique name of the delivery source. + Name *string + + // This array contains the ARN of the Amazon Web Services resource that sends logs + // and is represented by this delivery source. Currently, only one ARN can be in + // the array. + ResourceArns []string + + // The Amazon Web Services service that is sending logs. + Service *string + + // The tags that have been assigned to this delivery source. + Tags map[string]string + + noSmithyDocumentSerde +} + // Represents a cross-account destination that receives subscription log events. type Destination struct { @@ -370,6 +518,15 @@ type OutputLogEvent struct { noSmithyDocumentSerde } +// A structure that contains information about one delivery destination policy. +type Policy struct { + + // The contents of the delivery destination policy. + DeliveryDestinationPolicy *string + + noSmithyDocumentSerde +} + // Reserved. type QueryCompileError struct { diff --git a/service/cloudwatchlogs/validators.go b/service/cloudwatchlogs/validators.go index 75c285825e5..287a39c3199 100644 --- a/service/cloudwatchlogs/validators.go +++ b/service/cloudwatchlogs/validators.go @@ -50,6 +50,26 @@ func (m *validateOpCancelExportTask) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpCreateDelivery struct { +} + +func (*validateOpCreateDelivery) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDelivery) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDeliveryInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDeliveryInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateExportTask struct { } @@ -150,6 +170,86 @@ func (m *validateOpDeleteDataProtectionPolicy) HandleInitialize(ctx context.Cont return next.HandleInitialize(ctx, in) } +type validateOpDeleteDeliveryDestination struct { +} + +func (*validateOpDeleteDeliveryDestination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDeliveryDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDeliveryDestinationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDeliveryDestinationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDeliveryDestinationPolicy struct { +} + +func (*validateOpDeleteDeliveryDestinationPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDeliveryDestinationPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDeliveryDestinationPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDeliveryDestinationPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDelivery struct { +} + +func (*validateOpDeleteDelivery) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDelivery) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDeliveryInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDeliveryInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDeliverySource struct { +} + +func (*validateOpDeleteDeliverySource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDeliverySource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDeliverySourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDeliverySourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteDestination struct { } @@ -350,6 +450,86 @@ func (m *validateOpGetDataProtectionPolicy) HandleInitialize(ctx context.Context return next.HandleInitialize(ctx, in) } +type validateOpGetDeliveryDestination struct { +} + +func (*validateOpGetDeliveryDestination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetDeliveryDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetDeliveryDestinationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetDeliveryDestinationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetDeliveryDestinationPolicy struct { +} + +func (*validateOpGetDeliveryDestinationPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetDeliveryDestinationPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetDeliveryDestinationPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetDeliveryDestinationPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetDelivery struct { +} + +func (*validateOpGetDelivery) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetDelivery) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetDeliveryInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetDeliveryInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetDeliverySource struct { +} + +func (*validateOpGetDeliverySource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetDeliverySource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetDeliverySourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetDeliverySourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetLogEvents struct { } @@ -490,6 +670,66 @@ func (m *validateOpPutDataProtectionPolicy) HandleInitialize(ctx context.Context return next.HandleInitialize(ctx, in) } +type validateOpPutDeliveryDestination struct { +} + +func (*validateOpPutDeliveryDestination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutDeliveryDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutDeliveryDestinationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutDeliveryDestinationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutDeliveryDestinationPolicy struct { +} + +func (*validateOpPutDeliveryDestinationPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutDeliveryDestinationPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutDeliveryDestinationPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutDeliveryDestinationPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutDeliverySource struct { +} + +func (*validateOpPutDeliverySource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutDeliverySource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutDeliverySourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutDeliverySourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpPutDestination struct { } @@ -778,6 +1018,10 @@ func addOpCancelExportTaskValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCancelExportTask{}, middleware.After) } +func addOpCreateDeliveryValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDelivery{}, middleware.After) +} + func addOpCreateExportTaskValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateExportTask{}, middleware.After) } @@ -798,6 +1042,22 @@ func addOpDeleteDataProtectionPolicyValidationMiddleware(stack *middleware.Stack return stack.Initialize.Add(&validateOpDeleteDataProtectionPolicy{}, middleware.After) } +func addOpDeleteDeliveryDestinationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDeliveryDestination{}, middleware.After) +} + +func addOpDeleteDeliveryDestinationPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDeliveryDestinationPolicy{}, middleware.After) +} + +func addOpDeleteDeliveryValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDelivery{}, middleware.After) +} + +func addOpDeleteDeliverySourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDeliverySource{}, middleware.After) +} + func addOpDeleteDestinationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteDestination{}, middleware.After) } @@ -838,6 +1098,22 @@ func addOpGetDataProtectionPolicyValidationMiddleware(stack *middleware.Stack) e return stack.Initialize.Add(&validateOpGetDataProtectionPolicy{}, middleware.After) } +func addOpGetDeliveryDestinationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetDeliveryDestination{}, middleware.After) +} + +func addOpGetDeliveryDestinationPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetDeliveryDestinationPolicy{}, middleware.After) +} + +func addOpGetDeliveryValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetDelivery{}, middleware.After) +} + +func addOpGetDeliverySourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetDeliverySource{}, middleware.After) +} + func addOpGetLogEventsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetLogEvents{}, middleware.After) } @@ -866,6 +1142,18 @@ func addOpPutDataProtectionPolicyValidationMiddleware(stack *middleware.Stack) e return stack.Initialize.Add(&validateOpPutDataProtectionPolicy{}, middleware.After) } +func addOpPutDeliveryDestinationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutDeliveryDestination{}, middleware.After) +} + +func addOpPutDeliveryDestinationPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutDeliveryDestinationPolicy{}, middleware.After) +} + +func addOpPutDeliverySourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutDeliverySource{}, middleware.After) +} + func addOpPutDestinationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutDestination{}, middleware.After) } @@ -922,6 +1210,21 @@ func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } +func validateDeliveryDestinationConfiguration(v *types.DeliveryDestinationConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeliveryDestinationConfiguration"} + if v.DestinationResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DestinationResourceArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateInputLogEvent(v *types.InputLogEvent) error { if v == nil { return nil @@ -1025,6 +1328,24 @@ func validateOpCancelExportTaskInput(v *CancelExportTaskInput) error { } } +func validateOpCreateDeliveryInput(v *CreateDeliveryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDeliveryInput"} + if v.DeliverySourceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DeliverySourceName")) + } + if v.DeliveryDestinationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DeliveryDestinationArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateExportTaskInput(v *CreateExportTaskInput) error { if v == nil { return nil @@ -1115,6 +1436,66 @@ func validateOpDeleteDataProtectionPolicyInput(v *DeleteDataProtectionPolicyInpu } } +func validateOpDeleteDeliveryDestinationInput(v *DeleteDeliveryDestinationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDeliveryDestinationInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDeliveryDestinationPolicyInput(v *DeleteDeliveryDestinationPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDeliveryDestinationPolicyInput"} + if v.DeliveryDestinationName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DeliveryDestinationName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDeliveryInput(v *DeleteDeliveryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDeliveryInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDeliverySourceInput(v *DeleteDeliverySourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDeliverySourceInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteDestinationInput(v *DeleteDestinationInput) error { if v == nil { return nil @@ -1274,6 +1655,66 @@ func validateOpGetDataProtectionPolicyInput(v *GetDataProtectionPolicyInput) err } } +func validateOpGetDeliveryDestinationInput(v *GetDeliveryDestinationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetDeliveryDestinationInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetDeliveryDestinationPolicyInput(v *GetDeliveryDestinationPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetDeliveryDestinationPolicyInput"} + if v.DeliveryDestinationName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DeliveryDestinationName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetDeliveryInput(v *GetDeliveryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetDeliveryInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetDeliverySourceInput(v *GetDeliverySourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetDeliverySourceInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetLogEventsInput(v *GetLogEventsInput) error { if v == nil { return nil @@ -1388,6 +1829,67 @@ func validateOpPutDataProtectionPolicyInput(v *PutDataProtectionPolicyInput) err } } +func validateOpPutDeliveryDestinationInput(v *PutDeliveryDestinationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutDeliveryDestinationInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.DeliveryDestinationConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("DeliveryDestinationConfiguration")) + } else if v.DeliveryDestinationConfiguration != nil { + if err := validateDeliveryDestinationConfiguration(v.DeliveryDestinationConfiguration); err != nil { + invalidParams.AddNested("DeliveryDestinationConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutDeliveryDestinationPolicyInput(v *PutDeliveryDestinationPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutDeliveryDestinationPolicyInput"} + if v.DeliveryDestinationName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DeliveryDestinationName")) + } + if v.DeliveryDestinationPolicy == nil { + invalidParams.Add(smithy.NewErrParamRequired("DeliveryDestinationPolicy")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutDeliverySourceInput(v *PutDeliverySourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutDeliverySourceInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.ResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceArn")) + } + if v.LogType == nil { + invalidParams.Add(smithy.NewErrParamRequired("LogType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpPutDestinationInput(v *PutDestinationInput) error { if v == nil { return nil diff --git a/service/comprehend/api_op_BatchDetectTargetedSentiment.go b/service/comprehend/api_op_BatchDetectTargetedSentiment.go index b12d11229d0..b4b04f49fcd 100644 --- a/service/comprehend/api_op_BatchDetectTargetedSentiment.go +++ b/service/comprehend/api_op_BatchDetectTargetedSentiment.go @@ -19,7 +19,7 @@ import ( // Inspects a batch of documents and returns a sentiment analysis for each entity // identified in the documents. For more information about targeted sentiment, see // Targeted sentiment (https://docs.aws.amazon.com/comprehend/latest/dg/how-targeted-sentiment.html) -// . +// in the Amazon Comprehend Developer Guide. func (c *Client) BatchDetectTargetedSentiment(ctx context.Context, params *BatchDetectTargetedSentimentInput, optFns ...func(*Options)) (*BatchDetectTargetedSentimentOutput, error) { if params == nil { params = &BatchDetectTargetedSentimentInput{} diff --git a/service/comprehend/api_op_ClassifyDocument.go b/service/comprehend/api_op_ClassifyDocument.go index ce7a013e2c1..4e1ef43a496 100644 --- a/service/comprehend/api_op_ClassifyDocument.go +++ b/service/comprehend/api_op_ClassifyDocument.go @@ -16,14 +16,23 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a new document classification request to analyze a single document in -// real-time, using a previously created and trained custom model and an endpoint. -// You can input plain text or you can upload a single-page input document (text, -// PDF, Word, or image). If the system detects errors while processing a page in -// the input document, the API response includes an entry in Errors that describes -// the errors. If the system detects a document-level error in your input document, -// the API returns an InvalidRequestException error response. For details about -// this exception, see Errors in semi-structured documents (https://docs.aws.amazon.com/comprehend/latest/dg/idp-inputs-sync-err.html) +// Creates a classification request to analyze a single document in real-time. +// ClassifyDocument supports the following model types: +// - Custom classifier - a custom model that you have created and trained. For +// input, you can provide plain text, a single-page document (PDF, Word, or image), +// or Textract API output. For more information, see Custom classification (https://docs.aws.amazon.com/comprehend/latest/dg/how-document-classification.html) +// in the Amazon Comprehend Developer Guide. +// - Prompt classifier - Amazon Comprehend provides a model for classifying +// prompts. For input, you provide English plain text input. For prompt +// classification, the response includes only the Classes field. For more +// information about prompt classifiers, see Prompt classifiers (https://docs.aws.amazon.com/comprehend/latest/dg/prompt-classification.html) +// in the Amazon Comprehend Developer Guide. +// +// If the system detects errors while processing a page in the input document, the +// API response includes an entry in Errors that describes the errors. If the +// system detects a document-level error in your input document, the API returns an +// InvalidRequestException error response. For details about this exception, see +// Errors in semi-structured documents (https://docs.aws.amazon.com/comprehend/latest/dg/idp-inputs-sync-err.html) // in the Comprehend Developer Guide. func (c *Client) ClassifyDocument(ctx context.Context, params *ClassifyDocumentInput, optFns ...func(*Options)) (*ClassifyDocumentOutput, error) { if params == nil { @@ -42,20 +51,23 @@ func (c *Client) ClassifyDocument(ctx context.Context, params *ClassifyDocumentI type ClassifyDocumentInput struct { - // The Amazon Resource Number (ARN) of the endpoint. For information about - // endpoints, see Managing endpoints (https://docs.aws.amazon.com/comprehend/latest/dg/manage-endpoints.html) + // The Amazon Resource Number (ARN) of the endpoint. For prompt classification, + // Amazon Comprehend provides the endpoint ARN: zzz . For custom classification, + // you create an endpoint for your custom model. For more information, see Using + // Amazon Comprehend endpoints (https://docs.aws.amazon.com/comprehend/latest/dg/using-endpoints.html) // . // // This member is required. EndpointArn *string - // Use the Bytes parameter to input a text, PDF, Word or image file. You can also - // use the Bytes parameter to input an Amazon Textract DetectDocumentText or - // AnalyzeDocument output file. Provide the input document as a sequence of - // base64-encoded bytes. If your code uses an Amazon Web Services SDK to classify - // documents, the SDK may encode the document file bytes for you. The maximum - // length of this field depends on the input document type. For details, see - // Inputs for real-time custom analysis (https://docs.aws.amazon.com/comprehend/latest/dg/idp-inputs-sync.html) + // Use the Bytes parameter to input a text, PDF, Word or image file. When you + // classify a document using a custom model, you can also use the Bytes parameter + // to input an Amazon Textract DetectDocumentText or AnalyzeDocument output file. + // To classify a document using the prompt classifier, use the Text parameter for + // input. Provide the input document as a sequence of base64-encoded bytes. If your + // code uses an Amazon Web Services SDK to classify documents, the SDK may encode + // the document file bytes for you. The maximum length of this field depends on the + // input document type. For details, see Inputs for real-time custom analysis (https://docs.aws.amazon.com/comprehend/latest/dg/idp-inputs-sync.html) // in the Comprehend Developer Guide. If you use the Bytes parameter, do not use // the Text parameter. Bytes []byte @@ -76,7 +88,10 @@ type ClassifyDocumentOutput struct { // The classes used by the document being analyzed. These are used for multi-class // trained models. Individual classes are mutually exclusive and each document is // expected to have only a single class assigned to it. For example, an animal can - // be a dog or a cat, but not both at the same time. + // be a dog or a cat, but not both at the same time. For prompt classification, the + // response includes a single class ( UNDESIRED_PROMPT ), along with a confidence + // score. A higher confidence score indicates that the input prompt is undesired in + // nature. Classes []types.DocumentClass // Extraction information about the document. This field is present in the diff --git a/service/comprehend/api_op_CreateDocumentClassifier.go b/service/comprehend/api_op_CreateDocumentClassifier.go index fe7ae3c08be..ba47dfa61db 100644 --- a/service/comprehend/api_op_CreateDocumentClassifier.go +++ b/service/comprehend/api_op_CreateDocumentClassifier.go @@ -91,7 +91,7 @@ type CreateDocumentClassifierInput struct { ModelPolicy *string // Specifies the location for the output files from a custom classifier job. This - // parameter is required for a request that creates a native classifier model. + // parameter is required for a request that creates a native document model. OutputDataConfig *types.DocumentClassifierOutputDataConfig // Tags to associate with the document classifier. A tag is a key-value pair that diff --git a/service/comprehend/api_op_CreateFlywheel.go b/service/comprehend/api_op_CreateFlywheel.go index 7bdd1850d09..cfadc6a0540 100644 --- a/service/comprehend/api_op_CreateFlywheel.go +++ b/service/comprehend/api_op_CreateFlywheel.go @@ -64,7 +64,8 @@ type CreateFlywheelInput struct { FlywheelName *string // To associate an existing model with the flywheel, specify the Amazon Resource - // Number (ARN) of the model version. + // Number (ARN) of the model version. Do not set TaskConfig or ModelType if you + // specify an ActiveModelArn . ActiveModelArn *string // A unique identifier for the request. If you don't set the client request token, @@ -74,13 +75,15 @@ type CreateFlywheelInput struct { // Data security configurations. DataSecurityConfig *types.DataSecurityConfig - // The model type. + // The model type. You need to set ModelType if you are creating a flywheel for a + // new model. ModelType types.ModelType // The tags to associate with this flywheel. Tags []types.Tag - // Configuration about the custom classifier associated with the flywheel. + // Configuration about the model associated with the flywheel. You need to set + // TaskConfig if you are creating a flywheel for a new model. TaskConfig *types.TaskConfig noSmithyDocumentSerde diff --git a/service/comprehend/api_op_DetectTargetedSentiment.go b/service/comprehend/api_op_DetectTargetedSentiment.go index d0e857e9581..ab379208f88 100644 --- a/service/comprehend/api_op_DetectTargetedSentiment.go +++ b/service/comprehend/api_op_DetectTargetedSentiment.go @@ -19,7 +19,7 @@ import ( // Inspects the input text and returns a sentiment analysis for each entity // identified in the text. For more information about targeted sentiment, see // Targeted sentiment (https://docs.aws.amazon.com/comprehend/latest/dg/how-targeted-sentiment.html) -// . +// in the Amazon Comprehend Developer Guide. func (c *Client) DetectTargetedSentiment(ctx context.Context, params *DetectTargetedSentimentInput, optFns ...func(*Options)) (*DetectTargetedSentimentOutput, error) { if params == nil { params = &DetectTargetedSentimentInput{} diff --git a/service/comprehend/api_op_DetectToxicContent.go b/service/comprehend/api_op_DetectToxicContent.go new file mode 100644 index 00000000000..4596f313ecd --- /dev/null +++ b/service/comprehend/api_op_DetectToxicContent.go @@ -0,0 +1,275 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package comprehend + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/comprehend/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Performs toxicity analysis on the list of text strings that you provide as +// input. The analysis uses the order of strings in the list to determine context +// when predicting toxicity. The API response contains a results list that matches +// the size of the input list. For more information about toxicity detection, see +// Toxicity detection (https://docs.aws.amazon.com/comprehend/latest/dg/toxicity-detection.html) +// in the Amazon Comprehend Developer Guide +func (c *Client) DetectToxicContent(ctx context.Context, params *DetectToxicContentInput, optFns ...func(*Options)) (*DetectToxicContentOutput, error) { + if params == nil { + params = &DetectToxicContentInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DetectToxicContent", params, optFns, c.addOperationDetectToxicContentMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DetectToxicContentOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DetectToxicContentInput struct { + + // The language of the input text. Currently, English is the only supported + // language. + // + // This member is required. + LanguageCode types.LanguageCode + + // A list of up to 10 text strings. The maximum size for the list is 10 KB. + // + // This member is required. + TextSegments []types.TextSegment + + noSmithyDocumentSerde +} + +type DetectToxicContentOutput struct { + + // Results of the content moderation analysis. Each entry in the results list + // contains a list of toxic content types identified in the text, along with a + // confidence score for each content type. The results list also includes a + // toxicity score for each entry in the results list. + ResultList []types.ToxicLabels + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDetectToxicContentMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDetectToxicContent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDetectToxicContent{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addDetectToxicContentResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDetectToxicContentValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDetectToxicContent(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDetectToxicContent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "comprehend", + OperationName: "DetectToxicContent", + } +} + +type opDetectToxicContentResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDetectToxicContentResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDetectToxicContentResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "comprehend" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "comprehend" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("comprehend") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDetectToxicContentResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDetectToxicContentResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/comprehend/api_op_StartTargetedSentimentDetectionJob.go b/service/comprehend/api_op_StartTargetedSentimentDetectionJob.go index bdfb99bdefd..630ead7c6b8 100644 --- a/service/comprehend/api_op_StartTargetedSentimentDetectionJob.go +++ b/service/comprehend/api_op_StartTargetedSentimentDetectionJob.go @@ -37,7 +37,7 @@ func (c *Client) StartTargetedSentimentDetectionJob(ctx context.Context, params type StartTargetedSentimentDetectionJobInput struct { // The Amazon Resource Name (ARN) of the IAM role that grants Amazon Comprehend - // read access to your input data. For more information, see Role-based permissions (https://docs.aws.amazon.com/comprehend/latest/dg/access-control-managing-permissions.html#auth-role-permissions) + // read access to your input data. For more information, see Role-based permissions (https://docs.aws.amazon.com/comprehend/latest/dg/security_iam_id-based-policy-examples.html#auth-role-permissions) // . // // This member is required. diff --git a/service/comprehend/deserializers.go b/service/comprehend/deserializers.go index 2d2fa52f536..393f6706245 100644 --- a/service/comprehend/deserializers.go +++ b/service/comprehend/deserializers.go @@ -5033,6 +5033,126 @@ func awsAwsjson11_deserializeOpErrorDetectTargetedSentiment(response *smithyhttp } } +type awsAwsjson11_deserializeOpDetectToxicContent struct { +} + +func (*awsAwsjson11_deserializeOpDetectToxicContent) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDetectToxicContent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDetectToxicContent(response, &metadata) + } + output := &DetectToxicContentOutput{} + 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_deserializeOpDocumentDetectToxicContentOutput(&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_deserializeOpErrorDetectToxicContent(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson11_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsAwsjson11_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("TextSizeLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorTextSizeLimitExceededException(response, errorBody) + + case strings.EqualFold("UnsupportedLanguageException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedLanguageException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpImportModel struct { } @@ -18103,6 +18223,74 @@ func awsAwsjson11_deserializeDocumentListOfTargetedSentimentEntities(v *[]types. return nil } +func awsAwsjson11_deserializeDocumentListOfToxicContent(v *[]types.ToxicContent, 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.ToxicContent + if *v == nil { + cv = []types.ToxicContent{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ToxicContent + destAddr := &col + if err := awsAwsjson11_deserializeDocumentToxicContent(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentListOfToxicLabels(v *[]types.ToxicLabels, 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.ToxicLabels + if *v == nil { + cv = []types.ToxicLabels{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ToxicLabels + destAddr := &col + if err := awsAwsjson11_deserializeDocumentToxicLabels(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentListOfWarnings(v *[]types.WarningsListItem, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -20463,6 +20651,150 @@ func awsAwsjson11_deserializeDocumentTopicsDetectionJobPropertiesList(v *[]types return nil } +func awsAwsjson11_deserializeDocumentToxicContent(v **types.ToxicContent, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ToxicContent + if *v == nil { + sv = &types.ToxicContent{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ToxicContentType to be of type string, got %T instead", value) + } + sv.Name = types.ToxicContentType(jtv) + } + + case "Score": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Score = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Score = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentToxicLabels(v **types.ToxicLabels, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ToxicLabels + if *v == nil { + sv = &types.ToxicLabels{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Labels": + if err := awsAwsjson11_deserializeDocumentListOfToxicContent(&sv.Labels, value); err != nil { + return err + } + + case "Toxicity": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Toxicity = ptr.Float32(float32(f64)) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Toxicity = ptr.Float32(float32(f64)) + + default: + return fmt.Errorf("expected Float to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentUnsupportedLanguageException(v **types.UnsupportedLanguageException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -22224,6 +22556,42 @@ func awsAwsjson11_deserializeOpDocumentDetectTargetedSentimentOutput(v **DetectT return nil } +func awsAwsjson11_deserializeOpDocumentDetectToxicContentOutput(v **DetectToxicContentOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DetectToxicContentOutput + if *v == nil { + sv = &DetectToxicContentOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ResultList": + if err := awsAwsjson11_deserializeDocumentListOfToxicLabels(&sv.ResultList, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentImportModelOutput(v **ImportModelOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/comprehend/endpoints.go b/service/comprehend/endpoints.go index 6d40450baac..bf3a353d8f3 100644 --- a/service/comprehend/endpoints.go +++ b/service/comprehend/endpoints.go @@ -430,7 +430,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://comprehend-fips.") diff --git a/service/comprehend/generated.json b/service/comprehend/generated.json index 3cc3ceb09b7..70825d151ae 100644 --- a/service/comprehend/generated.json +++ b/service/comprehend/generated.json @@ -50,6 +50,7 @@ "api_op_DetectSentiment.go", "api_op_DetectSyntax.go", "api_op_DetectTargetedSentiment.go", + "api_op_DetectToxicContent.go", "api_op_ImportModel.go", "api_op_ListDatasets.go", "api_op_ListDocumentClassificationJobs.go", diff --git a/service/comprehend/serializers.go b/service/comprehend/serializers.go index f15edf5227c..6053c157a45 100644 --- a/service/comprehend/serializers.go +++ b/service/comprehend/serializers.go @@ -2271,6 +2271,61 @@ func (m *awsAwsjson11_serializeOpDetectTargetedSentiment) HandleSerialize(ctx co return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDetectToxicContent struct { +} + +func (*awsAwsjson11_serializeOpDetectToxicContent) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDetectToxicContent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DetectToxicContentInput) + _ = 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("Comprehend_20171127.DetectToxicContent") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDetectToxicContentInput(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_serializeOpImportModel struct { } @@ -5528,6 +5583,19 @@ func awsAwsjson11_serializeDocumentListOfPiiEntityTypes(v []types.PiiEntityType, return nil } +func awsAwsjson11_serializeDocumentListOfTextSegments(v []types.TextSegment, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentTextSegment(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeDocumentOutputDataConfig(v *types.OutputDataConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5750,6 +5818,18 @@ func awsAwsjson11_serializeDocumentTaskConfig(v *types.TaskConfig, value smithyj return nil } +func awsAwsjson11_serializeDocumentTextSegment(v *types.TextSegment, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Text != nil { + ok := object.Key("Text") + ok.String(*v.Text) + } + + return nil +} + func awsAwsjson11_serializeDocumentTopicsDetectionJobFilter(v *types.TopicsDetectionJobFilter, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6666,6 +6746,25 @@ func awsAwsjson11_serializeOpDocumentDetectTargetedSentimentInput(v *DetectTarge return nil } +func awsAwsjson11_serializeOpDocumentDetectToxicContentInput(v *DetectToxicContentInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.LanguageCode) > 0 { + ok := object.Key("LanguageCode") + ok.String(string(v.LanguageCode)) + } + + if v.TextSegments != nil { + ok := object.Key("TextSegments") + if err := awsAwsjson11_serializeDocumentListOfTextSegments(v.TextSegments, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentImportModelInput(v *ImportModelInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/comprehend/types/enums.go b/service/comprehend/types/enums.go index 32ee483ef68..ef9b95a67f4 100644 --- a/service/comprehend/types/enums.go +++ b/service/comprehend/types/enums.go @@ -871,3 +871,31 @@ func (TargetedSentimentEntityType) Values() []TargetedSentimentEntityType { "OTHER", } } + +type ToxicContentType string + +// Enum values for ToxicContentType +const ( + ToxicContentTypeGraphic ToxicContentType = "GRAPHIC" + ToxicContentTypeHarassmentOrAbuse ToxicContentType = "HARASSMENT_OR_ABUSE" + ToxicContentTypeHateSpeech ToxicContentType = "HATE_SPEECH" + ToxicContentTypeInsult ToxicContentType = "INSULT" + ToxicContentTypeProfanity ToxicContentType = "PROFANITY" + ToxicContentTypeSexual ToxicContentType = "SEXUAL" + ToxicContentTypeViolenceOrThreat ToxicContentType = "VIOLENCE_OR_THREAT" +) + +// Values returns all known values for ToxicContentType. Note that this can be +// expanded in the future, and 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 (ToxicContentType) Values() []ToxicContentType { + return []ToxicContentType{ + "GRAPHIC", + "HARASSMENT_OR_ABUSE", + "HATE_SPEECH", + "INSULT", + "PROFANITY", + "SEXUAL", + "VIOLENCE_OR_THREAT", + } +} diff --git a/service/comprehend/types/types.go b/service/comprehend/types/types.go index cbfa02140bd..ac1089446eb 100644 --- a/service/comprehend/types/types.go +++ b/service/comprehend/types/types.go @@ -572,7 +572,7 @@ type DocumentClass struct { noSmithyDocumentSerde } -// Configuration required for a custom classification model. +// Configuration required for a document classification model. type DocumentClassificationConfig struct { // Classification mode indicates whether the documents are MULTI_CLASS or @@ -671,7 +671,7 @@ type DocumentClassificationJobProperties struct { // Configuration parameters for a private Virtual Private Cloud (VPC) containing // the resources you are using for your document classification job. For more - // information, see Amazon VPC (https://docs.aws.amazon.com/vppc/latest/userguide/what-is-amazon-vpc.html) + // information, see Amazon VPC (https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html) // . VpcConfig *VpcConfig @@ -679,7 +679,7 @@ type DocumentClassificationJobProperties struct { } // The location of the training documents. This parameter is required in a request -// to create a native classifier model. +// to create a semi-structured document classification model. type DocumentClassifierDocuments struct { // The S3 URI location of the training documents specified in the S3Uri CSV file. @@ -757,11 +757,11 @@ type DocumentClassifierInputDataConfig struct { // The type of input documents for training the model. Provide plain-text // documents to create a plain-text model, and provide semi-structured documents to - // create a native model. + // create a native document model. DocumentType DocumentClassifierDocumentTypeFormat // The S3 location of the training documents. This parameter is required in a - // request to create a native classifier model. + // request to create a native document model. Documents *DocumentClassifierDocuments // Indicates the delimiter used to separate each label for training a multi-label @@ -781,8 +781,8 @@ type DocumentClassifierInputDataConfig struct { // if you set DataFormat to COMPREHEND_CSV . S3Uri *string - // This specifies the Amazon S3 location where the test annotations for an entity - // recognizer are located. The URI must be in the same Amazon Web Services Region + // This specifies the Amazon S3 location that contains the test annotations for + // the document classifier. The URI must be in the same Amazon Web Services Region // as the API endpoint that you are calling. TestS3Uri *string @@ -790,7 +790,7 @@ type DocumentClassifierInputDataConfig struct { } // Provide the location for output data from a custom classifier job. This field -// is mandatory if you are training a native classifier model. +// is mandatory if you are training a native document model. type DocumentClassifierOutputDataConfig struct { // The Amazon S3 prefix for the data lake location of the flywheel statistics. @@ -908,7 +908,7 @@ type DocumentClassifierProperties struct { // Configuration parameters for a private Virtual Private Cloud (VPC) containing // the resources you are using for your custom classifier. For more information, - // see Amazon VPC (https://docs.aws.amazon.com/vppc/latest/userguide/what-is-amazon-vpc.html) + // see Amazon VPC (https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html) // . VpcConfig *VpcConfig @@ -1920,7 +1920,7 @@ type FlywheelProperties struct { // The status of the flywheel. Status FlywheelStatus - // Configuration about the custom classifier associated with the flywheel. + // Configuration about the model associated with a flywheel. TaskConfig *TaskConfig noSmithyDocumentSerde @@ -2130,7 +2130,7 @@ type KeyPhrasesDetectionJobProperties struct { // Contains the sentiment and sentiment score for one mention of an entity. For // more information about targeted sentiment, see Targeted sentiment (https://docs.aws.amazon.com/comprehend/latest/dg/how-targeted-sentiment.html) -// . +// in the Amazon Comprehend Developer Guide. type MentionSentiment struct { // The sentiment of the mention. @@ -2161,8 +2161,9 @@ type OutputDataConfig struct { S3Uri *string // ID for the Amazon Web Services Key Management Service (KMS) key that Amazon - // Comprehend uses to encrypt the output results from an analysis job. The KmsKeyId - // can be one of the following formats: + // Comprehend uses to encrypt the output results from an analysis job. Specify the + // Key Id of a symmetric key, because you cannot use an asymmetric key for + // uploading data to S3. The KmsKeyId can be one of the following formats: // - KMS Key ID: "1234abcd-12ab-34cd-56ef-1234567890ab" // - Amazon Resource Name (ARN) of a KMS Key: // "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab" @@ -2601,7 +2602,7 @@ type TargetedSentimentDetectionJobProperties struct { // Information about one of the entities found by targeted sentiment analysis. For // more information about targeted sentiment, see Targeted sentiment (https://docs.aws.amazon.com/comprehend/latest/dg/how-targeted-sentiment.html) -// . +// in the Amazon Comprehend Developer Guide. type TargetedSentimentEntity struct { // One or more index into the Mentions array that provides the best name for the @@ -2619,7 +2620,7 @@ type TargetedSentimentEntity struct { // Information about one mention of an entity. The mention information includes // the location of the mention in the text and the sentiment of the mention. For // more information about targeted sentiment, see Targeted sentiment (https://docs.aws.amazon.com/comprehend/latest/dg/how-targeted-sentiment.html) -// . +// in the Amazon Comprehend Developer Guide. type TargetedSentimentMention struct { // The offset into the document text where the mention begins. @@ -2649,7 +2650,7 @@ type TargetedSentimentMention struct { noSmithyDocumentSerde } -// Configuration about the custom classifier associated with the flywheel. +// Configuration about the model associated with a flywheel. type TaskConfig struct { // Language code for the language that the model supports. @@ -2657,7 +2658,7 @@ type TaskConfig struct { // This member is required. LanguageCode LanguageCode - // Configuration required for a classification model. + // Configuration required for a document classification model. DocumentClassificationConfig *DocumentClassificationConfig // Configuration required for an entity recognition model. @@ -2666,6 +2667,17 @@ type TaskConfig struct { noSmithyDocumentSerde } +// One of the of text strings. Each string has a size limit of 1KB. +type TextSegment struct { + + // The text content. + // + // This member is required. + Text *string + + noSmithyDocumentSerde +} + // Provides information for filtering topic detection jobs. For more information, // see . type TopicsDetectionJobFilter struct { @@ -2752,6 +2764,35 @@ type TopicsDetectionJobProperties struct { noSmithyDocumentSerde } +// Toxic content analysis result for one string. For more information about +// toxicity detection, see Toxicity detection (https://docs.aws.amazon.com/comprehend/latest/dg/toxicity-detection.html) +// in the Amazon Comprehend Developer Guide +type ToxicContent struct { + + // The name of the toxic content type. + Name ToxicContentType + + // Model confidence in the detected content type. Value range is zero to one, + // where one is highest confidence. + Score *float32 + + noSmithyDocumentSerde +} + +// Toxicity analysis result for one string. For more information about toxicity +// detection, see Toxicity detection (https://docs.aws.amazon.com/comprehend/latest/dg/toxicity-detection.html) +// in the Amazon Comprehend Developer Guide +type ToxicLabels struct { + + // Array of toxic content types identified in the string. + Labels []ToxicContent + + // Overall toxicity score for the string. + Toxicity *float32 + + noSmithyDocumentSerde +} + // Data security configuration. type UpdateDataSecurityConfig struct { @@ -2805,7 +2846,7 @@ type VpcConfig struct { // The system identified one of the following warnings while processing the input // document: // - The document to classify is plain text, but the classifier is a native -// model. +// document model. // - The document to classify is semi-structured, but the classifier is a // plain-text model. type WarningsListItem struct { diff --git a/service/comprehend/validators.go b/service/comprehend/validators.go index e919ab85ea6..88dc4886260 100644 --- a/service/comprehend/validators.go +++ b/service/comprehend/validators.go @@ -830,6 +830,26 @@ func (m *validateOpDetectTargetedSentiment) HandleInitialize(ctx context.Context return next.HandleInitialize(ctx, in) } +type validateOpDetectToxicContent struct { +} + +func (*validateOpDetectToxicContent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDetectToxicContent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DetectToxicContentInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDetectToxicContentInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpImportModel struct { } @@ -1534,6 +1554,10 @@ func addOpDetectTargetedSentimentValidationMiddleware(stack *middleware.Stack) e return stack.Initialize.Add(&validateOpDetectTargetedSentiment{}, middleware.After) } +func addOpDetectToxicContentValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDetectToxicContent{}, middleware.After) +} + func addOpImportModelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpImportModel{}, middleware.After) } @@ -2089,6 +2113,23 @@ func validateInputDataConfig(v *types.InputDataConfig) error { } } +func validateListOfTextSegments(v []types.TextSegment) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListOfTextSegments"} + for i := range v { + if err := validateTextSegment(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOutputDataConfig(v *types.OutputDataConfig) error { if v == nil { return nil @@ -2161,6 +2202,21 @@ func validateTaskConfig(v *types.TaskConfig) error { } } +func validateTextSegment(v *types.TextSegment) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TextSegment"} + if v.Text == nil { + invalidParams.Add(smithy.NewErrParamRequired("Text")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateUpdateDataSecurityConfig(v *types.UpdateDataSecurityConfig) error { if v == nil { return nil @@ -2944,6 +3000,28 @@ func validateOpDetectTargetedSentimentInput(v *DetectTargetedSentimentInput) err } } +func validateOpDetectToxicContentInput(v *DetectToxicContentInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DetectToxicContentInput"} + if v.TextSegments == nil { + invalidParams.Add(smithy.NewErrParamRequired("TextSegments")) + } else if v.TextSegments != nil { + if err := validateListOfTextSegments(v.TextSegments); err != nil { + invalidParams.AddNested("TextSegments", err.(smithy.InvalidParamsError)) + } + } + if len(v.LanguageCode) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("LanguageCode")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpImportModelInput(v *ImportModelInput) error { if v == nil { return nil diff --git a/service/connect/api_op_ListIntegrationAssociations.go b/service/connect/api_op_ListIntegrationAssociations.go index 042b214006d..56f2666e3d3 100644 --- a/service/connect/api_op_ListIntegrationAssociations.go +++ b/service/connect/api_op_ListIntegrationAssociations.go @@ -41,6 +41,9 @@ type ListIntegrationAssociationsInput struct { // This member is required. InstanceId *string + // The Amazon Resource Name (ARN) of the integration. + IntegrationArn *string + // The integration type. IntegrationType types.IntegrationType diff --git a/service/connect/serializers.go b/service/connect/serializers.go index edba3e71a80..e6c1546a9b3 100644 --- a/service/connect/serializers.go +++ b/service/connect/serializers.go @@ -10194,6 +10194,10 @@ func awsRestjson1_serializeOpHttpBindingsListIntegrationAssociationsInput(v *Lis } } + if v.IntegrationArn != nil { + encoder.SetQuery("integrationArn").String(*v.IntegrationArn) + } + if len(v.IntegrationType) > 0 { encoder.SetQuery("integrationType").String(string(v.IntegrationType)) } diff --git a/service/connect/types/enums.go b/service/connect/types/enums.go index e9c1b896334..d3dd95b30a1 100644 --- a/service/connect/types/enums.go +++ b/service/connect/types/enums.go @@ -784,6 +784,7 @@ const ( IntegrationTypeWisdomKnowledgeBase IntegrationType = "WISDOM_KNOWLEDGE_BASE" IntegrationTypeCasesDomain IntegrationType = "CASES_DOMAIN" IntegrationTypeApplication IntegrationType = "APPLICATION" + IntegrationTypeFileScanner IntegrationType = "FILE_SCANNER" ) // Values returns all known values for IntegrationType. Note that this can be @@ -798,6 +799,7 @@ func (IntegrationType) Values() []IntegrationType { "WISDOM_KNOWLEDGE_BASE", "CASES_DOMAIN", "APPLICATION", + "FILE_SCANNER", } } diff --git a/service/ec2/api_op_DisableSnapshotBlockPublicAccess.go b/service/ec2/api_op_DisableSnapshotBlockPublicAccess.go new file mode 100644 index 00000000000..82d529a3d40 --- /dev/null +++ b/service/ec2/api_op_DisableSnapshotBlockPublicAccess.go @@ -0,0 +1,266 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/ec2/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Disables the block public access for snapshots setting at the account level for +// the specified Amazon Web Services Region. After you disable block public access +// for snapshots in a Region, users can publicly share snapshots in that Region. If +// block public access is enabled in block-all-sharing mode, and you disable block +// public access, all snapshots that were previously publicly shared are no longer +// treated as private and they become publicly accessible again. For more +// information, see Block public access for snapshots (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-public-access-snapshots.html) +// in the Amazon Elastic Compute Cloud User Guide . +func (c *Client) DisableSnapshotBlockPublicAccess(ctx context.Context, params *DisableSnapshotBlockPublicAccessInput, optFns ...func(*Options)) (*DisableSnapshotBlockPublicAccessOutput, error) { + if params == nil { + params = &DisableSnapshotBlockPublicAccessInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisableSnapshotBlockPublicAccess", params, optFns, c.addOperationDisableSnapshotBlockPublicAccessMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisableSnapshotBlockPublicAccessOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DisableSnapshotBlockPublicAccessInput struct { + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have the + // required permissions, the error response is DryRunOperation . Otherwise, it is + // UnauthorizedOperation . + DryRun *bool + + noSmithyDocumentSerde +} + +type DisableSnapshotBlockPublicAccessOutput struct { + + // Returns unblocked if the request succeeds. + State types.SnapshotBlockPublicAccessState + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDisableSnapshotBlockPublicAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsEc2query_serializeOpDisableSnapshotBlockPublicAccess{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpDisableSnapshotBlockPublicAccess{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addDisableSnapshotBlockPublicAccessResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisableSnapshotBlockPublicAccess(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDisableSnapshotBlockPublicAccess(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "ec2", + OperationName: "DisableSnapshotBlockPublicAccess", + } +} + +type opDisableSnapshotBlockPublicAccessResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDisableSnapshotBlockPublicAccessResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDisableSnapshotBlockPublicAccessResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "ec2" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "ec2" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("ec2") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDisableSnapshotBlockPublicAccessResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDisableSnapshotBlockPublicAccessResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/ec2/api_op_EnableSnapshotBlockPublicAccess.go b/service/ec2/api_op_EnableSnapshotBlockPublicAccess.go new file mode 100644 index 00000000000..78d4ee164e9 --- /dev/null +++ b/service/ec2/api_op_EnableSnapshotBlockPublicAccess.go @@ -0,0 +1,292 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/ec2/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Enables or modifies the block public access for snapshots setting at the +// account level for the specified Amazon Web Services Region. After you enable +// block public access for snapshots in a Region, users can no longer request +// public sharing for snapshots in that Region. Snapshots that are already publicly +// shared are either treated as private or they remain publicly shared, depending +// on the State that you specify. If block public access is enabled in +// block-all-sharing mode, and you change the mode to block-new-sharing , all +// snapshots that were previously publicly shared are no longer treated as private +// and they become publicly accessible again. For more information, see Block +// public access for snapshots (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-public-access-snapshots.html) +// in the Amazon Elastic Compute Cloud User Guide. +func (c *Client) EnableSnapshotBlockPublicAccess(ctx context.Context, params *EnableSnapshotBlockPublicAccessInput, optFns ...func(*Options)) (*EnableSnapshotBlockPublicAccessOutput, error) { + if params == nil { + params = &EnableSnapshotBlockPublicAccessInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "EnableSnapshotBlockPublicAccess", params, optFns, c.addOperationEnableSnapshotBlockPublicAccessMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*EnableSnapshotBlockPublicAccessOutput) + out.ResultMetadata = metadata + return out, nil +} + +type EnableSnapshotBlockPublicAccessInput struct { + + // The mode in which to enable block public access for snapshots for the Region. + // Specify one of the following values: + // - block-all-sharing - Prevents all public sharing of snapshots in the Region. + // Users in the account will no longer be able to request new public sharing. + // Additionally, snapshots that are already publicly shared are treated as private + // and they are no longer publicly available. If you enable block public access for + // snapshots in block-all-sharing mode, it does not change the permissions for + // snapshots that are already publicly shared. Instead, it prevents these snapshots + // from be publicly visible and publicly accessible. Therefore, the attributes for + // these snapshots still indicate that they are publicly shared, even though they + // are not publicly available. + // - block-new-sharing - Prevents only new public sharing of snapshots in the + // Region. Users in the account will no longer be able to request new public + // sharing. However, snapshots that are already publicly shared, remain publicly + // available. + // + // This member is required. + State types.SnapshotBlockPublicAccessState + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have the + // required permissions, the error response is DryRunOperation . Otherwise, it is + // UnauthorizedOperation . + DryRun *bool + + noSmithyDocumentSerde +} + +type EnableSnapshotBlockPublicAccessOutput struct { + + // The state of block public access for snapshots for the account and Region. + // Returns either block-all-sharing or block-new-sharing if the request succeeds. + State types.SnapshotBlockPublicAccessState + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationEnableSnapshotBlockPublicAccessMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsEc2query_serializeOpEnableSnapshotBlockPublicAccess{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpEnableSnapshotBlockPublicAccess{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addEnableSnapshotBlockPublicAccessResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpEnableSnapshotBlockPublicAccessValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opEnableSnapshotBlockPublicAccess(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opEnableSnapshotBlockPublicAccess(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "ec2", + OperationName: "EnableSnapshotBlockPublicAccess", + } +} + +type opEnableSnapshotBlockPublicAccessResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opEnableSnapshotBlockPublicAccessResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opEnableSnapshotBlockPublicAccessResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "ec2" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "ec2" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("ec2") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addEnableSnapshotBlockPublicAccessResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opEnableSnapshotBlockPublicAccessResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/ec2/api_op_GetSnapshotBlockPublicAccessState.go b/service/ec2/api_op_GetSnapshotBlockPublicAccessState.go new file mode 100644 index 00000000000..13ad6ac195a --- /dev/null +++ b/service/ec2/api_op_GetSnapshotBlockPublicAccessState.go @@ -0,0 +1,270 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/ec2/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets the current state of block public access for snapshots setting for the +// account and Region. For more information, see Block public access for snapshots (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/block-public-access-snapshots.html) +// in the Amazon Elastic Compute Cloud User Guide. +func (c *Client) GetSnapshotBlockPublicAccessState(ctx context.Context, params *GetSnapshotBlockPublicAccessStateInput, optFns ...func(*Options)) (*GetSnapshotBlockPublicAccessStateOutput, error) { + if params == nil { + params = &GetSnapshotBlockPublicAccessStateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSnapshotBlockPublicAccessState", params, optFns, c.addOperationGetSnapshotBlockPublicAccessStateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSnapshotBlockPublicAccessStateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSnapshotBlockPublicAccessStateInput struct { + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have the + // required permissions, the error response is DryRunOperation . Otherwise, it is + // UnauthorizedOperation . + DryRun *bool + + noSmithyDocumentSerde +} + +type GetSnapshotBlockPublicAccessStateOutput struct { + + // The current state of block public access for snapshots. Possible values + // include: + // - block-all-sharing - All public sharing of snapshots is blocked. Users in the + // account can't request new public sharing. Additionally, snapshots that were + // already publicly shared are treated as private and are not publicly available. + // - block-new-sharing - Only new public sharing of snapshots is blocked. Users + // in the account can't request new public sharing. However, snapshots that were + // already publicly shared, remain publicly available. + // - unblocked - Public sharing is not blocked. Users can publicly share + // snapshots. + State types.SnapshotBlockPublicAccessState + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSnapshotBlockPublicAccessStateMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsEc2query_serializeOpGetSnapshotBlockPublicAccessState{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpGetSnapshotBlockPublicAccessState{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addGetSnapshotBlockPublicAccessStateResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSnapshotBlockPublicAccessState(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSnapshotBlockPublicAccessState(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "ec2", + OperationName: "GetSnapshotBlockPublicAccessState", + } +} + +type opGetSnapshotBlockPublicAccessStateResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opGetSnapshotBlockPublicAccessStateResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opGetSnapshotBlockPublicAccessStateResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "ec2" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "ec2" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("ec2") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addGetSnapshotBlockPublicAccessStateResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opGetSnapshotBlockPublicAccessStateResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/ec2/deserializers.go b/service/ec2/deserializers.go index 5e85a5c33db..b061cd62cb4 100644 --- a/service/ec2/deserializers.go +++ b/service/ec2/deserializers.go @@ -33823,6 +33823,97 @@ func awsEc2query_deserializeOpErrorDisableSerialConsoleAccess(response *smithyht } } +type awsEc2query_deserializeOpDisableSnapshotBlockPublicAccess struct { +} + +func (*awsEc2query_deserializeOpDisableSnapshotBlockPublicAccess) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpDisableSnapshotBlockPublicAccess) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsEc2query_deserializeOpErrorDisableSnapshotBlockPublicAccess(response, &metadata) + } + output := &DisableSnapshotBlockPublicAccessOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentDisableSnapshotBlockPublicAccessOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + 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 awsEc2query_deserializeOpErrorDisableSnapshotBlockPublicAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) + if err != nil { + return err + } + awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsEc2query_deserializeOpDisableTransitGatewayRouteTablePropagation struct { } @@ -36393,6 +36484,97 @@ func awsEc2query_deserializeOpErrorEnableSerialConsoleAccess(response *smithyhtt } } +type awsEc2query_deserializeOpEnableSnapshotBlockPublicAccess struct { +} + +func (*awsEc2query_deserializeOpEnableSnapshotBlockPublicAccess) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpEnableSnapshotBlockPublicAccess) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsEc2query_deserializeOpErrorEnableSnapshotBlockPublicAccess(response, &metadata) + } + output := &EnableSnapshotBlockPublicAccessOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentEnableSnapshotBlockPublicAccessOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + 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 awsEc2query_deserializeOpErrorEnableSnapshotBlockPublicAccess(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) + if err != nil { + return err + } + awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsEc2query_deserializeOpEnableTransitGatewayRouteTablePropagation struct { } @@ -39987,6 +40169,97 @@ func awsEc2query_deserializeOpErrorGetSerialConsoleAccessStatus(response *smithy } } +type awsEc2query_deserializeOpGetSnapshotBlockPublicAccessState struct { +} + +func (*awsEc2query_deserializeOpGetSnapshotBlockPublicAccessState) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpGetSnapshotBlockPublicAccessState) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsEc2query_deserializeOpErrorGetSnapshotBlockPublicAccessState(response, &metadata) + } + output := &GetSnapshotBlockPublicAccessStateOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentGetSnapshotBlockPublicAccessStateOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + 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 awsEc2query_deserializeOpErrorGetSnapshotBlockPublicAccessState(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) + if err != nil { + return err + } + awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsEc2query_deserializeOpGetSpotPlacementScores struct { } @@ -153270,6 +153543,55 @@ func awsEc2query_deserializeOpDocumentDisableSerialConsoleAccessOutput(v **Disab return nil } +func awsEc2query_deserializeOpDocumentDisableSnapshotBlockPublicAccessOutput(v **DisableSnapshotBlockPublicAccessOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DisableSnapshotBlockPublicAccessOutput + if *v == nil { + sv = &DisableSnapshotBlockPublicAccessOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("state", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.State = types.SnapshotBlockPublicAccessState(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeOpDocumentDisableTransitGatewayRouteTablePropagationOutput(v **DisableTransitGatewayRouteTablePropagationOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -154661,6 +154983,55 @@ func awsEc2query_deserializeOpDocumentEnableSerialConsoleAccessOutput(v **Enable return nil } +func awsEc2query_deserializeOpDocumentEnableSnapshotBlockPublicAccessOutput(v **EnableSnapshotBlockPublicAccessOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *EnableSnapshotBlockPublicAccessOutput + if *v == nil { + sv = &EnableSnapshotBlockPublicAccessOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("state", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.State = types.SnapshotBlockPublicAccessState(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeOpDocumentEnableTransitGatewayRouteTablePropagationOutput(v **EnableTransitGatewayRouteTablePropagationOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -157031,6 +157402,55 @@ func awsEc2query_deserializeOpDocumentGetSerialConsoleAccessStatusOutput(v **Get return nil } +func awsEc2query_deserializeOpDocumentGetSnapshotBlockPublicAccessStateOutput(v **GetSnapshotBlockPublicAccessStateOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetSnapshotBlockPublicAccessStateOutput + if *v == nil { + sv = &GetSnapshotBlockPublicAccessStateOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("state", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.State = types.SnapshotBlockPublicAccessState(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeOpDocumentGetSpotPlacementScoresOutput(v **GetSpotPlacementScoresOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/ec2/generated.json b/service/ec2/generated.json index 539b6578a6e..8b3c81dde7a 100644 --- a/service/ec2/generated.json +++ b/service/ec2/generated.json @@ -391,6 +391,7 @@ "api_op_DisableImageDeprecation.go", "api_op_DisableIpamOrganizationAdminAccount.go", "api_op_DisableSerialConsoleAccess.go", + "api_op_DisableSnapshotBlockPublicAccess.go", "api_op_DisableTransitGatewayRouteTablePropagation.go", "api_op_DisableVgwRoutePropagation.go", "api_op_DisableVpcClassicLink.go", @@ -420,6 +421,7 @@ "api_op_EnableIpamOrganizationAdminAccount.go", "api_op_EnableReachabilityAnalyzerOrganizationSharing.go", "api_op_EnableSerialConsoleAccess.go", + "api_op_EnableSnapshotBlockPublicAccess.go", "api_op_EnableTransitGatewayRouteTablePropagation.go", "api_op_EnableVgwRoutePropagation.go", "api_op_EnableVolumeIO.go", @@ -460,6 +462,7 @@ "api_op_GetReservedInstancesExchangeQuote.go", "api_op_GetSecurityGroupsForVpc.go", "api_op_GetSerialConsoleAccessStatus.go", + "api_op_GetSnapshotBlockPublicAccessState.go", "api_op_GetSpotPlacementScores.go", "api_op_GetSubnetCidrReservations.go", "api_op_GetTransitGatewayAttachmentPropagations.go", diff --git a/service/ec2/serializers.go b/service/ec2/serializers.go index 6ece4b9431e..06f6cb9c2ab 100644 --- a/service/ec2/serializers.go +++ b/service/ec2/serializers.go @@ -24273,6 +24273,70 @@ func (m *awsEc2query_serializeOpDisableSerialConsoleAccess) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpDisableSnapshotBlockPublicAccess struct { +} + +func (*awsEc2query_serializeOpDisableSnapshotBlockPublicAccess) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpDisableSnapshotBlockPublicAccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DisableSnapshotBlockPublicAccessInput) + _ = 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-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DisableSnapshotBlockPublicAccess") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentDisableSnapshotBlockPublicAccessInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.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 awsEc2query_serializeOpDisableTransitGatewayRouteTablePropagation struct { } @@ -26129,6 +26193,70 @@ func (m *awsEc2query_serializeOpEnableSerialConsoleAccess) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpEnableSnapshotBlockPublicAccess struct { +} + +func (*awsEc2query_serializeOpEnableSnapshotBlockPublicAccess) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpEnableSnapshotBlockPublicAccess) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*EnableSnapshotBlockPublicAccessInput) + _ = 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-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("EnableSnapshotBlockPublicAccess") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentEnableSnapshotBlockPublicAccessInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.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 awsEc2query_serializeOpEnableTransitGatewayRouteTablePropagation struct { } @@ -28689,6 +28817,70 @@ func (m *awsEc2query_serializeOpGetSerialConsoleAccessStatus) HandleSerialize(ct return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpGetSnapshotBlockPublicAccessState struct { +} + +func (*awsEc2query_serializeOpGetSnapshotBlockPublicAccessState) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpGetSnapshotBlockPublicAccessState) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetSnapshotBlockPublicAccessStateInput) + _ = 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-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("GetSnapshotBlockPublicAccessState") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentGetSnapshotBlockPublicAccessStateInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.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 awsEc2query_serializeOpGetSpotPlacementScores struct { } @@ -59604,6 +59796,18 @@ func awsEc2query_serializeOpDocumentDisableSerialConsoleAccessInput(v *DisableSe return nil } +func awsEc2query_serializeOpDocumentDisableSnapshotBlockPublicAccessInput(v *DisableSnapshotBlockPublicAccessInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + return nil +} + func awsEc2query_serializeOpDocumentDisableTransitGatewayRouteTablePropagationInput(v *DisableTransitGatewayRouteTablePropagationInput, value query.Value) error { object := value.Object() _ = object @@ -60196,6 +60400,23 @@ func awsEc2query_serializeOpDocumentEnableSerialConsoleAccessInput(v *EnableSeri return nil } +func awsEc2query_serializeOpDocumentEnableSnapshotBlockPublicAccessInput(v *EnableSnapshotBlockPublicAccessInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + if len(v.State) > 0 { + objectKey := object.Key("State") + objectKey.String(string(v.State)) + } + + return nil +} + func awsEc2query_serializeOpDocumentEnableTransitGatewayRouteTablePropagationInput(v *EnableTransitGatewayRouteTablePropagationInput, value query.Value) error { object := value.Object() _ = object @@ -61249,6 +61470,18 @@ func awsEc2query_serializeOpDocumentGetSerialConsoleAccessStatusInput(v *GetSeri return nil } +func awsEc2query_serializeOpDocumentGetSnapshotBlockPublicAccessStateInput(v *GetSnapshotBlockPublicAccessStateInput, value query.Value) error { + object := value.Object() + _ = object + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + return nil +} + func awsEc2query_serializeOpDocumentGetSpotPlacementScoresInput(v *GetSpotPlacementScoresInput, value query.Value) error { object := value.Object() _ = object diff --git a/service/ec2/types/enums.go b/service/ec2/types/enums.go index e7a1402bb80..193d698d061 100644 --- a/service/ec2/types/enums.go +++ b/service/ec2/types/enums.go @@ -6674,6 +6674,27 @@ func (SnapshotAttributeName) Values() []SnapshotAttributeName { } } +type SnapshotBlockPublicAccessState string + +// Enum values for SnapshotBlockPublicAccessState +const ( + SnapshotBlockPublicAccessStateBlockAllSharing SnapshotBlockPublicAccessState = "block-all-sharing" + SnapshotBlockPublicAccessStateBlockNewSharing SnapshotBlockPublicAccessState = "block-new-sharing" + SnapshotBlockPublicAccessStateUnblocked SnapshotBlockPublicAccessState = "unblocked" +) + +// Values returns all known values for SnapshotBlockPublicAccessState. Note that +// this can be expanded in the future, and 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 (SnapshotBlockPublicAccessState) Values() []SnapshotBlockPublicAccessState { + return []SnapshotBlockPublicAccessState{ + "block-all-sharing", + "block-new-sharing", + "unblocked", + } +} + type SnapshotState string // Enum values for SnapshotState diff --git a/service/ec2/validators.go b/service/ec2/validators.go index 512146cac5a..f251250fd44 100644 --- a/service/ec2/validators.go +++ b/service/ec2/validators.go @@ -5010,6 +5010,26 @@ func (m *validateOpEnableIpamOrganizationAdminAccount) HandleInitialize(ctx cont return next.HandleInitialize(ctx, in) } +type validateOpEnableSnapshotBlockPublicAccess struct { +} + +func (*validateOpEnableSnapshotBlockPublicAccess) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpEnableSnapshotBlockPublicAccess) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*EnableSnapshotBlockPublicAccessInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpEnableSnapshotBlockPublicAccessInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpEnableTransitGatewayRouteTablePropagation struct { } @@ -9530,6 +9550,10 @@ func addOpEnableIpamOrganizationAdminAccountValidationMiddleware(stack *middlewa return stack.Initialize.Add(&validateOpEnableIpamOrganizationAdminAccount{}, middleware.After) } +func addOpEnableSnapshotBlockPublicAccessValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpEnableSnapshotBlockPublicAccess{}, middleware.After) +} + func addOpEnableTransitGatewayRouteTablePropagationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpEnableTransitGatewayRouteTablePropagation{}, middleware.After) } @@ -15303,6 +15327,21 @@ func validateOpEnableIpamOrganizationAdminAccountInput(v *EnableIpamOrganization } } +func validateOpEnableSnapshotBlockPublicAccessInput(v *EnableSnapshotBlockPublicAccessInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EnableSnapshotBlockPublicAccessInput"} + if len(v.State) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("State")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpEnableTransitGatewayRouteTablePropagationInput(v *EnableTransitGatewayRouteTablePropagationInput) error { if v == nil { return nil diff --git a/service/eks/api_op_CreateAddon.go b/service/eks/api_op_CreateAddon.go index 99e65c2cfec..114d20c1655 100644 --- a/service/eks/api_op_CreateAddon.go +++ b/service/eks/api_op_CreateAddon.go @@ -71,8 +71,11 @@ type CreateAddonInput struct { // - Overwrite – If the self-managed version of the add-on is installed on your // cluster and the Amazon EKS default value is different than the existing value, // Amazon EKS changes the value to the Amazon EKS default value. - // - Preserve – Not supported. You can set this value when updating an add-on - // though. For more information, see UpdateAddon (https://docs.aws.amazon.com/eks/latest/APIReference/API_UpdateAddon.html) + // - Preserve – This is similar to the NONE option. If the self-managed version + // of the add-on is installed on your cluster Amazon EKS doesn't change the add-on + // resource properties. Creation of the add-on might fail if conflicts are + // detected. This option works differently during the update operation. For more + // information, see UpdateAddon (https://docs.aws.amazon.com/eks/latest/APIReference/API_UpdateAddon.html) // . // If you don't currently have the self-managed version of the add-on installed on // your cluster, the Amazon EKS add-on is installed. Amazon EKS sets all values to diff --git a/service/eks/api_op_CreateEksAnywhereSubscription.go b/service/eks/api_op_CreateEksAnywhereSubscription.go new file mode 100644 index 00000000000..7581a95a4cf --- /dev/null +++ b/service/eks/api_op_CreateEksAnywhereSubscription.go @@ -0,0 +1,337 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eks + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/eks/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an EKS Anywhere subscription. When a subscription is created, it is a +// contract agreement for the length of the term specified in the request. Licenses +// that are used to validate support are provisioned in Amazon Web Services License +// Manager and the caller account is granted access to EKS Anywhere Curated +// Packages. +func (c *Client) CreateEksAnywhereSubscription(ctx context.Context, params *CreateEksAnywhereSubscriptionInput, optFns ...func(*Options)) (*CreateEksAnywhereSubscriptionOutput, error) { + if params == nil { + params = &CreateEksAnywhereSubscriptionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateEksAnywhereSubscription", params, optFns, c.addOperationCreateEksAnywhereSubscriptionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateEksAnywhereSubscriptionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateEksAnywhereSubscriptionInput struct { + + // The unique name for your subscription. It must be unique in your Amazon Web + // Services account in the Amazon Web Services Region you're creating the + // subscription in. The name can contain only alphanumeric characters + // (case-sensitive), hyphens, and underscores. It must start with an alphabetic + // character and can't be longer than 100 characters. + // + // This member is required. + Name *string + + // An object representing the term duration and term unit type of your + // subscription. This determines the term length of your subscription. Valid values + // are MONTHS for term unit and 12 or 36 for term duration, indicating a 12 month + // or 36 month subscription. This value cannot be changed after creating the + // subscription. + // + // This member is required. + Term *types.EksAnywhereSubscriptionTerm + + // A boolean indicating whether the subscription auto renews at the end of the + // term. + AutoRenew bool + + // Unique, case-sensitive identifier that you provide to ensure the idempotency of + // the request. + ClientRequestToken *string + + // The number of licenses to purchase with the subscription. Valid values are + // between 1 and 1000. This value cannot be changed after creating the + // subscription. + LicenseQuantity int32 + + // The license type for all licenses in the subscription. Valid value is CLUSTER. + // With the CLUSTER license type, each license covers support for a single EKS + // Anywhere cluster. + LicenseType types.EksAnywhereSubscriptionLicenseType + + // The metadata for a subscription to assist with categorization and organization. + // Each tag consists of a key and an optional value. Subscription tags do not + // propagate to any other resources associated with the subscription. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateEksAnywhereSubscriptionOutput struct { + + // The full description of the subscription. + Subscription *types.EksAnywhereSubscription + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateEksAnywhereSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateEksAnywhereSubscription{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateEksAnywhereSubscription{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addCreateEksAnywhereSubscriptionResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opCreateEksAnywhereSubscriptionMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateEksAnywhereSubscriptionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateEksAnywhereSubscription(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateEksAnywhereSubscription struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateEksAnywhereSubscription) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateEksAnywhereSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*CreateEksAnywhereSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateEksAnywhereSubscriptionInput ") + } + + if input.ClientRequestToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientRequestToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opCreateEksAnywhereSubscriptionMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateEksAnywhereSubscription{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateEksAnywhereSubscription(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "eks", + OperationName: "CreateEksAnywhereSubscription", + } +} + +type opCreateEksAnywhereSubscriptionResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opCreateEksAnywhereSubscriptionResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opCreateEksAnywhereSubscriptionResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "eks" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "eks" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("eks") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addCreateEksAnywhereSubscriptionResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opCreateEksAnywhereSubscriptionResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/eks/api_op_CreateFargateProfile.go b/service/eks/api_op_CreateFargateProfile.go index ad27099d089..6e6ef6341c8 100644 --- a/service/eks/api_op_CreateFargateProfile.go +++ b/service/eks/api_op_CreateFargateProfile.go @@ -27,7 +27,7 @@ import ( // selectors in the Fargate profile, then that pod is run on Fargate. When you // create a Fargate profile, you must specify a pod execution role to use with the // pods that are scheduled with the profile. This role is added to the cluster's -// Kubernetes Role Based Access Control (https://kubernetes.io/docs/admin/authorization/rbac/) +// Kubernetes Role Based Access Control (https://kubernetes.io/docs/reference/access-authn-authz/rbac/) // (RBAC) for authorization so that the kubelet that is running on the Fargate // infrastructure can register with your Amazon EKS cluster so that it can appear // in your cluster as a node. The pod execution role also provides IAM permissions diff --git a/service/eks/api_op_CreateNodegroup.go b/service/eks/api_op_CreateNodegroup.go index da5dc8c7f06..0b45aa09ebc 100644 --- a/service/eks/api_op_CreateNodegroup.go +++ b/service/eks/api_op_CreateNodegroup.go @@ -18,13 +18,10 @@ import ( // Creates a managed node group for an Amazon EKS cluster. You can only create a // node group for your cluster that is equal to the current Kubernetes version for -// the cluster. All node groups are created with the latest AMI release version for -// the respective minor Kubernetes version of the cluster, unless you deploy a -// custom AMI using a launch template. For more information about using launch -// templates, see Launch template support (https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html) -// . An Amazon EKS managed node group is an Amazon EC2 Auto Scaling group and -// associated Amazon EC2 instances that are managed by Amazon Web Services for an -// Amazon EKS cluster. For more information, see Managed node groups (https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html) +// the cluster. An Amazon EKS managed node group is an Amazon EC2 Auto Scaling +// group and associated Amazon EC2 instances that are managed by Amazon Web +// Services for an Amazon EKS cluster. For more information, see Managed node +// groups (https://docs.aws.amazon.com/eks/latest/userguide/managed-node-groups.html) // in the Amazon EKS User Guide. Windows AMI types are only supported for // commercial Regions that support Windows Amazon EKS. func (c *Client) CreateNodegroup(ctx context.Context, params *CreateNodegroupInput, optFns ...func(*Options)) (*CreateNodegroupOutput, error) { diff --git a/service/eks/api_op_DeleteEksAnywhereSubscription.go b/service/eks/api_op_DeleteEksAnywhereSubscription.go new file mode 100644 index 00000000000..bbf398b1f40 --- /dev/null +++ b/service/eks/api_op_DeleteEksAnywhereSubscription.go @@ -0,0 +1,265 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eks + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/eks/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an expired / inactive subscription. Deleting inactive subscriptions +// removes them from the Amazon Web Services Management Console view and from +// list/describe API responses. Subscriptions can only be cancelled within 7 days +// of creation, and are cancelled by creating a ticket in the Amazon Web Services +// Support Center. +func (c *Client) DeleteEksAnywhereSubscription(ctx context.Context, params *DeleteEksAnywhereSubscriptionInput, optFns ...func(*Options)) (*DeleteEksAnywhereSubscriptionOutput, error) { + if params == nil { + params = &DeleteEksAnywhereSubscriptionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteEksAnywhereSubscription", params, optFns, c.addOperationDeleteEksAnywhereSubscriptionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteEksAnywhereSubscriptionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteEksAnywhereSubscriptionInput struct { + + // The ID of the subscription. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type DeleteEksAnywhereSubscriptionOutput struct { + + // The full description of the subscription to be deleted. + Subscription *types.EksAnywhereSubscription + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteEksAnywhereSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteEksAnywhereSubscription{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteEksAnywhereSubscription{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addDeleteEksAnywhereSubscriptionResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDeleteEksAnywhereSubscriptionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteEksAnywhereSubscription(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteEksAnywhereSubscription(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "eks", + OperationName: "DeleteEksAnywhereSubscription", + } +} + +type opDeleteEksAnywhereSubscriptionResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDeleteEksAnywhereSubscriptionResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDeleteEksAnywhereSubscriptionResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "eks" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "eks" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("eks") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDeleteEksAnywhereSubscriptionResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDeleteEksAnywhereSubscriptionResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/eks/api_op_DescribeEksAnywhereSubscription.go b/service/eks/api_op_DescribeEksAnywhereSubscription.go new file mode 100644 index 00000000000..234a6001e95 --- /dev/null +++ b/service/eks/api_op_DescribeEksAnywhereSubscription.go @@ -0,0 +1,261 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eks + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/eks/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns descriptive information about a subscription. +func (c *Client) DescribeEksAnywhereSubscription(ctx context.Context, params *DescribeEksAnywhereSubscriptionInput, optFns ...func(*Options)) (*DescribeEksAnywhereSubscriptionOutput, error) { + if params == nil { + params = &DescribeEksAnywhereSubscriptionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeEksAnywhereSubscription", params, optFns, c.addOperationDescribeEksAnywhereSubscriptionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeEksAnywhereSubscriptionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeEksAnywhereSubscriptionInput struct { + + // The ID of the subscription. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type DescribeEksAnywhereSubscriptionOutput struct { + + // The full description of the subscription. + Subscription *types.EksAnywhereSubscription + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeEksAnywhereSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeEksAnywhereSubscription{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeEksAnywhereSubscription{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addDescribeEksAnywhereSubscriptionResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addOpDescribeEksAnywhereSubscriptionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeEksAnywhereSubscription(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeEksAnywhereSubscription(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "eks", + OperationName: "DescribeEksAnywhereSubscription", + } +} + +type opDescribeEksAnywhereSubscriptionResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opDescribeEksAnywhereSubscriptionResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opDescribeEksAnywhereSubscriptionResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "eks" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "eks" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("eks") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addDescribeEksAnywhereSubscriptionResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opDescribeEksAnywhereSubscriptionResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/eks/api_op_DisassociateIdentityProviderConfig.go b/service/eks/api_op_DisassociateIdentityProviderConfig.go index 5d4ce8e0a6a..37fd8f17ded 100644 --- a/service/eks/api_op_DisassociateIdentityProviderConfig.go +++ b/service/eks/api_op_DisassociateIdentityProviderConfig.go @@ -19,7 +19,8 @@ import ( // Disassociates an identity provider configuration from a cluster. If you // disassociate an identity provider from your cluster, users included in the // provider can no longer access the cluster. However, you can still access the -// cluster with Amazon Web Services IAM users. +// cluster with IAM principals (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) +// . func (c *Client) DisassociateIdentityProviderConfig(ctx context.Context, params *DisassociateIdentityProviderConfigInput, optFns ...func(*Options)) (*DisassociateIdentityProviderConfigOutput, error) { if params == nil { params = &DisassociateIdentityProviderConfigInput{} diff --git a/service/eks/api_op_ListAddons.go b/service/eks/api_op_ListAddons.go index 143fbc528e1..6729b5f95c4 100644 --- a/service/eks/api_op_ListAddons.go +++ b/service/eks/api_op_ListAddons.go @@ -15,7 +15,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the available add-ons. +// Lists the installed add-ons. func (c *Client) ListAddons(ctx context.Context, params *ListAddonsInput, optFns ...func(*Options)) (*ListAddonsOutput, error) { if params == nil { params = &ListAddonsInput{} @@ -60,7 +60,7 @@ type ListAddonsInput struct { type ListAddonsOutput struct { - // A list of available add-ons. + // A list of installed add-ons. Addons []string // The nextToken value returned from a previous paginated ListAddonsResponse where diff --git a/service/eks/api_op_ListEksAnywhereSubscriptions.go b/service/eks/api_op_ListEksAnywhereSubscriptions.go new file mode 100644 index 00000000000..36b105f7b80 --- /dev/null +++ b/service/eks/api_op_ListEksAnywhereSubscriptions.go @@ -0,0 +1,279 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eks + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/eks/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Displays the full description of the subscription. +func (c *Client) ListEksAnywhereSubscriptions(ctx context.Context, params *ListEksAnywhereSubscriptionsInput, optFns ...func(*Options)) (*ListEksAnywhereSubscriptionsOutput, error) { + if params == nil { + params = &ListEksAnywhereSubscriptionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListEksAnywhereSubscriptions", params, optFns, c.addOperationListEksAnywhereSubscriptionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListEksAnywhereSubscriptionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListEksAnywhereSubscriptionsInput struct { + + // An array of subscription statuses to filter on. + IncludeStatus []types.EksAnywhereSubscriptionStatus + + // The maximum number of cluster results returned by ListEksAnywhereSubscriptions + // in paginated output. When you use this parameter, ListEksAnywhereSubscriptions + // returns only maxResults results in a single page along with a nextToken response + // element. You can see the remaining results of the initial request by sending + // another ListEksAnywhereSubscriptions request with the returned nextToken value. + // This value can be between 1 and 100. If you don't use this parameter, + // ListEksAnywhereSubscriptions returns up to 10 results and a nextToken value if + // applicable. + MaxResults *int32 + + // The nextToken value to include in a future ListEksAnywhereSubscriptions + // request. When the results of a ListEksAnywhereSubscriptions request exceed + // maxResults, you can use this value to retrieve the next page of results. This + // value is null when there are no more results to return. + NextToken *string + + noSmithyDocumentSerde +} + +type ListEksAnywhereSubscriptionsOutput struct { + + // The nextToken value to include in a future ListEksAnywhereSubscriptions + // request. When the results of a ListEksAnywhereSubscriptions request exceed + // maxResults, you can use this value to retrieve the next page of results. This + // value is null when there are no more results to return. + NextToken *string + + // A list of all subscription objects in the region, filtered by includeStatus and + // paginated by nextToken and maxResults. + Subscriptions []types.EksAnywhereSubscription + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListEksAnywhereSubscriptionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListEksAnywhereSubscriptions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListEksAnywhereSubscriptions{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addListEksAnywhereSubscriptionsResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListEksAnywhereSubscriptions(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListEksAnywhereSubscriptions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "eks", + OperationName: "ListEksAnywhereSubscriptions", + } +} + +type opListEksAnywhereSubscriptionsResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opListEksAnywhereSubscriptionsResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opListEksAnywhereSubscriptionsResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "eks" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "eks" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("eks") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addListEksAnywhereSubscriptionsResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opListEksAnywhereSubscriptionsResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/eks/api_op_UpdateEksAnywhereSubscription.go b/service/eks/api_op_UpdateEksAnywhereSubscription.go new file mode 100644 index 00000000000..ea1f8b5572c --- /dev/null +++ b/service/eks/api_op_UpdateEksAnywhereSubscription.go @@ -0,0 +1,306 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package eks + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + "github.com/aws/aws-sdk-go-v2/service/eks/types" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Update an EKS Anywhere Subscription. Only auto renewal and tags can be updated +// after subscription creation. +func (c *Client) UpdateEksAnywhereSubscription(ctx context.Context, params *UpdateEksAnywhereSubscriptionInput, optFns ...func(*Options)) (*UpdateEksAnywhereSubscriptionOutput, error) { + if params == nil { + params = &UpdateEksAnywhereSubscriptionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateEksAnywhereSubscription", params, optFns, c.addOperationUpdateEksAnywhereSubscriptionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateEksAnywhereSubscriptionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateEksAnywhereSubscriptionInput struct { + + // A boolean indicating whether or not to automatically renew the subscription. + // + // This member is required. + AutoRenew bool + + // + // + // This member is required. + Id *string + + // Unique, case-sensitive identifier to ensure the idempotency of the request. + ClientRequestToken *string + + noSmithyDocumentSerde +} + +type UpdateEksAnywhereSubscriptionOutput struct { + + // The full description of the updated subscription. + Subscription *types.EksAnywhereSubscription + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateEksAnywhereSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateEksAnywhereSubscription{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateEksAnywhereSubscription{}, middleware.After) + if err != nil { + return 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 = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack, 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 = addUpdateEksAnywhereSubscriptionResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opUpdateEksAnywhereSubscriptionMiddleware(stack, options); err != nil { + return err + } + if err = addOpUpdateEksAnywhereSubscriptionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateEksAnywhereSubscription(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 = addendpointDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpUpdateEksAnywhereSubscription struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpUpdateEksAnywhereSubscription) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpUpdateEksAnywhereSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.tokenProvider == nil { + return next.HandleInitialize(ctx, in) + } + + input, ok := in.Parameters.(*UpdateEksAnywhereSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *UpdateEksAnywhereSubscriptionInput ") + } + + if input.ClientRequestToken == nil { + t, err := m.tokenProvider.GetIdempotencyToken() + if err != nil { + return out, metadata, err + } + input.ClientRequestToken = &t + } + return next.HandleInitialize(ctx, in) +} +func addIdempotencyToken_opUpdateEksAnywhereSubscriptionMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpUpdateEksAnywhereSubscription{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opUpdateEksAnywhereSubscription(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "eks", + OperationName: "UpdateEksAnywhereSubscription", + } +} + +type opUpdateEksAnywhereSubscriptionResolveEndpointMiddleware struct { + EndpointResolver EndpointResolverV2 + BuiltInResolver builtInParameterResolver +} + +func (*opUpdateEksAnywhereSubscriptionResolveEndpointMiddleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *opUpdateEksAnywhereSubscriptionResolveEndpointMiddleware) 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.EndpointResolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := EndpointParameters{} + + m.BuiltInResolver.ResolveBuiltIns(¶ms) + + var resolvedEndpoint smithyendpoints.Endpoint + resolvedEndpoint, err = m.EndpointResolver.ResolveEndpoint(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL = &resolvedEndpoint.URI + + for k := range resolvedEndpoint.Headers { + req.Header.Set( + k, + resolvedEndpoint.Headers.Get(k), + ) + } + + authSchemes, err := internalauth.GetAuthenticationSchemes(&resolvedEndpoint.Properties) + if err != nil { + var nfe *internalauth.NoAuthenticationSchemesFoundError + if errors.As(err, &nfe) { + // if no auth scheme is found, default to sigv4 + signingName := "eks" + signingRegion := m.BuiltInResolver.(*builtInResolver).Region + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + + } + var ue *internalauth.UnSupportedAuthenticationSchemeSpecifiedError + if errors.As(err, &ue) { + return out, metadata, fmt.Errorf( + "This operation requests signer version(s) %v but the client only supports %v", + ue.UnsupportedSchemes, + internalauth.SupportedSchemes, + ) + } + } + + for _, authScheme := range authSchemes { + switch authScheme.(type) { + case *internalauth.AuthenticationSchemeV4: + v4Scheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4) + var signingName, signingRegion string + if v4Scheme.SigningName == nil { + signingName = "eks" + } else { + signingName = *v4Scheme.SigningName + } + if v4Scheme.SigningRegion == nil { + signingRegion = m.BuiltInResolver.(*builtInResolver).Region + } else { + signingRegion = *v4Scheme.SigningRegion + } + if v4Scheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4Scheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + ctx = awsmiddleware.SetSigningRegion(ctx, signingRegion) + break + case *internalauth.AuthenticationSchemeV4A: + v4aScheme, _ := authScheme.(*internalauth.AuthenticationSchemeV4A) + if v4aScheme.SigningName == nil { + v4aScheme.SigningName = aws.String("eks") + } + if v4aScheme.DisableDoubleEncoding != nil { + // The signer sets an equivalent value at client initialization time. + // Setting this context value will cause the signer to extract it + // and override the value set at client initialization time. + ctx = internalauth.SetDisableDoubleEncoding(ctx, *v4aScheme.DisableDoubleEncoding) + } + ctx = awsmiddleware.SetSigningName(ctx, *v4aScheme.SigningName) + ctx = awsmiddleware.SetSigningRegion(ctx, v4aScheme.SigningRegionSet[0]) + break + case *internalauth.AuthenticationSchemeNone: + break + } + } + + return next.HandleSerialize(ctx, in) +} + +func addUpdateEksAnywhereSubscriptionResolveEndpointMiddleware(stack *middleware.Stack, options Options) error { + return stack.Serialize.Insert(&opUpdateEksAnywhereSubscriptionResolveEndpointMiddleware{ + EndpointResolver: options.EndpointResolverV2, + BuiltInResolver: &builtInResolver{ + Region: options.Region, + UseDualStack: options.EndpointOptions.UseDualStackEndpoint, + UseFIPS: options.EndpointOptions.UseFIPSEndpoint, + Endpoint: options.BaseEndpoint, + }, + }, "ResolveEndpoint", middleware.After) +} diff --git a/service/eks/deserializers.go b/service/eks/deserializers.go index d03ee967db2..18efa2f2edc 100644 --- a/service/eks/deserializers.go +++ b/service/eks/deserializers.go @@ -675,14 +675,14 @@ func awsRestjson1_deserializeOpDocumentCreateClusterOutput(v **CreateClusterOutp return nil } -type awsRestjson1_deserializeOpCreateFargateProfile struct { +type awsRestjson1_deserializeOpCreateEksAnywhereSubscription struct { } -func (*awsRestjson1_deserializeOpCreateFargateProfile) ID() string { +func (*awsRestjson1_deserializeOpCreateEksAnywhereSubscription) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateFargateProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateEksAnywhereSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -696,9 +696,9 @@ func (m *awsRestjson1_deserializeOpCreateFargateProfile) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateFargateProfile(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateEksAnywhereSubscription(response, &metadata) } - output := &CreateFargateProfileOutput{} + output := &CreateEksAnywhereSubscriptionOutput{} out.Result = output var buff [1024]byte @@ -719,7 +719,7 @@ func (m *awsRestjson1_deserializeOpCreateFargateProfile) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateFargateProfileOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateEksAnywhereSubscriptionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -732,7 +732,7 @@ func (m *awsRestjson1_deserializeOpCreateFargateProfile) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateFargateProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateEksAnywhereSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -779,17 +779,14 @@ func awsRestjson1_deserializeOpErrorCreateFargateProfile(response *smithyhttp.Re case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceLimitExceededException", errorCode): return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) case strings.EqualFold("ServerException", errorCode): return awsRestjson1_deserializeErrorServerException(response, errorBody) - case strings.EqualFold("UnsupportedAvailabilityZoneException", errorCode): - return awsRestjson1_deserializeErrorUnsupportedAvailabilityZoneException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -801,7 +798,7 @@ func awsRestjson1_deserializeOpErrorCreateFargateProfile(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentCreateFargateProfileOutput(v **CreateFargateProfileOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateEksAnywhereSubscriptionOutput(v **CreateEksAnywhereSubscriptionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -814,17 +811,17 @@ func awsRestjson1_deserializeOpDocumentCreateFargateProfileOutput(v **CreateFarg return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateFargateProfileOutput + var sv *CreateEksAnywhereSubscriptionOutput if *v == nil { - sv = &CreateFargateProfileOutput{} + sv = &CreateEksAnywhereSubscriptionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "fargateProfile": - if err := awsRestjson1_deserializeDocumentFargateProfile(&sv.FargateProfile, value); err != nil { + case "subscription": + if err := awsRestjson1_deserializeDocumentEksAnywhereSubscription(&sv.Subscription, value); err != nil { return err } @@ -837,14 +834,14 @@ func awsRestjson1_deserializeOpDocumentCreateFargateProfileOutput(v **CreateFarg return nil } -type awsRestjson1_deserializeOpCreateNodegroup struct { +type awsRestjson1_deserializeOpCreateFargateProfile struct { } -func (*awsRestjson1_deserializeOpCreateNodegroup) ID() string { +func (*awsRestjson1_deserializeOpCreateFargateProfile) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpCreateNodegroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateFargateProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -858,9 +855,9 @@ func (m *awsRestjson1_deserializeOpCreateNodegroup) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorCreateNodegroup(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateFargateProfile(response, &metadata) } - output := &CreateNodegroupOutput{} + output := &CreateFargateProfileOutput{} out.Result = output var buff [1024]byte @@ -881,7 +878,7 @@ func (m *awsRestjson1_deserializeOpCreateNodegroup) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentCreateNodegroupOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateFargateProfileOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -894,7 +891,7 @@ func (m *awsRestjson1_deserializeOpCreateNodegroup) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorCreateNodegroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateFargateProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -944,17 +941,14 @@ func awsRestjson1_deserializeOpErrorCreateNodegroup(response *smithyhttp.Respons case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - case strings.EqualFold("ResourceLimitExceededException", errorCode): return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) case strings.EqualFold("ServerException", errorCode): return awsRestjson1_deserializeErrorServerException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("UnsupportedAvailabilityZoneException", errorCode): + return awsRestjson1_deserializeErrorUnsupportedAvailabilityZoneException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -966,7 +960,7 @@ func awsRestjson1_deserializeOpErrorCreateNodegroup(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentCreateNodegroupOutput(v **CreateNodegroupOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateFargateProfileOutput(v **CreateFargateProfileOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -979,17 +973,17 @@ func awsRestjson1_deserializeOpDocumentCreateNodegroupOutput(v **CreateNodegroup return fmt.Errorf("unexpected JSON type %v", value) } - var sv *CreateNodegroupOutput + var sv *CreateFargateProfileOutput if *v == nil { - sv = &CreateNodegroupOutput{} + sv = &CreateFargateProfileOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nodegroup": - if err := awsRestjson1_deserializeDocumentNodegroup(&sv.Nodegroup, value); err != nil { + case "fargateProfile": + if err := awsRestjson1_deserializeDocumentFargateProfile(&sv.FargateProfile, value); err != nil { return err } @@ -1002,14 +996,14 @@ func awsRestjson1_deserializeOpDocumentCreateNodegroupOutput(v **CreateNodegroup return nil } -type awsRestjson1_deserializeOpDeleteAddon struct { +type awsRestjson1_deserializeOpCreateNodegroup struct { } -func (*awsRestjson1_deserializeOpDeleteAddon) ID() string { +func (*awsRestjson1_deserializeOpCreateNodegroup) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteAddon) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpCreateNodegroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1023,9 +1017,9 @@ func (m *awsRestjson1_deserializeOpDeleteAddon) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteAddon(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorCreateNodegroup(response, &metadata) } - output := &DeleteAddonOutput{} + output := &CreateNodegroupOutput{} out.Result = output var buff [1024]byte @@ -1046,7 +1040,7 @@ func (m *awsRestjson1_deserializeOpDeleteAddon) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteAddonOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentCreateNodegroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1059,7 +1053,7 @@ func (m *awsRestjson1_deserializeOpDeleteAddon) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteAddon(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorCreateNodegroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1109,12 +1103,18 @@ func awsRestjson1_deserializeOpErrorDeleteAddon(response *smithyhttp.Response, m case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + + case strings.EqualFold("ResourceLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) case strings.EqualFold("ServerException", errorCode): return awsRestjson1_deserializeErrorServerException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1125,7 +1125,7 @@ func awsRestjson1_deserializeOpErrorDeleteAddon(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentDeleteAddonOutput(v **DeleteAddonOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentCreateNodegroupOutput(v **CreateNodegroupOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1138,17 +1138,17 @@ func awsRestjson1_deserializeOpDocumentDeleteAddonOutput(v **DeleteAddonOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteAddonOutput + var sv *CreateNodegroupOutput if *v == nil { - sv = &DeleteAddonOutput{} + sv = &CreateNodegroupOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "addon": - if err := awsRestjson1_deserializeDocumentAddon(&sv.Addon, value); err != nil { + case "nodegroup": + if err := awsRestjson1_deserializeDocumentNodegroup(&sv.Nodegroup, value); err != nil { return err } @@ -1161,14 +1161,14 @@ func awsRestjson1_deserializeOpDocumentDeleteAddonOutput(v **DeleteAddonOutput, return nil } -type awsRestjson1_deserializeOpDeleteCluster struct { +type awsRestjson1_deserializeOpDeleteAddon struct { } -func (*awsRestjson1_deserializeOpDeleteCluster) ID() string { +func (*awsRestjson1_deserializeOpDeleteAddon) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteCluster) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteAddon) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1182,9 +1182,9 @@ func (m *awsRestjson1_deserializeOpDeleteCluster) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteCluster(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAddon(response, &metadata) } - output := &DeleteClusterOutput{} + output := &DeleteAddonOutput{} out.Result = output var buff [1024]byte @@ -1205,7 +1205,7 @@ func (m *awsRestjson1_deserializeOpDeleteCluster) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteClusterOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteAddonOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1218,7 +1218,7 @@ func (m *awsRestjson1_deserializeOpDeleteCluster) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteAddon(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1262,8 +1262,11 @@ func awsRestjson1_deserializeOpErrorDeleteCluster(response *smithyhttp.Response, case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1271,9 +1274,6 @@ func awsRestjson1_deserializeOpErrorDeleteCluster(response *smithyhttp.Response, case strings.EqualFold("ServerException", errorCode): return awsRestjson1_deserializeErrorServerException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1284,7 +1284,7 @@ func awsRestjson1_deserializeOpErrorDeleteCluster(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentDeleteClusterOutput(v **DeleteClusterOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteAddonOutput(v **DeleteAddonOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1297,17 +1297,17 @@ func awsRestjson1_deserializeOpDocumentDeleteClusterOutput(v **DeleteClusterOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteClusterOutput + var sv *DeleteAddonOutput if *v == nil { - sv = &DeleteClusterOutput{} + sv = &DeleteAddonOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "cluster": - if err := awsRestjson1_deserializeDocumentCluster(&sv.Cluster, value); err != nil { + case "addon": + if err := awsRestjson1_deserializeDocumentAddon(&sv.Addon, value); err != nil { return err } @@ -1320,14 +1320,14 @@ func awsRestjson1_deserializeOpDocumentDeleteClusterOutput(v **DeleteClusterOutp return nil } -type awsRestjson1_deserializeOpDeleteFargateProfile struct { +type awsRestjson1_deserializeOpDeleteCluster struct { } -func (*awsRestjson1_deserializeOpDeleteFargateProfile) ID() string { +func (*awsRestjson1_deserializeOpDeleteCluster) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteFargateProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteCluster) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1341,9 +1341,9 @@ func (m *awsRestjson1_deserializeOpDeleteFargateProfile) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteFargateProfile(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteCluster(response, &metadata) } - output := &DeleteFargateProfileOutput{} + output := &DeleteClusterOutput{} out.Result = output var buff [1024]byte @@ -1364,7 +1364,7 @@ func (m *awsRestjson1_deserializeOpDeleteFargateProfile) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteFargateProfileOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteClusterOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1377,7 +1377,7 @@ func (m *awsRestjson1_deserializeOpDeleteFargateProfile) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteFargateProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1421,8 +1421,8 @@ func awsRestjson1_deserializeOpErrorDeleteFargateProfile(response *smithyhttp.Re case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1430,6 +1430,9 @@ func awsRestjson1_deserializeOpErrorDeleteFargateProfile(response *smithyhttp.Re case strings.EqualFold("ServerException", errorCode): return awsRestjson1_deserializeErrorServerException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1440,7 +1443,7 @@ func awsRestjson1_deserializeOpErrorDeleteFargateProfile(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentDeleteFargateProfileOutput(v **DeleteFargateProfileOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteClusterOutput(v **DeleteClusterOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1453,17 +1456,17 @@ func awsRestjson1_deserializeOpDocumentDeleteFargateProfileOutput(v **DeleteFarg return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteFargateProfileOutput + var sv *DeleteClusterOutput if *v == nil { - sv = &DeleteFargateProfileOutput{} + sv = &DeleteClusterOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "fargateProfile": - if err := awsRestjson1_deserializeDocumentFargateProfile(&sv.FargateProfile, value); err != nil { + case "cluster": + if err := awsRestjson1_deserializeDocumentCluster(&sv.Cluster, value); err != nil { return err } @@ -1476,14 +1479,14 @@ func awsRestjson1_deserializeOpDocumentDeleteFargateProfileOutput(v **DeleteFarg return nil } -type awsRestjson1_deserializeOpDeleteNodegroup struct { +type awsRestjson1_deserializeOpDeleteEksAnywhereSubscription struct { } -func (*awsRestjson1_deserializeOpDeleteNodegroup) ID() string { +func (*awsRestjson1_deserializeOpDeleteEksAnywhereSubscription) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteNodegroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteEksAnywhereSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1497,9 +1500,9 @@ func (m *awsRestjson1_deserializeOpDeleteNodegroup) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteNodegroup(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteEksAnywhereSubscription(response, &metadata) } - output := &DeleteNodegroupOutput{} + output := &DeleteEksAnywhereSubscriptionOutput{} out.Result = output var buff [1024]byte @@ -1520,7 +1523,7 @@ func (m *awsRestjson1_deserializeOpDeleteNodegroup) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeleteNodegroupOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteEksAnywhereSubscriptionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1533,7 +1536,7 @@ func (m *awsRestjson1_deserializeOpDeleteNodegroup) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteNodegroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteEksAnywhereSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1577,11 +1580,8 @@ func awsRestjson1_deserializeOpErrorDeleteNodegroup(response *smithyhttp.Respons case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1589,9 +1589,6 @@ func awsRestjson1_deserializeOpErrorDeleteNodegroup(response *smithyhttp.Respons case strings.EqualFold("ServerException", errorCode): return awsRestjson1_deserializeErrorServerException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1602,7 +1599,7 @@ func awsRestjson1_deserializeOpErrorDeleteNodegroup(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentDeleteNodegroupOutput(v **DeleteNodegroupOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteEksAnywhereSubscriptionOutput(v **DeleteEksAnywhereSubscriptionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1615,17 +1612,17 @@ func awsRestjson1_deserializeOpDocumentDeleteNodegroupOutput(v **DeleteNodegroup return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteNodegroupOutput + var sv *DeleteEksAnywhereSubscriptionOutput if *v == nil { - sv = &DeleteNodegroupOutput{} + sv = &DeleteEksAnywhereSubscriptionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nodegroup": - if err := awsRestjson1_deserializeDocumentNodegroup(&sv.Nodegroup, value); err != nil { + case "subscription": + if err := awsRestjson1_deserializeDocumentEksAnywhereSubscription(&sv.Subscription, value); err != nil { return err } @@ -1638,14 +1635,14 @@ func awsRestjson1_deserializeOpDocumentDeleteNodegroupOutput(v **DeleteNodegroup return nil } -type awsRestjson1_deserializeOpDeregisterCluster struct { +type awsRestjson1_deserializeOpDeleteFargateProfile struct { } -func (*awsRestjson1_deserializeOpDeregisterCluster) ID() string { +func (*awsRestjson1_deserializeOpDeleteFargateProfile) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeregisterCluster) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteFargateProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1659,9 +1656,9 @@ func (m *awsRestjson1_deserializeOpDeregisterCluster) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeregisterCluster(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteFargateProfile(response, &metadata) } - output := &DeregisterClusterOutput{} + output := &DeleteFargateProfileOutput{} out.Result = output var buff [1024]byte @@ -1682,7 +1679,7 @@ func (m *awsRestjson1_deserializeOpDeregisterCluster) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDeregisterClusterOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteFargateProfileOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1695,7 +1692,7 @@ func (m *awsRestjson1_deserializeOpDeregisterCluster) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeregisterCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteFargateProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1736,14 +1733,11 @@ func awsRestjson1_deserializeOpErrorDeregisterCluster(response *smithyhttp.Respo } switch { - case strings.EqualFold("AccessDeniedException", errorCode): - return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ClientException", errorCode): return awsRestjson1_deserializeErrorClientException(response, errorBody) - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1751,9 +1745,6 @@ func awsRestjson1_deserializeOpErrorDeregisterCluster(response *smithyhttp.Respo case strings.EqualFold("ServerException", errorCode): return awsRestjson1_deserializeErrorServerException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1764,7 +1755,7 @@ func awsRestjson1_deserializeOpErrorDeregisterCluster(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentDeregisterClusterOutput(v **DeregisterClusterOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteFargateProfileOutput(v **DeleteFargateProfileOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1777,17 +1768,17 @@ func awsRestjson1_deserializeOpDocumentDeregisterClusterOutput(v **DeregisterClu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeregisterClusterOutput + var sv *DeleteFargateProfileOutput if *v == nil { - sv = &DeregisterClusterOutput{} + sv = &DeleteFargateProfileOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "cluster": - if err := awsRestjson1_deserializeDocumentCluster(&sv.Cluster, value); err != nil { + case "fargateProfile": + if err := awsRestjson1_deserializeDocumentFargateProfile(&sv.FargateProfile, value); err != nil { return err } @@ -1800,14 +1791,14 @@ func awsRestjson1_deserializeOpDocumentDeregisterClusterOutput(v **DeregisterClu return nil } -type awsRestjson1_deserializeOpDescribeAddon struct { +type awsRestjson1_deserializeOpDeleteNodegroup struct { } -func (*awsRestjson1_deserializeOpDescribeAddon) ID() string { +func (*awsRestjson1_deserializeOpDeleteNodegroup) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeAddon) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteNodegroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1821,9 +1812,9 @@ func (m *awsRestjson1_deserializeOpDescribeAddon) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeAddon(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteNodegroup(response, &metadata) } - output := &DescribeAddonOutput{} + output := &DeleteNodegroupOutput{} out.Result = output var buff [1024]byte @@ -1844,7 +1835,7 @@ func (m *awsRestjson1_deserializeOpDescribeAddon) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeAddonOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeleteNodegroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -1857,7 +1848,7 @@ func (m *awsRestjson1_deserializeOpDescribeAddon) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeAddon(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteNodegroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -1904,8 +1895,8 @@ func awsRestjson1_deserializeOpErrorDescribeAddon(response *smithyhttp.Response, case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -1913,6 +1904,9 @@ func awsRestjson1_deserializeOpErrorDescribeAddon(response *smithyhttp.Response, case strings.EqualFold("ServerException", errorCode): return awsRestjson1_deserializeErrorServerException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -1923,7 +1917,7 @@ func awsRestjson1_deserializeOpErrorDescribeAddon(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentDescribeAddonOutput(v **DescribeAddonOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDeleteNodegroupOutput(v **DeleteNodegroupOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -1936,17 +1930,17 @@ func awsRestjson1_deserializeOpDocumentDescribeAddonOutput(v **DescribeAddonOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeAddonOutput + var sv *DeleteNodegroupOutput if *v == nil { - sv = &DescribeAddonOutput{} + sv = &DeleteNodegroupOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "addon": - if err := awsRestjson1_deserializeDocumentAddon(&sv.Addon, value); err != nil { + case "nodegroup": + if err := awsRestjson1_deserializeDocumentNodegroup(&sv.Nodegroup, value); err != nil { return err } @@ -1959,14 +1953,14 @@ func awsRestjson1_deserializeOpDocumentDescribeAddonOutput(v **DescribeAddonOutp return nil } -type awsRestjson1_deserializeOpDescribeAddonConfiguration struct { +type awsRestjson1_deserializeOpDeregisterCluster struct { } -func (*awsRestjson1_deserializeOpDescribeAddonConfiguration) ID() string { +func (*awsRestjson1_deserializeOpDeregisterCluster) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeAddonConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeregisterCluster) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -1980,9 +1974,9 @@ func (m *awsRestjson1_deserializeOpDescribeAddonConfiguration) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeAddonConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeregisterCluster(response, &metadata) } - output := &DescribeAddonConfigurationOutput{} + output := &DeregisterClusterOutput{} out.Result = output var buff [1024]byte @@ -2003,7 +1997,7 @@ func (m *awsRestjson1_deserializeOpDescribeAddonConfiguration) HandleDeserialize return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeAddonConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDeregisterClusterOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2016,7 +2010,7 @@ func (m *awsRestjson1_deserializeOpDescribeAddonConfiguration) HandleDeserialize return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeAddonConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeregisterCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2057,11 +2051,507 @@ func awsRestjson1_deserializeOpErrorDescribeAddonConfiguration(response *smithyh } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsRestjson1_deserializeErrorServerException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDeregisterClusterOutput(v **DeregisterClusterOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeregisterClusterOutput + if *v == nil { + sv = &DeregisterClusterOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "cluster": + if err := awsRestjson1_deserializeDocumentCluster(&sv.Cluster, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDescribeAddon struct { +} + +func (*awsRestjson1_deserializeOpDescribeAddon) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDescribeAddon) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDescribeAddon(response, &metadata) + } + output := &DescribeAddonOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentDescribeAddonOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDescribeAddon(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsRestjson1_deserializeErrorServerException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDescribeAddonOutput(v **DescribeAddonOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeAddonOutput + if *v == nil { + sv = &DescribeAddonOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "addon": + if err := awsRestjson1_deserializeDocumentAddon(&sv.Addon, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDescribeAddonConfiguration struct { +} + +func (*awsRestjson1_deserializeOpDescribeAddonConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDescribeAddonConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDescribeAddonConfiguration(response, &metadata) + } + output := &DescribeAddonConfigurationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentDescribeAddonConfigurationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDescribeAddonConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsRestjson1_deserializeErrorServerException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDescribeAddonConfigurationOutput(v **DescribeAddonConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeAddonConfigurationOutput + if *v == nil { + sv = &DescribeAddonConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "addonName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AddonName = ptr.String(jtv) + } + + case "addonVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AddonVersion = ptr.String(jtv) + } + + case "configurationSchema": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ConfigurationSchema = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDescribeAddonVersions struct { +} + +func (*awsRestjson1_deserializeOpDescribeAddonVersions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDescribeAddonVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDescribeAddonVersions(response, &metadata) + } + output := &DescribeAddonVersionsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentDescribeAddonVersionsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDescribeAddonVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServerException", errorCode): return awsRestjson1_deserializeErrorServerException(response, errorBody) @@ -2076,7 +2566,7 @@ func awsRestjson1_deserializeOpErrorDescribeAddonConfiguration(response *smithyh } } -func awsRestjson1_deserializeOpDocumentDescribeAddonConfigurationOutput(v **DescribeAddonConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeAddonVersionsOutput(v **DescribeAddonVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2089,40 +2579,27 @@ func awsRestjson1_deserializeOpDocumentDescribeAddonConfigurationOutput(v **Desc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeAddonConfigurationOutput + var sv *DescribeAddonVersionsOutput if *v == nil { - sv = &DescribeAddonConfigurationOutput{} + sv = &DescribeAddonVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "addonName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AddonName = ptr.String(jtv) - } - - case "addonVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AddonVersion = ptr.String(jtv) + case "addons": + if err := awsRestjson1_deserializeDocumentAddons(&sv.Addons, value); err != nil { + return err } - case "configurationSchema": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.ConfigurationSchema = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } default: @@ -2134,14 +2611,14 @@ func awsRestjson1_deserializeOpDocumentDescribeAddonConfigurationOutput(v **Desc return nil } -type awsRestjson1_deserializeOpDescribeAddonVersions struct { +type awsRestjson1_deserializeOpDescribeCluster struct { } -func (*awsRestjson1_deserializeOpDescribeAddonVersions) ID() string { +func (*awsRestjson1_deserializeOpDescribeCluster) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeAddonVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeCluster) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2155,9 +2632,9 @@ func (m *awsRestjson1_deserializeOpDescribeAddonVersions) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeAddonVersions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeCluster(response, &metadata) } - output := &DescribeAddonVersionsOutput{} + output := &DescribeClusterOutput{} out.Result = output var buff [1024]byte @@ -2178,7 +2655,7 @@ func (m *awsRestjson1_deserializeOpDescribeAddonVersions) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeAddonVersionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeClusterOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2191,7 +2668,7 @@ func (m *awsRestjson1_deserializeOpDescribeAddonVersions) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeAddonVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2232,8 +2709,8 @@ func awsRestjson1_deserializeOpErrorDescribeAddonVersions(response *smithyhttp.R } switch { - case strings.EqualFold("InvalidParameterException", errorCode): - return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -2241,6 +2718,9 @@ func awsRestjson1_deserializeOpErrorDescribeAddonVersions(response *smithyhttp.R case strings.EqualFold("ServerException", errorCode): return awsRestjson1_deserializeErrorServerException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -2251,7 +2731,7 @@ func awsRestjson1_deserializeOpErrorDescribeAddonVersions(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentDescribeAddonVersionsOutput(v **DescribeAddonVersionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeClusterOutput(v **DescribeClusterOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2264,29 +2744,20 @@ func awsRestjson1_deserializeOpDocumentDescribeAddonVersionsOutput(v **DescribeA return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeAddonVersionsOutput + var sv *DescribeClusterOutput if *v == nil { - sv = &DescribeAddonVersionsOutput{} + sv = &DescribeClusterOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "addons": - if err := awsRestjson1_deserializeDocumentAddons(&sv.Addons, value); err != nil { + case "cluster": + if err := awsRestjson1_deserializeDocumentCluster(&sv.Cluster, value); err != nil { return err } - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - default: _, _ = key, value @@ -2296,14 +2767,14 @@ func awsRestjson1_deserializeOpDocumentDescribeAddonVersionsOutput(v **DescribeA return nil } -type awsRestjson1_deserializeOpDescribeCluster struct { +type awsRestjson1_deserializeOpDescribeEksAnywhereSubscription struct { } -func (*awsRestjson1_deserializeOpDescribeCluster) ID() string { +func (*awsRestjson1_deserializeOpDescribeEksAnywhereSubscription) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeCluster) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeEksAnywhereSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2317,9 +2788,9 @@ func (m *awsRestjson1_deserializeOpDescribeCluster) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeCluster(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeEksAnywhereSubscription(response, &metadata) } - output := &DescribeClusterOutput{} + output := &DescribeEksAnywhereSubscriptionOutput{} out.Result = output var buff [1024]byte @@ -2340,7 +2811,7 @@ func (m *awsRestjson1_deserializeOpDescribeCluster) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeClusterOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeEksAnywhereSubscriptionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2353,7 +2824,7 @@ func (m *awsRestjson1_deserializeOpDescribeCluster) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeCluster(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeEksAnywhereSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2416,7 +2887,7 @@ func awsRestjson1_deserializeOpErrorDescribeCluster(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentDescribeClusterOutput(v **DescribeClusterOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeEksAnywhereSubscriptionOutput(v **DescribeEksAnywhereSubscriptionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2429,17 +2900,17 @@ func awsRestjson1_deserializeOpDocumentDescribeClusterOutput(v **DescribeCluster return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeClusterOutput + var sv *DescribeEksAnywhereSubscriptionOutput if *v == nil { - sv = &DescribeClusterOutput{} + sv = &DescribeEksAnywhereSubscriptionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "cluster": - if err := awsRestjson1_deserializeDocumentCluster(&sv.Cluster, value); err != nil { + case "subscription": + if err := awsRestjson1_deserializeDocumentEksAnywhereSubscription(&sv.Subscription, value); err != nil { return err } @@ -3046,7 +3517,169 @@ func awsRestjson1_deserializeOpErrorDescribeUpdate(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentDescribeUpdateOutput(v **DescribeUpdateOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeUpdateOutput(v **DescribeUpdateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeUpdateOutput + if *v == nil { + sv = &DescribeUpdateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "update": + if err := awsRestjson1_deserializeDocumentUpdate(&sv.Update, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDisassociateIdentityProviderConfig struct { +} + +func (*awsRestjson1_deserializeOpDisassociateIdentityProviderConfig) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDisassociateIdentityProviderConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDisassociateIdentityProviderConfig(response, &metadata) + } + output := &DisassociateIdentityProviderConfigOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentDisassociateIdentityProviderConfigOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDisassociateIdentityProviderConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsRestjson1_deserializeErrorServerException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDisassociateIdentityProviderConfigOutput(v **DisassociateIdentityProviderConfigOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3059,9 +3692,9 @@ func awsRestjson1_deserializeOpDocumentDescribeUpdateOutput(v **DescribeUpdateOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeUpdateOutput + var sv *DisassociateIdentityProviderConfigOutput if *v == nil { - sv = &DescribeUpdateOutput{} + sv = &DisassociateIdentityProviderConfigOutput{} } else { sv = *v } @@ -3082,14 +3715,14 @@ func awsRestjson1_deserializeOpDocumentDescribeUpdateOutput(v **DescribeUpdateOu return nil } -type awsRestjson1_deserializeOpDisassociateIdentityProviderConfig struct { +type awsRestjson1_deserializeOpListAddons struct { } -func (*awsRestjson1_deserializeOpDisassociateIdentityProviderConfig) ID() string { +func (*awsRestjson1_deserializeOpListAddons) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDisassociateIdentityProviderConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAddons) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3103,9 +3736,9 @@ func (m *awsRestjson1_deserializeOpDisassociateIdentityProviderConfig) HandleDes } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDisassociateIdentityProviderConfig(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAddons(response, &metadata) } - output := &DisassociateIdentityProviderConfigOutput{} + output := &ListAddonsOutput{} out.Result = output var buff [1024]byte @@ -3126,7 +3759,7 @@ func (m *awsRestjson1_deserializeOpDisassociateIdentityProviderConfig) HandleDes return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDisassociateIdentityProviderConfigOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAddonsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3139,7 +3772,7 @@ func (m *awsRestjson1_deserializeOpDisassociateIdentityProviderConfig) HandleDes return out, metadata, err } -func awsRestjson1_deserializeOpErrorDisassociateIdentityProviderConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAddons(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3189,9 +3822,6 @@ func awsRestjson1_deserializeOpErrorDisassociateIdentityProviderConfig(response case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -3208,7 +3838,7 @@ func awsRestjson1_deserializeOpErrorDisassociateIdentityProviderConfig(response } } -func awsRestjson1_deserializeOpDocumentDisassociateIdentityProviderConfigOutput(v **DisassociateIdentityProviderConfigOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAddonsOutput(v **ListAddonsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3221,20 +3851,29 @@ func awsRestjson1_deserializeOpDocumentDisassociateIdentityProviderConfigOutput( return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DisassociateIdentityProviderConfigOutput + var sv *ListAddonsOutput if *v == nil { - sv = &DisassociateIdentityProviderConfigOutput{} + sv = &ListAddonsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "update": - if err := awsRestjson1_deserializeDocumentUpdate(&sv.Update, value); err != nil { + case "addons": + if err := awsRestjson1_deserializeDocumentStringList(&sv.Addons, value); err != nil { return err } + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + default: _, _ = key, value @@ -3244,14 +3883,14 @@ func awsRestjson1_deserializeOpDocumentDisassociateIdentityProviderConfigOutput( return nil } -type awsRestjson1_deserializeOpListAddons struct { +type awsRestjson1_deserializeOpListClusters struct { } -func (*awsRestjson1_deserializeOpListAddons) ID() string { +func (*awsRestjson1_deserializeOpListClusters) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAddons) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListClusters) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3265,9 +3904,9 @@ func (m *awsRestjson1_deserializeOpListAddons) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAddons(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListClusters(response, &metadata) } - output := &ListAddonsOutput{} + output := &ListClustersOutput{} out.Result = output var buff [1024]byte @@ -3288,7 +3927,7 @@ func (m *awsRestjson1_deserializeOpListAddons) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAddonsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListClustersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3301,7 +3940,7 @@ func (m *awsRestjson1_deserializeOpListAddons) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAddons(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListClusters(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3348,15 +3987,12 @@ func awsRestjson1_deserializeOpErrorListAddons(response *smithyhttp.Response, me case strings.EqualFold("InvalidParameterException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServerException", errorCode): return awsRestjson1_deserializeErrorServerException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3367,7 +4003,7 @@ func awsRestjson1_deserializeOpErrorListAddons(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentListAddonsOutput(v **ListAddonsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListClustersOutput(v **ListClustersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3380,17 +4016,17 @@ func awsRestjson1_deserializeOpDocumentListAddonsOutput(v **ListAddonsOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAddonsOutput + var sv *ListClustersOutput if *v == nil { - sv = &ListAddonsOutput{} + sv = &ListClustersOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "addons": - if err := awsRestjson1_deserializeDocumentStringList(&sv.Addons, value); err != nil { + case "clusters": + if err := awsRestjson1_deserializeDocumentStringList(&sv.Clusters, value); err != nil { return err } @@ -3412,14 +4048,14 @@ func awsRestjson1_deserializeOpDocumentListAddonsOutput(v **ListAddonsOutput, va return nil } -type awsRestjson1_deserializeOpListClusters struct { +type awsRestjson1_deserializeOpListEksAnywhereSubscriptions struct { } -func (*awsRestjson1_deserializeOpListClusters) ID() string { +func (*awsRestjson1_deserializeOpListEksAnywhereSubscriptions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListClusters) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListEksAnywhereSubscriptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3433,9 +4069,9 @@ func (m *awsRestjson1_deserializeOpListClusters) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListClusters(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListEksAnywhereSubscriptions(response, &metadata) } - output := &ListClustersOutput{} + output := &ListEksAnywhereSubscriptionsOutput{} out.Result = output var buff [1024]byte @@ -3456,7 +4092,7 @@ func (m *awsRestjson1_deserializeOpListClusters) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListClustersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListEksAnywhereSubscriptionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3469,7 +4105,7 @@ func (m *awsRestjson1_deserializeOpListClusters) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorListClusters(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListEksAnywhereSubscriptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3532,7 +4168,7 @@ func awsRestjson1_deserializeOpErrorListClusters(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListClustersOutput(v **ListClustersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListEksAnywhereSubscriptionsOutput(v **ListEksAnywhereSubscriptionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3545,20 +4181,15 @@ func awsRestjson1_deserializeOpDocumentListClustersOutput(v **ListClustersOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListClustersOutput + var sv *ListEksAnywhereSubscriptionsOutput if *v == nil { - sv = &ListClustersOutput{} + sv = &ListEksAnywhereSubscriptionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "clusters": - if err := awsRestjson1_deserializeDocumentStringList(&sv.Clusters, value); err != nil { - return err - } - case "nextToken": if value != nil { jtv, ok := value.(string) @@ -3568,6 +4199,11 @@ func awsRestjson1_deserializeOpDocumentListClustersOutput(v **ListClustersOutput sv.NextToken = ptr.String(jtv) } + case "subscriptions": + if err := awsRestjson1_deserializeDocumentEksAnywhereSubscriptionList(&sv.Subscriptions, value); err != nil { + return err + } + default: _, _ = key, value @@ -5114,7 +5750,169 @@ func (m *awsRestjson1_deserializeOpUpdateClusterVersion) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateClusterVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateClusterVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != 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("ClientException", errorCode): + return awsRestjson1_deserializeErrorClientException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceInUseException", errorCode): + return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServerException", errorCode): + return awsRestjson1_deserializeErrorServerException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateClusterVersionOutput(v **UpdateClusterVersionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateClusterVersionOutput + if *v == nil { + sv = &UpdateClusterVersionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "update": + if err := awsRestjson1_deserializeDocumentUpdate(&sv.Update, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateEksAnywhereSubscription struct { +} + +func (*awsRestjson1_deserializeOpUpdateEksAnywhereSubscription) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateEksAnywhereSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateEksAnywhereSubscription(response, &metadata) + } + output := &UpdateEksAnywhereSubscriptionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentUpdateEksAnywhereSubscriptionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateEksAnywhereSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5164,9 +5962,6 @@ func awsRestjson1_deserializeOpErrorUpdateClusterVersion(response *smithyhttp.Re case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceInUseException", errorCode): - return awsRestjson1_deserializeErrorResourceInUseException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -5183,7 +5978,7 @@ func awsRestjson1_deserializeOpErrorUpdateClusterVersion(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentUpdateClusterVersionOutput(v **UpdateClusterVersionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateEksAnywhereSubscriptionOutput(v **UpdateEksAnywhereSubscriptionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -5196,17 +5991,17 @@ func awsRestjson1_deserializeOpDocumentUpdateClusterVersionOutput(v **UpdateClus return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateClusterVersionOutput + var sv *UpdateEksAnywhereSubscriptionOutput if *v == nil { - sv = &UpdateClusterVersionOutput{} + sv = &UpdateEksAnywhereSubscriptionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "update": - if err := awsRestjson1_deserializeDocumentUpdate(&sv.Update, value); err != nil { + case "subscription": + if err := awsRestjson1_deserializeDocumentEksAnywhereSubscription(&sv.Subscription, value); err != nil { return err } @@ -6750,6 +7545,15 @@ func awsRestjson1_deserializeDocumentClientException(v **types.ClientException, sv.NodegroupName = ptr.String(jtv) } + case "subscriptionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SubscriptionId = ptr.String(jtv) + } + default: _, _ = key, value @@ -7272,6 +8076,245 @@ func awsRestjson1_deserializeDocumentControlPlanePlacementResponse(v **types.Con return nil } +func awsRestjson1_deserializeDocumentEksAnywhereSubscription(v **types.EksAnywhereSubscription, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EksAnywhereSubscription + if *v == nil { + sv = &types.EksAnywhereSubscription{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "autoRenew": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.AutoRenew = jtv + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "effectiveDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EffectiveDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "expirationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExpirationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "licenseArns": + if err := awsRestjson1_deserializeDocumentStringList(&sv.LicenseArns, value); err != nil { + return err + } + + case "licenseQuantity": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LicenseQuantity = int32(i64) + } + + case "licenseType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EksAnywhereSubscriptionLicenseType to be of type string, got %T instead", value) + } + sv.LicenseType = types.EksAnywhereSubscriptionLicenseType(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Status = ptr.String(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + case "term": + if err := awsRestjson1_deserializeDocumentEksAnywhereSubscriptionTerm(&sv.Term, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEksAnywhereSubscriptionList(v *[]types.EksAnywhereSubscription, 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.EksAnywhereSubscription + if *v == nil { + cv = []types.EksAnywhereSubscription{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EksAnywhereSubscription + destAddr := &col + if err := awsRestjson1_deserializeDocumentEksAnywhereSubscription(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentEksAnywhereSubscriptionTerm(v **types.EksAnywhereSubscriptionTerm, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.EksAnywhereSubscriptionTerm + if *v == nil { + sv = &types.EksAnywhereSubscriptionTerm{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "duration": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Duration = int32(i64) + } + + case "unit": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EksAnywhereSubscriptionTermUnit to be of type string, got %T instead", value) + } + sv.Unit = types.EksAnywhereSubscriptionTermUnit(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentEncryptionConfig(v **types.EncryptionConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -7879,6 +8922,15 @@ func awsRestjson1_deserializeDocumentInvalidParameterException(v **types.Invalid sv.NodegroupName = ptr.String(jtv) } + case "subscriptionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SubscriptionId = ptr.String(jtv) + } + default: _, _ = key, value @@ -7946,6 +8998,15 @@ func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRe sv.NodegroupName = ptr.String(jtv) } + case "subscriptionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SubscriptionId = ptr.String(jtv) + } + default: _, _ = key, value @@ -9313,6 +10374,15 @@ func awsRestjson1_deserializeDocumentResourceLimitExceededException(v **types.Re sv.NodegroupName = ptr.String(jtv) } + case "subscriptionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SubscriptionId = ptr.String(jtv) + } + default: _, _ = key, value @@ -9389,6 +10459,15 @@ func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.Resourc sv.NodegroupName = ptr.String(jtv) } + case "subscriptionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SubscriptionId = ptr.String(jtv) + } + default: _, _ = key, value @@ -9496,6 +10575,15 @@ func awsRestjson1_deserializeDocumentServerException(v **types.ServerException, sv.NodegroupName = ptr.String(jtv) } + case "subscriptionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SubscriptionId = ptr.String(jtv) + } + default: _, _ = key, value diff --git a/service/eks/generated.json b/service/eks/generated.json index 5dd7ed33a14..42a4c33aa05 100644 --- a/service/eks/generated.json +++ b/service/eks/generated.json @@ -14,10 +14,12 @@ "api_op_AssociateIdentityProviderConfig.go", "api_op_CreateAddon.go", "api_op_CreateCluster.go", + "api_op_CreateEksAnywhereSubscription.go", "api_op_CreateFargateProfile.go", "api_op_CreateNodegroup.go", "api_op_DeleteAddon.go", "api_op_DeleteCluster.go", + "api_op_DeleteEksAnywhereSubscription.go", "api_op_DeleteFargateProfile.go", "api_op_DeleteNodegroup.go", "api_op_DeregisterCluster.go", @@ -25,6 +27,7 @@ "api_op_DescribeAddonConfiguration.go", "api_op_DescribeAddonVersions.go", "api_op_DescribeCluster.go", + "api_op_DescribeEksAnywhereSubscription.go", "api_op_DescribeFargateProfile.go", "api_op_DescribeIdentityProviderConfig.go", "api_op_DescribeNodegroup.go", @@ -32,6 +35,7 @@ "api_op_DisassociateIdentityProviderConfig.go", "api_op_ListAddons.go", "api_op_ListClusters.go", + "api_op_ListEksAnywhereSubscriptions.go", "api_op_ListFargateProfiles.go", "api_op_ListIdentityProviderConfigs.go", "api_op_ListNodegroups.go", @@ -43,6 +47,7 @@ "api_op_UpdateAddon.go", "api_op_UpdateClusterConfig.go", "api_op_UpdateClusterVersion.go", + "api_op_UpdateEksAnywhereSubscription.go", "api_op_UpdateNodegroupConfig.go", "api_op_UpdateNodegroupVersion.go", "deserializers.go", diff --git a/service/eks/serializers.go b/service/eks/serializers.go index 90642ccffdb..950e9d2be02 100644 --- a/service/eks/serializers.go +++ b/service/eks/serializers.go @@ -463,6 +463,115 @@ func awsRestjson1_serializeOpDocumentCreateClusterInput(v *CreateClusterInput, v return nil } +type awsRestjson1_serializeOpCreateEksAnywhereSubscription struct { +} + +func (*awsRestjson1_serializeOpCreateEksAnywhereSubscription) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateEksAnywhereSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateEksAnywhereSubscriptionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/eks-anywhere-subscriptions") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateEksAnywhereSubscriptionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateEksAnywhereSubscriptionInput(v *CreateEksAnywhereSubscriptionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateEksAnywhereSubscriptionInput(v *CreateEksAnywhereSubscriptionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AutoRenew { + ok := object.Key("autoRenew") + ok.Boolean(v.AutoRenew) + } + + if v.ClientRequestToken != nil { + ok := object.Key("clientRequestToken") + ok.String(*v.ClientRequestToken) + } + + if v.LicenseQuantity != 0 { + ok := object.Key("licenseQuantity") + ok.Integer(v.LicenseQuantity) + } + + if len(v.LicenseType) > 0 { + ok := object.Key("licenseType") + ok.String(string(v.LicenseType)) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + if v.Term != nil { + ok := object.Key("term") + if err := awsRestjson1_serializeDocumentEksAnywhereSubscriptionTerm(v.Term, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpCreateFargateProfile struct { } @@ -911,6 +1020,71 @@ func awsRestjson1_serializeOpHttpBindingsDeleteClusterInput(v *DeleteClusterInpu return nil } +type awsRestjson1_serializeOpDeleteEksAnywhereSubscription struct { +} + +func (*awsRestjson1_serializeOpDeleteEksAnywhereSubscription) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteEksAnywhereSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteEksAnywhereSubscriptionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/eks-anywhere-subscriptions/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteEksAnywhereSubscriptionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteEksAnywhereSubscriptionInput(v *DeleteEksAnywhereSubscriptionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDeleteFargateProfile struct { } @@ -1417,6 +1591,71 @@ func awsRestjson1_serializeOpHttpBindingsDescribeClusterInput(v *DescribeCluster return nil } +type awsRestjson1_serializeOpDescribeEksAnywhereSubscription struct { +} + +func (*awsRestjson1_serializeOpDescribeEksAnywhereSubscription) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeEksAnywhereSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeEksAnywhereSubscriptionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/eks-anywhere-subscriptions/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDescribeEksAnywhereSubscriptionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDescribeEksAnywhereSubscriptionInput(v *DescribeEksAnywhereSubscriptionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDescribeFargateProfile struct { } @@ -1975,6 +2214,76 @@ func awsRestjson1_serializeOpHttpBindingsListClustersInput(v *ListClustersInput, return nil } +type awsRestjson1_serializeOpListEksAnywhereSubscriptions struct { +} + +func (*awsRestjson1_serializeOpListEksAnywhereSubscriptions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListEksAnywhereSubscriptions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListEksAnywhereSubscriptionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/eks-anywhere-subscriptions") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListEksAnywhereSubscriptionsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListEksAnywhereSubscriptionsInput(v *ListEksAnywhereSubscriptionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.IncludeStatus != nil { + for i := range v.IncludeStatus { + encoder.AddQuery("includeStatus").String(string(v.IncludeStatus[i])) + } + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpListFargateProfiles struct { } @@ -2907,6 +3216,99 @@ func awsRestjson1_serializeOpDocumentUpdateClusterVersionInput(v *UpdateClusterV return nil } +type awsRestjson1_serializeOpUpdateEksAnywhereSubscription struct { +} + +func (*awsRestjson1_serializeOpUpdateEksAnywhereSubscription) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateEksAnywhereSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateEksAnywhereSubscriptionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/eks-anywhere-subscriptions/{id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateEksAnywhereSubscriptionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateEksAnywhereSubscriptionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateEksAnywhereSubscriptionInput(v *UpdateEksAnywhereSubscriptionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateEksAnywhereSubscriptionInput(v *UpdateEksAnywhereSubscriptionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + { + ok := object.Key("autoRenew") + ok.Boolean(v.AutoRenew) + } + + if v.ClientRequestToken != nil { + ok := object.Key("clientRequestToken") + ok.String(*v.ClientRequestToken) + } + + return nil +} + type awsRestjson1_serializeOpUpdateNodegroupConfig struct { } @@ -3180,6 +3582,23 @@ func awsRestjson1_serializeDocumentControlPlanePlacementRequest(v *types.Control return nil } +func awsRestjson1_serializeDocumentEksAnywhereSubscriptionTerm(v *types.EksAnywhereSubscriptionTerm, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Duration != 0 { + ok := object.Key("duration") + ok.Integer(v.Duration) + } + + if len(v.Unit) > 0 { + ok := object.Key("unit") + ok.String(string(v.Unit)) + } + + return nil +} + func awsRestjson1_serializeDocumentEncryptionConfig(v *types.EncryptionConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/eks/types/enums.go b/service/eks/types/enums.go index d482ba15b5e..a27be80075a 100644 --- a/service/eks/types/enums.go +++ b/service/eks/types/enums.go @@ -248,6 +248,67 @@ func (ConnectorConfigProvider) Values() []ConnectorConfigProvider { } } +type EksAnywhereSubscriptionLicenseType string + +// Enum values for EksAnywhereSubscriptionLicenseType +const ( + EksAnywhereSubscriptionLicenseTypeCluster EksAnywhereSubscriptionLicenseType = "Cluster" +) + +// Values returns all known values for EksAnywhereSubscriptionLicenseType. Note +// that this can be expanded in the future, and 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 (EksAnywhereSubscriptionLicenseType) Values() []EksAnywhereSubscriptionLicenseType { + return []EksAnywhereSubscriptionLicenseType{ + "Cluster", + } +} + +type EksAnywhereSubscriptionStatus string + +// Enum values for EksAnywhereSubscriptionStatus +const ( + EksAnywhereSubscriptionStatusCreating EksAnywhereSubscriptionStatus = "CREATING" + EksAnywhereSubscriptionStatusActive EksAnywhereSubscriptionStatus = "ACTIVE" + EksAnywhereSubscriptionStatusUpdating EksAnywhereSubscriptionStatus = "UPDATING" + EksAnywhereSubscriptionStatusExpiring EksAnywhereSubscriptionStatus = "EXPIRING" + EksAnywhereSubscriptionStatusExpired EksAnywhereSubscriptionStatus = "EXPIRED" + EksAnywhereSubscriptionStatusDeleting EksAnywhereSubscriptionStatus = "DELETING" +) + +// Values returns all known values for EksAnywhereSubscriptionStatus. Note that +// this can be expanded in the future, and 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 (EksAnywhereSubscriptionStatus) Values() []EksAnywhereSubscriptionStatus { + return []EksAnywhereSubscriptionStatus{ + "CREATING", + "ACTIVE", + "UPDATING", + "EXPIRING", + "EXPIRED", + "DELETING", + } +} + +type EksAnywhereSubscriptionTermUnit string + +// Enum values for EksAnywhereSubscriptionTermUnit +const ( + EksAnywhereSubscriptionTermUnitMonths EksAnywhereSubscriptionTermUnit = "MONTHS" +) + +// Values returns all known values for EksAnywhereSubscriptionTermUnit. Note that +// this can be expanded in the future, and 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 (EksAnywhereSubscriptionTermUnit) Values() []EksAnywhereSubscriptionTermUnit { + return []EksAnywhereSubscriptionTermUnit{ + "MONTHS", + } +} + type ErrorCode string // Enum values for ErrorCode diff --git a/service/eks/types/errors.go b/service/eks/types/errors.go index cadcc26ee55..1302b81a4ea 100644 --- a/service/eks/types/errors.go +++ b/service/eks/types/errors.go @@ -7,11 +7,10 @@ import ( smithy "github.com/aws/smithy-go" ) -// You don't have permissions to perform the requested operation. The user or role -// that is making the request must have at least one IAM permissions policy -// attached that grants the required permissions. For more information, see Access -// Management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) in the -// IAM User Guide. +// You don't have permissions to perform the requested operation. The IAM principal (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) +// making the request must have at least one IAM permissions policy attached that +// grants the required permissions. For more information, see Access management (https://docs.aws.amazon.com/IAM/latest/UserGuide/access.html) +// in the IAM User Guide. type AccessDeniedException struct { Message *string @@ -65,16 +64,18 @@ func (e *BadRequestException) ErrorCode() string { func (e *BadRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // These errors are usually caused by a client action. Actions can include using -// an action or resource on behalf of a user that doesn't have permissions to use -// the action or resource or specifying an identifier that is not valid. +// an action or resource on behalf of an IAM principal (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) +// that doesn't have permissions to use the action or resource or specifying an +// identifier that is not valid. type ClientException struct { Message *string ErrorCodeOverride *string - ClusterName *string - NodegroupName *string - AddonName *string + ClusterName *string + NodegroupName *string + AddonName *string + SubscriptionId *string noSmithyDocumentSerde } @@ -107,6 +108,7 @@ type InvalidParameterException struct { NodegroupName *string FargateProfileName *string AddonName *string + SubscriptionId *string noSmithyDocumentSerde } @@ -135,9 +137,10 @@ type InvalidRequestException struct { ErrorCodeOverride *string - ClusterName *string - NodegroupName *string - AddonName *string + ClusterName *string + NodegroupName *string + AddonName *string + SubscriptionId *string noSmithyDocumentSerde } @@ -222,8 +225,9 @@ type ResourceLimitExceededException struct { ErrorCodeOverride *string - ClusterName *string - NodegroupName *string + ClusterName *string + NodegroupName *string + SubscriptionId *string noSmithyDocumentSerde } @@ -257,6 +261,7 @@ type ResourceNotFoundException struct { NodegroupName *string FargateProfileName *string AddonName *string + SubscriptionId *string noSmithyDocumentSerde } @@ -311,9 +316,10 @@ type ServerException struct { ErrorCodeOverride *string - ClusterName *string - NodegroupName *string - AddonName *string + ClusterName *string + NodegroupName *string + AddonName *string + SubscriptionId *string noSmithyDocumentSerde } diff --git a/service/eks/types/types.go b/service/eks/types/types.go index a2abbc22c63..f79ad81b18f 100644 --- a/service/eks/types/types.go +++ b/service/eks/types/types.go @@ -318,7 +318,7 @@ type ConnectorConfigResponse struct { // The placement configuration for all the control plane instances of your local // Amazon EKS cluster on an Amazon Web Services Outpost. For more information, see // Capacity considerations (https://docs.aws.amazon.com/eks/latest/userguide/eks-outposts-capacity-considerations.html) -// in the Amazon EKS User Guide +// in the Amazon EKS User Guide. type ControlPlanePlacementRequest struct { // The name of the placement group for the Kubernetes control plane instances. @@ -340,6 +340,72 @@ type ControlPlanePlacementResponse struct { noSmithyDocumentSerde } +// An EKS Anywhere subscription authorizing the customer to support for licensed +// clusters and access to EKS Anywhere Curated Packages. +type EksAnywhereSubscription struct { + + // The Amazon Resource Name (ARN) for the subscription. + Arn *string + + // A boolean indicating whether or not a subscription will auto renew when it + // expires. + AutoRenew bool + + // The Unix timestamp in seconds for when the subscription was created. + CreatedAt *time.Time + + // The Unix timestamp in seconds for when the subscription is effective. + EffectiveDate *time.Time + + // The Unix timestamp in seconds for when the subscription will expire or auto + // renew, depending on the auto renew configuration of the subscription object. + ExpirationDate *time.Time + + // UUID identifying a subscription. + Id *string + + // License Manager License ARNs associated with the subscription. + LicenseArns []string + + // The number of licenses included in a subscription. Valid values are between 1 + // and 1000. + LicenseQuantity int32 + + // The type of licenses included in the subscription. Valid value is CLUSTER. With + // the CLUSTER license type, each license covers support for a single EKS Anywhere + // cluster. + LicenseType EksAnywhereSubscriptionLicenseType + + // The status of a subscription. + Status *string + + // The metadata for a subscription to assist with categorization and organization. + // Each tag consists of a key and an optional value. Subscription tags do not + // propagate to any other resources associated with the subscription. + Tags map[string]string + + // An EksAnywhereSubscriptionTerm object. + Term *EksAnywhereSubscriptionTerm + + noSmithyDocumentSerde +} + +// An object representing the term duration and term unit type of your +// subscription. This determines the term length of your subscription. Valid values +// are MONTHS for term unit and 12 or 36 for term duration, indicating a 12 month +// or 36 month subscription. +type EksAnywhereSubscriptionTerm struct { + + // The duration of the subscription term. Valid values are 12 and 36, indicating a + // 12 month or 36 month subscription. + Duration int32 + + // The term unit of the subscription. Valid value is MONTHS. + Unit EksAnywhereSubscriptionTermUnit + + noSmithyDocumentSerde +} + // The encryption configuration for the cluster. type EncryptionConfig struct { @@ -1022,9 +1088,10 @@ type OutpostConfigResponse struct { type Provider struct { // Amazon Resource Name (ARN) or alias of the KMS key. The KMS key must be - // symmetric, created in the same region as the cluster, and if the KMS key was - // created in a different account, the user must have access to the KMS key. For - // more information, see Allowing Users in Other Accounts to Use a KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-modifying-external-accounts.html) + // symmetric and created in the same Amazon Web Services Region as the cluster. If + // the KMS key was created in a different account, the IAM principal (https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_terms-and-concepts.html) + // must have access to the KMS key. For more information, see Allowing users in + // other accounts to use a KMS key (https://docs.aws.amazon.com/kms/latest/developerguide/key-policy-modifying-external-accounts.html) // in the Key Management Service Developer Guide. KeyArn *string diff --git a/service/eks/validators.go b/service/eks/validators.go index 2fe1b106103..d7bc907cc70 100644 --- a/service/eks/validators.go +++ b/service/eks/validators.go @@ -90,6 +90,26 @@ func (m *validateOpCreateCluster) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpCreateEksAnywhereSubscription struct { +} + +func (*validateOpCreateEksAnywhereSubscription) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateEksAnywhereSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateEksAnywhereSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateEksAnywhereSubscriptionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateFargateProfile struct { } @@ -170,6 +190,26 @@ func (m *validateOpDeleteCluster) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpDeleteEksAnywhereSubscription struct { +} + +func (*validateOpDeleteEksAnywhereSubscription) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteEksAnywhereSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteEksAnywhereSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteEksAnywhereSubscriptionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteFargateProfile struct { } @@ -290,6 +330,26 @@ func (m *validateOpDescribeCluster) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpDescribeEksAnywhereSubscription struct { +} + +func (*validateOpDescribeEksAnywhereSubscription) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeEksAnywhereSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeEksAnywhereSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeEksAnywhereSubscriptionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeFargateProfile struct { } @@ -630,6 +690,26 @@ func (m *validateOpUpdateClusterVersion) HandleInitialize(ctx context.Context, i return next.HandleInitialize(ctx, in) } +type validateOpUpdateEksAnywhereSubscription struct { +} + +func (*validateOpUpdateEksAnywhereSubscription) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateEksAnywhereSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateEksAnywhereSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateEksAnywhereSubscriptionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateNodegroupConfig struct { } @@ -686,6 +766,10 @@ func addOpCreateClusterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateCluster{}, middleware.After) } +func addOpCreateEksAnywhereSubscriptionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateEksAnywhereSubscription{}, middleware.After) +} + func addOpCreateFargateProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateFargateProfile{}, middleware.After) } @@ -702,6 +786,10 @@ func addOpDeleteClusterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteCluster{}, middleware.After) } +func addOpDeleteEksAnywhereSubscriptionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteEksAnywhereSubscription{}, middleware.After) +} + func addOpDeleteFargateProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteFargateProfile{}, middleware.After) } @@ -726,6 +814,10 @@ func addOpDescribeClusterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeCluster{}, middleware.After) } +func addOpDescribeEksAnywhereSubscriptionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeEksAnywhereSubscription{}, middleware.After) +} + func addOpDescribeFargateProfileValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeFargateProfile{}, middleware.After) } @@ -794,6 +886,10 @@ func addOpUpdateClusterVersionValidationMiddleware(stack *middleware.Stack) erro return stack.Initialize.Add(&validateOpUpdateClusterVersion{}, middleware.After) } +func addOpUpdateEksAnywhereSubscriptionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateEksAnywhereSubscription{}, middleware.After) +} + func addOpUpdateNodegroupConfigValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateNodegroupConfig{}, middleware.After) } @@ -961,6 +1057,24 @@ func validateOpCreateClusterInput(v *CreateClusterInput) error { } } +func validateOpCreateEksAnywhereSubscriptionInput(v *CreateEksAnywhereSubscriptionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateEksAnywhereSubscriptionInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Term == nil { + invalidParams.Add(smithy.NewErrParamRequired("Term")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateFargateProfileInput(v *CreateFargateProfileInput) error { if v == nil { return nil @@ -1039,6 +1153,21 @@ func validateOpDeleteClusterInput(v *DeleteClusterInput) error { } } +func validateOpDeleteEksAnywhereSubscriptionInput(v *DeleteEksAnywhereSubscriptionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteEksAnywhereSubscriptionInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteFargateProfileInput(v *DeleteFargateProfileInput) error { if v == nil { return nil @@ -1141,6 +1270,21 @@ func validateOpDescribeClusterInput(v *DescribeClusterInput) error { } } +func validateOpDescribeEksAnywhereSubscriptionInput(v *DescribeEksAnywhereSubscriptionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeEksAnywhereSubscriptionInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeFargateProfileInput(v *DescribeFargateProfileInput) error { if v == nil { return nil @@ -1438,6 +1582,21 @@ func validateOpUpdateClusterVersionInput(v *UpdateClusterVersionInput) error { } } +func validateOpUpdateEksAnywhereSubscriptionInput(v *UpdateEksAnywhereSubscriptionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateEksAnywhereSubscriptionInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateNodegroupConfigInput(v *UpdateNodegroupConfigInput) error { if v == nil { return nil diff --git a/service/lambda/types/enums.go b/service/lambda/types/enums.go index 7ab39cbfa8d..0c41a349d4d 100644 --- a/service/lambda/types/enums.go +++ b/service/lambda/types/enums.go @@ -336,39 +336,40 @@ type Runtime string // Enum values for Runtime const ( - RuntimeNodejs Runtime = "nodejs" - RuntimeNodejs43 Runtime = "nodejs4.3" - RuntimeNodejs610 Runtime = "nodejs6.10" - RuntimeNodejs810 Runtime = "nodejs8.10" - RuntimeNodejs10x Runtime = "nodejs10.x" - RuntimeNodejs12x Runtime = "nodejs12.x" - RuntimeNodejs14x Runtime = "nodejs14.x" - RuntimeNodejs16x Runtime = "nodejs16.x" - RuntimeJava8 Runtime = "java8" - RuntimeJava8al2 Runtime = "java8.al2" - RuntimeJava11 Runtime = "java11" - RuntimePython27 Runtime = "python2.7" - RuntimePython36 Runtime = "python3.6" - RuntimePython37 Runtime = "python3.7" - RuntimePython38 Runtime = "python3.8" - RuntimePython39 Runtime = "python3.9" - RuntimeDotnetcore10 Runtime = "dotnetcore1.0" - RuntimeDotnetcore20 Runtime = "dotnetcore2.0" - RuntimeDotnetcore21 Runtime = "dotnetcore2.1" - RuntimeDotnetcore31 Runtime = "dotnetcore3.1" - RuntimeDotnet6 Runtime = "dotnet6" - RuntimeNodejs43edge Runtime = "nodejs4.3-edge" - RuntimeGo1x Runtime = "go1.x" - RuntimeRuby25 Runtime = "ruby2.5" - RuntimeRuby27 Runtime = "ruby2.7" - RuntimeProvided Runtime = "provided" - RuntimeProvidedal2 Runtime = "provided.al2" - RuntimeNodejs18x Runtime = "nodejs18.x" - RuntimePython310 Runtime = "python3.10" - RuntimeJava17 Runtime = "java17" - RuntimeRuby32 Runtime = "ruby3.2" - RuntimePython311 Runtime = "python3.11" - RuntimeNodejs20x Runtime = "nodejs20.x" + RuntimeNodejs Runtime = "nodejs" + RuntimeNodejs43 Runtime = "nodejs4.3" + RuntimeNodejs610 Runtime = "nodejs6.10" + RuntimeNodejs810 Runtime = "nodejs8.10" + RuntimeNodejs10x Runtime = "nodejs10.x" + RuntimeNodejs12x Runtime = "nodejs12.x" + RuntimeNodejs14x Runtime = "nodejs14.x" + RuntimeNodejs16x Runtime = "nodejs16.x" + RuntimeJava8 Runtime = "java8" + RuntimeJava8al2 Runtime = "java8.al2" + RuntimeJava11 Runtime = "java11" + RuntimePython27 Runtime = "python2.7" + RuntimePython36 Runtime = "python3.6" + RuntimePython37 Runtime = "python3.7" + RuntimePython38 Runtime = "python3.8" + RuntimePython39 Runtime = "python3.9" + RuntimeDotnetcore10 Runtime = "dotnetcore1.0" + RuntimeDotnetcore20 Runtime = "dotnetcore2.0" + RuntimeDotnetcore21 Runtime = "dotnetcore2.1" + RuntimeDotnetcore31 Runtime = "dotnetcore3.1" + RuntimeDotnet6 Runtime = "dotnet6" + RuntimeNodejs43edge Runtime = "nodejs4.3-edge" + RuntimeGo1x Runtime = "go1.x" + RuntimeRuby25 Runtime = "ruby2.5" + RuntimeRuby27 Runtime = "ruby2.7" + RuntimeProvided Runtime = "provided" + RuntimeProvidedal2 Runtime = "provided.al2" + RuntimeNodejs18x Runtime = "nodejs18.x" + RuntimePython310 Runtime = "python3.10" + RuntimeJava17 Runtime = "java17" + RuntimeRuby32 Runtime = "ruby3.2" + RuntimePython311 Runtime = "python3.11" + RuntimeNodejs20x Runtime = "nodejs20.x" + RuntimeProvidedal2023 Runtime = "provided.al2023" ) // Values returns all known values for Runtime. Note that this can be expanded in @@ -409,6 +410,7 @@ func (Runtime) Values() []Runtime { "ruby3.2", "python3.11", "nodejs20.x", + "provided.al2023", } } diff --git a/service/omics/api_op_CreateMultipartReadSetUpload.go b/service/omics/api_op_CreateMultipartReadSetUpload.go index f4941c7650c..a3789b0a50a 100644 --- a/service/omics/api_op_CreateMultipartReadSetUpload.go +++ b/service/omics/api_op_CreateMultipartReadSetUpload.go @@ -40,11 +40,6 @@ type CreateMultipartReadSetUploadInput struct { // This member is required. Name *string - // The ARN of the reference. - // - // This member is required. - ReferenceArn *string - // The source's sample ID. // // This member is required. @@ -76,6 +71,9 @@ type CreateMultipartReadSetUploadInput struct { // Where the source originated. GeneratedFrom *string + // The ARN of the reference. + ReferenceArn *string + // Any tags to add to the read set. Tags map[string]string diff --git a/service/omics/types/enums.go b/service/omics/types/enums.go index 43b3a72014c..a0298f99220 100644 --- a/service/omics/types/enums.go +++ b/service/omics/types/enums.go @@ -117,6 +117,7 @@ const ( FileTypeFastq FileType = "FASTQ" FileTypeBam FileType = "BAM" FileTypeCram FileType = "CRAM" + FileTypeUbam FileType = "UBAM" ) // Values returns all known values for FileType. Note that this can be expanded in @@ -127,6 +128,7 @@ func (FileType) Values() []FileType { "FASTQ", "BAM", "CRAM", + "UBAM", } } diff --git a/service/omics/types/types.go b/service/omics/types/types.go index 26dba84efbe..a8e4d3f9e81 100644 --- a/service/omics/types/types.go +++ b/service/omics/types/types.go @@ -1299,11 +1299,6 @@ type StartReadSetActivationJobSourceItem struct { // A source for a read set import job. type StartReadSetImportJobSourceItem struct { - // The source's reference ARN. - // - // This member is required. - ReferenceArn *string - // The source's sample ID. // // This member is required. @@ -1333,6 +1328,9 @@ type StartReadSetImportJobSourceItem struct { // The source's name. Name *string + // The source's reference ARN. + ReferenceArn *string + // The source's tags. Tags map[string]string diff --git a/service/omics/validators.go b/service/omics/validators.go index 81c140330ec..8a44f55e908 100644 --- a/service/omics/validators.go +++ b/service/omics/validators.go @@ -1947,9 +1947,6 @@ func validateStartReadSetImportJobSourceItem(v *types.StartReadSetImportJobSourc if v.SampleId == nil { invalidParams.Add(smithy.NewErrParamRequired("SampleId")) } - if v.ReferenceArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ReferenceArn")) - } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2217,9 +2214,6 @@ func validateOpCreateMultipartReadSetUploadInput(v *CreateMultipartReadSetUpload if v.SampleId == nil { invalidParams.Add(smithy.NewErrParamRequired("SampleId")) } - if v.ReferenceArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("ReferenceArn")) - } if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) }